All,
I'm trying to use the "deploy to Azure" button, using a template stored in Azure DevOps Git repo.
I'm receiving the following error:
Error parsing template. Please ensure template is valid JSON. Invalid symbol at character position 4. (3 other errors)
.
I created the URL following what is described in https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deploy-to-azure-button.
My structure is the following:
MyOrganization
and project is myProject
myRepo
, and the template file is on branch myBranch
, located at myFolder/myTemplate.json
.Copy/pasting this URL in a browser returns the above error...
I believe my JSON file is correct (no error) because it works fine in the following two situations:
az deployment groupe create --template-file <myJSONtemplatefile> --parameters <myJSONparametersfile>
I don't get what is the reason of the Error parsing template...
Found!
Issue was due to the fact that the AzDO repo is private, and not public.
This was clearly stated in Microsoft documentation, but I missed it... (bolding word is mine)
If you're using Git with Azure Repos instead of a GitHub repo, you can still use the Deploy to Azure button. Make sure your repo is public. Use the Items operation to get the template.
With a public AzDO repo, everything works like a charm.