How to use the Json Variables Value in Azure DevOps YAML Pipeline?
Shekhar Khadka
5
Reputation points
I want to deploy the azure resources(ADF) and while deploying I need to override some DEV ARM template parameters and one of the parameters to deploy is of JSON OBJECT which I store its value in the pipeline Variable Group as below;
Actually the value looks like this {"minutes":[00],"hours":[5],"weekDays":["Monday","Tuesday","Wednesday","Thursday","Friday"]}
Since in azure DevOps pipeline, every Variable value that we fetch will be treated as a string type but my parameter for the ARM template need the value of Json type.
- task: AzurePowerShell@5
displayName: Deploy ADF
inputs:
azureSubscription: '$(azureSubscription)'
ScriptType: 'InlineScript'
Inline:
New-AzResourceGroupDeployment `
-ResourceGroupName "$(DeploymentResourceGroupName)" `
-TemplateParameterFile "$(System.DefaultWorkingDirectory)/$(SourceDataFactoryName)/ARMTemplateParametersForFactory.json" `
-TemplateFile "$(System.DefaultWorkingDirectory)/$(SourceDataFactoryName)/ARMTemplateForFactory.json" `
-factoryName "$(DeployDataFactoryName)" `
-LocalTesting_properties_typeProperties_recurrence_schedule $Trigger_Schedule `
#
Sign in to answer