-1

How to use variable groups in azure biceps file

In order to pass variables like retention days and others from library

I haven't tried yet

  • Your question lacks a lot of details for someone to be able to help you. I would suggest you read over https://stackoverflow.com/help/how-to-ask and then improve your question so we can help you. – tj-cappelletti Feb 24 '23 at 13:23
  • *I haven't tried yet*. This is your first problem. Please review documentation on the tools you're trying to use, formulate a solution, attempt to implement that solution, and ask a question here if you encounter some difficulty that you can't resolve on your own. – Daniel Mann Feb 24 '23 at 14:26
  • Please provide enough code so others can better understand or reproduce the problem. – Community Feb 24 '23 at 18:31

1 Answers1

0

As one of ways.. if you use variable groups as DEV/TEST/PROD envs, you may build your bicep file with parameters by:

az bicep build --file {your_file}

Then use generated ARM template in AzureResourceManagerTemplateDeployment task and assign values from your variable groups through overrideParameters section:

- task: AzureResourceManagerTemplateDeployment@3
  displayName: 'ARM Template deployment: Resource Group scope'
  inputs:
    azureResourceManagerConnection: 'XXXXXXXXXXXXXXX'
    subscriptionId: 'XXXXXXXXXXXXXXXX'
    resourceGroupName: 'XXXXXXXXXXXXX'
    location: 'XXXXXXXX'
    csmFile: '$(System.DefaultWorkingDirectory)/arm-template.json'
    overrideParameters: '-param1 "$(param_value1)" -param2 "$(param_value1)"'
Shamrai Aleksander
  • 13,096
  • 3
  • 24
  • 31