Azure / arm-deploy

ARM action to deploy an Azure Resource Manager (ARM) template to all the deployment scopes
MIT License
82 stars 36 forks source link

Supported for '=' in parameter file #133

Open JFolberth opened 1 year ago

JFolberth commented 1 year ago

I believe there is a bug when passing in values to the parameter argument. My scenario is I am deploying Data Factory w/ Linked ARM templates. As part of this deployment I am :

  1. creating a storage account
  2. creating a container in the storage account
  3. uploading templates to the storage account
  4. creating a SAS for the container
  5. running an ARM deployment
  6. deleing the storage account

I am seeing an issue when the ARM deployment executes that the template file w/ the URL for the storage account and including the SAS key works. This same method does not work with the parameters and it appears it is stopping on the '=' in the SAS key and thinks this is an override to an ARM parameter in the template.

Error: ERROR: unrecognized template parameter 'https://saadf1234deveus.blob.core.windows.net/templates/datafactory/cicd-parameters/ARMTemplateParams-Dev.json?se'. Allowed parameters: LS_AKV_Storage_Demo_properties_typeProperties_baseUrl, containerSasToken, containerUri, factoryName

Link to my action: https://github.com/JFolberth/adf-cicd-demo/actions/runs/5207084212/jobs/9394295417

Here is the code:

    - name: Run ARM deploy
      uses: azure/arm-deploy@v1
      with:
        resourceGroupName: ${{ inputs.resource-group-name }}
        template:  ${{ format('{0}?{1}', 'https://saadf1234deveus.blob.core.windows.net/templates/linkedTemplates/ArmTemplate_master.json',env.SAS_TOKEN) }}
        parameters: ${{ format('{0}/{1}?{2}', 'https://saadf1234deveus.blob.core.windows.net/templates/datafactory/cicd-parameters', inputs.arm-template-parameters-file, env.SAS_TOKEN) }}
JFolberth commented 1 year ago

To illustrate a little more I did find a workout around using the Azure CLI for the deployment:

    - name: Deploy ARM Template
      uses: azure/CLI@v1
      with:
        inlineScript: |
           az deployment group create --resource-group ${{ inputs.resource-group-name }} --template-uri ${{ format('{0}?{1}', 'https://saadf1234deveus.blob.core.windows.net/templates/linkedTemplates/ArmTemplate_master.json',env.SAS_TOKEN) }} --parameters ${{ format('{0}/{1}?{2}', 'https://saadf1234deveus.blob.core.windows.net/templates/datafactory/cicd-parameters', inputs.arm-template-parameters-file, env.SAS_TOKEN) }}

Seeing the arguments are the same I feel confident this is a bug in how the arm action is interpreting the values passed into parameters

JFolberth commented 1 year ago

@bishal-pdMSFT Any update on this. Feels like this is a big issue.