-
-
Save johnlokerse/c89cad55afcd1431e9c803cc61bd9576 to your computer and use it in GitHub Desktop.
Work with environment variables in Azure Bicep blog
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
parameters: | |
- name: Environment | |
type: string | |
default: dev | |
values: | |
- prod | |
- acc | |
- tst | |
- dev | |
pool: | |
vmImage: 'windows-latest' | |
variables: | |
- name: Environment | |
value: ${{ parameters.Environment }} | |
steps: | |
- powershell: | | |
$random = -join ((65..90) + (97..122) | Get-Random -Count 10 | ForEach-Object {[char]$_}) | |
Write-Output "##vso[task.setvariable variable=RandomizedString]$random" | |
displayName: 'Set a variable from pipeline' | |
- task: AzureCLI@2 | |
inputs: | |
azureSubscription: 'spn-readEnvironmentVariable' | |
scriptType: 'pscore' | |
scriptLocation: 'inlineScript' | |
inlineScript: | | |
az deployment group create --template-file ./demo.bicep --parameters ./demo.bicepparam --resource-group rg-playground |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment