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
Your GitHub Actions run under an identity. Use the [az ad sp create-for-rbac](/cli/azure/ad/sp#az-ad-sp-create-for-rbac) command to create a [service principal](../../active-directory/develop/app-objects-and-service-principals.md#service-principal-object) for the identity.
38
46
39
-
Replace the placeholder `myApp` with the name of your application. Replace `{subscription-id}` with your subscription ID.
47
+
Replace the placeholder `{app-name}` with the name of your application. Replace `{subscription-id}` with your subscription ID.
40
48
41
49
```azurecli-interactive
42
-
az ad sp create-for-rbac --name myApp --role contributor --scopes /subscriptions/{subscription-id}/resourceGroups/exampleRG --sdk-auth
50
+
az ad sp create-for-rbac --name {app-name} --role contributor --scopes /subscriptions/{subscription-id}/resourceGroups/exampleRG --json-auth
43
51
```
44
52
45
53
> [!IMPORTANT]
@@ -56,6 +64,10 @@ The output is a JSON object with the role assignment credentials that provide ac
56
64
(...)
57
65
}
58
66
```
67
+
68
+
> [!NOTE]
69
+
> Remove the comma at the end of the last line, or else it will result in an invalid JSON file. You will get an error during the deployment saying "Login failed with Error: Content is not a valid JSON object. Double check if the 'auth-type' is correct."
70
+
59
71
# [Open ID Connect](#tab/openid)
60
72
61
73
@@ -164,23 +176,22 @@ To create a workflow, take the following steps:
164
176
# [Service principal](#tab/userlevel)
165
177
166
178
```yml
179
+
name: Deploy Bicep file
167
180
on: [push]
168
-
name: Azure ARM
169
181
jobs:
170
182
build-and-deploy:
171
183
runs-on: ubuntu-latest
172
184
steps:
173
185
174
-
# Checkout code
175
-
- uses: actions/checkout@main
186
+
- name: Checkout code
187
+
uses: actions/checkout@main
176
188
177
-
# Log into Azure
178
-
- uses: azure/login@v1
189
+
- name: Log into Azure
190
+
uses: azure/login@v1
179
191
with:
180
192
creds: ${{ secrets.AZURE_CREDENTIALS }}
181
193
182
-
# Deploy Bicep file
183
-
- name: deploy
194
+
- name: Deploy Bicep file
184
195
uses: azure/arm-deploy@v1
185
196
with:
186
197
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }}
@@ -238,17 +249,16 @@ To create a workflow, take the following steps:
238
249
239
250
240
251
241
-
1. Select **Start commit**.
252
+
1. Select **Commit changes**.
242
253
1. Select **Commit directly to the main branch**.
243
254
1. Select **Commit new file** (or **Commit changes**).
244
255
245
256
Updating either the workflow file or Bicep file triggers the workflow. The workflow starts right after you commit the changes.
246
257
247
258
## Check workflow status
248
259
249
-
1. Select the **Actions** tab. You'll see a **Create deployStorageAccount.yml** workflow listed. It takes 1-2 minutes to run the workflow.
250
-
1. Select the workflow to open it.
251
-
1. Select **Run ARM deploy** from the menu to verify the deployment.
260
+
1. Select the **Actions** tab. You'll see a **Create deployBicepFile.yml** workflow listed. It takes 1-2 minutes to run the workflow.
261
+
1. Select the workflow to open it, and verify the `Status` is `Success`.
0 commit comments