0

I'm struggling to get a Deploy to Azure button to work and hoping someone can help,

my code in the readme.md looks like

[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/<url encoded link to raw template>

when I try the button it takes me to the deploy screen, only I get an error:

"(x) Error parsing template. Please ensure template is valid JSON. Invalid symbol at character position 4. (3 other errors)"

the template validates and works as expected when deployed manually through Deploy a Custom Template,

the raw uri to the template in our tfsgit repo returns the raw template as expected

(the raw uri uses msoft's pattern of https://dev.azure.com/{{organization}}/{{project}}/_apis/sourceProviders/{{providerName}}/filecontents?repository={{repository}}&path={{path}}&commitOrBranch={{commitOrBranch}}&api-version=5.0-preview.1)

I'm guessing might be some kind of authentification issue, I've tried basic auth with username:password@https://... or maybe it only works with github.com, either way I'm completely stuck

nothing I try seems to work, and azure won't show me the json it's trying to parse,

I was wondering if someone else has had a similar issue and would be able to point me in the right direction here

thanks in advance

5
  • Have you validated your template in the Azure portal -> Deploy from a custom template ? Can be a good start since it says that your template is invalid. Aug 7, 2020 at 11:00
  • 1
    hi yes, sorry I probably didn't make it clear enough, it validates and deploys fine when entered manually through deploy from custom template
    – Reubeniv
    Aug 7, 2020 at 11:01
  • Are you using Github repos or Azure Devops Repos? Does this issue occurs in Azure devops service(different from azure) or a simple git repo?
    – LoLance
    Aug 10, 2020 at 9:29
  • hi, Azure Devops repos and I'm not 100% sure, is it possible to tell if it's in azure services or just a git repo accessible through it?
    – Reubeniv
    Aug 10, 2020 at 11:37
  • Azure Devops Repos has some difference from github Repo, what's the result if you post the Readme.md into a private github repo, could the button work?
    – LoLance
    Aug 13, 2020 at 9:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.