|
| 1 | +--- |
| 2 | +title: Deploy from GitHub |
| 3 | +description: Use deploy to Azure button to deploy templates in GitHub repository. |
| 4 | +ms.topic: conceptual |
| 5 | +ms.date: 01/31/2020 |
| 6 | +--- |
| 7 | +# Use button to deploy from GitHub repository |
| 8 | + |
| 9 | +This article describes how to use the **Deploy to Azure** button to deploy templates from a GitHub repository. You can add the button directly to your GitHub repository or to a web page that references the repository. |
| 10 | + |
| 11 | +## Use common image |
| 12 | + |
| 13 | +To add the button to your web page or repository, use the image at: |
| 14 | + |
| 15 | +`https://aka.ms/deploytoazurebutton` |
| 16 | + |
| 17 | +The image appears as: |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +## Create URI for deploying template |
| 22 | + |
| 23 | +Each link starts with the same base URI: |
| 24 | + |
| 25 | +`https://portal.azure.com/#create/Microsoft.Template/uri/` |
| 26 | + |
| 27 | +After that base, add the URL-encoded link to the raw template in GitHub. For example, to link to a template at: |
| 28 | + |
| 29 | +`https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-aks/azuredeploy.json` |
| 30 | + |
| 31 | +First, encode it. |
| 32 | + |
| 33 | +`https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F101-aks%2Fazuredeploy.json` |
| 34 | + |
| 35 | +Then, add it to the base URI. |
| 36 | + |
| 37 | +`https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F101-aks%2Fazuredeploy.json` |
| 38 | + |
| 39 | +## Add link |
| 40 | + |
| 41 | +The link you add to your web page or GitHub repository contains the URI and the image. |
| 42 | + |
| 43 | +```html |
| 44 | +<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F101-aks%2Fazuredeploy.json" target="_blank"> |
| 45 | + <img src="https://aka.ms/deploytoazurebutton"/> |
| 46 | +</a> |
| 47 | +``` |
| 48 | + |
| 49 | +You can deploy the example template with the following button: |
| 50 | + |
| 51 | +<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F101-aks%2Fazuredeploy.json" target="_blank"> |
| 52 | + <img src="https://aka.ms/deploytoazurebutton"/> |
| 53 | +</a> |
| 54 | + |
| 55 | +## Next steps |
| 56 | + |
| 57 | +- To learn more about templates, see [Understand the structure and syntax of Azure Resource Manager templates](template-syntax.md). |
| 58 | + |
0 commit comments