You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/container-instances/container-instances-github-action.md
+17-13Lines changed: 17 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ First, get the resource ID of your resource group. Substitute the name of your g
52
52
53
53
```azurecli
54
54
groupId=$(az group show \
55
-
--name <registry-name> \
55
+
--name <resource-group-name> \
56
56
--query id --output tsv)
57
57
```
58
58
@@ -82,11 +82,11 @@ Output is similar to:
82
82
}
83
83
```
84
84
85
-
Save the JSON output because it is used in a later step. Also, take note of the `clientID`, which you need to update the service principal in the next section.
85
+
Save the JSON output because it is used in a later step. Also, take note of the `clientId`, which you need to update the service principal in the next section.
86
86
87
87
### Update service principal for registry authentication
88
88
89
-
Update the Azure service principal credentials to allow push and pull permissions on your container registry. This step allows you to use the service principal to [authenticate with your container registry](../container-registry/container-registry-auth-service-principal.md).
89
+
Update the Azure service principal credentials to allow push and pull permissions on your container registry. This step allows you the GitHub workflow to us the service principal to [authenticate with your container registry](../container-registry/container-registry-auth-service-principal.md).
90
90
91
91
Get the resource ID of your container registry. Substitute the name of your registry in the following [az acr show][az-acr-show] command:
92
92
@@ -107,15 +107,17 @@ az role assignment create \
107
107
108
108
### Save credentials to GitHub repo
109
109
110
-
In the GitHub UI, navigate to your forked repository and select **Settings** > **Secrets**. Select **Add a new secret** to add the following secrets:
110
+
1. In the GitHub UI, navigate to your forked repository and select **Settings** > **Secrets**.
111
+
112
+
1. Select **Add a new secret** to add the following secrets:
111
113
112
114
|Secret |Value |
113
115
|---------|---------|
114
116
|`AZURE_CREDENTIALS`| The entire JSON output from the service principal creation |
115
117
|`REGISTRY_LOGIN_SERVER`| The login server name of your registry (all lowercase). Example: *myregistry.azure.cr.io*|
116
118
|`REGISTRY_USERNAME`| The `clientId` from the JSON output from the service principal creation |
117
119
|`REGISTRY_PASSWORD`| The `clientSecret` from the JSON output from the service principal creation |
118
-
|`RESOURCE_GROUP`|Name |The name of the resource group you used to scope the service principal |
120
+
|`RESOURCE_GROUP`| The name of the resource group you used to scope the service principal |
119
121
120
122
### Create workflow file
121
123
@@ -170,7 +172,7 @@ After you commit the workflow file, the workflow is triggered. To review workflo
When the workflow completes, get information about the container instance named `aci-sampleapp` by running the [az container show][az-container-show] command. Substitute the name of your resource group:
175
+
When the workflow completes, get information about the container instance named *aci-sampleapp* by running the [az container show][az-container-show] command. Substitute the name of your resource group:
174
176
175
177
```azurecli
176
178
az container show \
@@ -188,13 +190,13 @@ FQDN ProvisioningState
188
190
aci-action01.westus.azurecontainer.io Succeeded
189
191
```
190
192
191
-
After the instance is provisioned, navigate to the container's FQDN in your browser to view the web app.
193
+
After the instance is provisioned, navigate to the container's FQDN in your browser to view the running web app.
192
194
193
195

194
196
195
-
## Use the Azure CLI
197
+
## Use Deploy to Azure extension
196
198
197
-
Alternatively, use the [Deploy to Azure extension](https://github.com/Azure/deploy-to-azure-cli-extension) in the Azure CLI to configure the workflow. The `az container app up` command in the extension takes minimal input parameters from you and creates a GitHub workflow for you in your repository.
199
+
Alternatively, use the [Deploy to Azure extension](https://github.com/Azure/deploy-to-azure-cli-extension) in the Azure CLI to configure the workflow. The `az container app up` command in the extension takes minimal input parameters from you to set up a workflow to deploy to Azure Container Instances.
198
200
199
201
The workflow created by the Azure CLI is similar to the workflow you can [create manually using GitHub](#configure-github-workflow).
When prompted, provide your GitHub credentials. The command then creates a personal access token (PAT) to authenticate with your registry. The token has *repo* and *user* scopes on the repo. Alternatively, [create your own PAT](https://help.github.com/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) with those scopes and supply that when prompted.
233
+
When prompted, provide your GitHub credentials. The command then creates a personal access token (PAT) to authenticate with your registry. The token has *repo* and *user* scopes on the repo. Alternatively, [create your own PAT](https://help.github.com/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) with those scopes and supply the PAT when prompted.
232
234
233
235
The command creates:
234
236
235
237
* Service principal credentials for the workflow
236
238
* Credentials to access the Azure container registry
237
-
* A YAML file to define the GitHub workflow. By default the filename is `main.yml` but you can provide a different filename.
239
+
* A YAML file to define the GitHub workflow. Accept the default filename `main.yml`, or provide a filename you choose.
238
240
239
-
After you provide input to commit the workflow file to your repo, the workflow is triggered. Output is similar to:
241
+
After you commit the workflow file to your repo, the workflow is triggered. Output is similar to:
240
242
241
243
```console
242
244
[...]
@@ -248,7 +250,9 @@ Workflow succeeded
248
250
Your app is deployed at: http://acr-build-helloworld-node.eastus.azurecontainer.io:8080/
249
251
```
250
252
251
-
The workflow deploys an Azure container instance with the base name of your GitHub repo. In this case, the instance name is *acr-build-helloworld-node*. In your browser, you can browse to the link provided to view the running web app.
253
+
### Validate workflow
254
+
255
+
The workflow deploys an Azure container instance with the base name of your GitHub repo, in this case, *acr-build-helloworld-node*. In your browser, you can browse to the link provided to view the running web app.
252
256
253
257
To view the workflow status and results of each step in the GitHub UI, see [Managing a workflow run](https://help.github.com/actions/configuring-and-managing-workflows/managing-a-workflow-run).
0 commit comments