Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for parameter override #21

Closed
vermegi opened this issue Nov 2, 2020 · 6 comments
Closed

Allow for parameter override #21

vermegi opened this issue Nov 2, 2020 · 6 comments
Labels
default stale 90 days old

Comments

@vermegi
Copy link
Member

vermegi commented Nov 2, 2020

When creating an ARM deployment, I would like to provide both a parameter file and override certain parameters through the arm-deploy action. This is handy when overall parameters exist in the parameter file, but you would like to override certain values during deploy in your pipeline.

One example is where I want to use this action twice, once for creating a resource group, where I determine the resourcegroup name in the workflow and then reuse that value for deploying the resources.

  # Deployment of resource group template    
  - name: Deploy ARM Template resourcegroup
    uses: azure/arm-deploy@v1
    with:
      # You can change these environment variables for your configuration:   AZURE_SUBSCRIPTION_ID
      scope: subscription
      subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
      region: centralus # Set this to your target region
      template: repo/ARM/azuredeploy.resourcegroup.json  # Set this to the location of your template file
      parameters: repo/ARM/azuredeploy.resourcegroup.parameters.json # Set this to the location of your parameters file
      parameters: rgName=${{env.RESOURCEGROUP_NAME}} #override rgName in parameters file

  # Deployment of template    
  - name: Deploy ARM Template resources
    uses: azure/arm-deploy@v1
    with:
      # You can change these environment variables for your configuration:   AZURE_SUBSCRIPTION_ID
      scope: resourcegroup
      subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
      resourcegroup: ${{env.RESOURCEGROUP_NAME}} # reuse resourcegroup name
      region: centralus # Set this to your target region
      template: repo/ARM/azuredeploy.json  # Set this to the location of your template file
      parameters: repo/ARM/azuredeploy.parameters.json # Set this to the location of your parameters file
@kanika1894
Copy link
Contributor

Hey @vermegi ,
You can override the parameters in parameter file by explictly calling it out next to the parameter file.
Example :
parameters: repo/ARM/azuredeploy.resourcegroup.parameters.json rgName=${{env.RESOURCEGROUP_NAME}}
This will override the rgName.

@vermegi
Copy link
Member Author

vermegi commented Nov 9, 2020

Ah, excellent, didn't know that was possible. Can this be explicitly mentioned in the documentation/samples? It is not clear at the moment that this is also an option.

@kanika1894
Copy link
Contributor

sure! @pulkitaggarwl can you please take care of the documentation?

@github-actions
Copy link

This issue is stale because it has been open for 7 days with no activity.

@github-actions github-actions bot added the stale 90 days old label Nov 19, 2020
@github-actions
Copy link

This issue is marked default for generating issues report.

@kanika1894
Copy link
Contributor

https://github.com/Azure/arm-deploy/pull/26/files : changes merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
default stale 90 days old
Projects
None yet
Development

No branches or pull requests

2 participants