How to use the Json Variables Value in Azure DevOps YAML Pipeline?

Shekhar Khadka 0 Reputation points
2023-08-01T01:48:30.3166667+00:00

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;

enter image description here

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 `
             #
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,136 questions
{count} votes