Last active
January 24, 2021 13:15
-
-
Save TheCloudScout/ab8a03f7ad33185007f221d7a825b20d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger: none | |
pool: | |
vmImage: 'ubuntu-latest' | |
steps: | |
- task: AzureCLI@2 | |
displayName: Retrieve Service Connection credentials | |
inputs: | |
azureSubscription: '<Service Connection name>' | |
scriptType: 'pscore' | |
scriptLocation: 'inlineScript' | |
inlineScript: | | |
Write-Host "tenantId: $([System.Convert]::ToBase64String([System.Text.ASCIIEncoding]::ASCII.GetBytes([System.Environment]::GetEnvironmentVariable("tenantId"))))" | |
Write-Host "servicePrincipalId: $([System.Convert]::ToBase64String([System.Text.ASCIIEncoding]::ASCII.GetBytes([System.Environment]::GetEnvironmentVariable("servicePrincipalId"))))" | |
Write-Host "servicePrincipalKey: $([System.Convert]::ToBase64String([System.Text.ASCIIEncoding]::ASCII.GetBytes([System.Environment]::GetEnvironmentVariable("servicePrincipalKey"))))" | |
Write-Host "" | |
Write-Host "You can decode these values in PowerShell with: [System.Text.ASCIIEncoding]::ASCII.GetString([System.Convert]::FromBase64String(""<Base64 encoded string>""))" | |
addSpnToEnvironment: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment