Azure

Why are my ARM deployments not picking up the changes in my template?

Why are my ARM deployments not picking up the changes in my template?

I had a weird problem a few months ago. I cloned a repository from Azure quick starts on GitHub into a local repo and started making changes to one of the nested templates.

The specific template was for a Log Analytics workspace that had prepopulated solutions. I wanted to add some extra ones, so I just added them to the list in the template. The problem was, that when I deployed that template to Azure it didn’t have the extra solutions.

This puzzled me a for quite a while. Then I had a look in the parameters file and say an entry called “_articfactsLocation”. This pointed back to the original GitHub repository.

"_artifactsLocation": {
 
            "value": "https://raw.githubusercontent.com/Azure/azure quickstart-templates/master/oms-all-deploy"
 
        }

I realised this meant that it was ignoring my updated template. I was even more puzzled at this point as I had done this before without issue. However, any templates I had amended, didn’t have nested templates. I later found out that this would affect scripts as well. The deployment process follows this path to get any information that’s not in the main template file.

If you deploy your templates from Visual Studio (cloud solution), the PowerShell script it uses creates a storage account in Azure, copies your code to this and then references that location as the “_artifactsLocation”.