ARM template location valure change

sns 9,231 Reputation points
2023-04-24T08:11:59.8466667+00:00

how do we change the parameter value location from east us to west us ( for ARM Template) in the azure pipelines without touching changing the code in the repo?

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,196 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sedat SALMAN 13,350 Reputation points
    2023-04-25T08:37:21.4166667+00:00

    To change the location value of an ARM template deployment without modifying the code in the repo, you can pass the parameter value in your Azure DevOps pipeline. You can do this using the overrideParameters property of the AzureResourceManagerTemplateDeployment@3 task in your Azure pipeline YAML file. Example YAML:

    
    trigger:
    - main
    
    pool:
      vmImage: 'ubuntu-latest'
    
    steps:
    - task: AzureResourceManagerTemplateDeployment@3
      inputs:
        azureResourceManagerConnection: 'YourAzureConnectionName'
        subscriptionId: 'your-subscription-id'
        resourceGroupName: 'your-resource-group-name'
        location: 'West US'
        csmFile: 'path/to/your/arm/template.json'
        csmParametersFile: 'path/to/your/arm/parameters.json'
        overrideParameters: '-location "West US"'
        deploymentMode: 'Incremental'
    
    
    0 comments No comments