Deploying website from private Github repository using ARM Templates

后端 未结 2 760
Happy的楠姐
Happy的楠姐 2020-12-30 10:57

I am trying to create a website through Azure Resource Manager and then deploy from a private Github repository.

I have an ARM Template that works for a public repo

相关标签:
2条回答
  • 2020-12-30 11:26

    In order to use this via ARM template, you need to first do it at least once using the Preview Portal (https://portal.azure.com/). You can do this on any site, and with any repo. It just needs to happen once to set up the GitHub relationship. Doing it via the old portal won't work.

    Then, to check that things are set up properly:

    • Go to https://resources.azure.com/
    • Go under /providers/Microsoft.Web/sourcecontrols/GitHub
    • Make sure the token is set
    0 讨论(0)
  • 2020-12-30 11:27

    It seems that when the portal connects to a private repo it will create an ssh key that is used to authenticate.

    Thats right.

    Solve same problem by changing GitHub repository to External Git.

    • Create new GitHub account and shared read access to private repo

    • Generate access token

    • And use next url in templates, in portal, azure rest api, etc.

      https://{github-username}:{access-token}@github.com/{organisation-acount}/{repo}.git

    Besides, this will help to avoid GitHub limitation for 20 connections, and you can use your repository in more than 20 Azure WebApps.

    0 讨论(0)
提交回复
热议问题