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
@@ -39,8 +39,7 @@ An Azure subscription and GitHub account.
39
39
40
40
## Add your workflow
41
41
42
-
# [Service principal](#tab/userlevel)
43
-
42
+
# [OpenID Connect](#tab/openid)
44
43
45
44
1. Go to **Actions** for your GitHub repository.
46
45
@@ -51,30 +50,51 @@ An Azure subscription and GitHub account.
51
50
1. Delete everything after the `on:` section of your workflow file. For example, your remaining workflow may look like this.
52
51
53
52
```yaml
54
-
name: CI
53
+
name: CI with OpenID Connect
55
54
56
55
on:
57
56
push:
58
57
branches: [ main ]
59
58
```
60
59
61
-
1. Rename your workflow `Blob storage website CI` and add the checkout and login actions. These actions will check out your site code and authenticate with Azure using the `AZURE_CREDENTIALS` GitHub secret you created earlier.
60
+
1. Add a permissions section.
61
+
62
62
63
63
```yaml
64
-
name: Blob storage website CI
64
+
name: CI with OpenID Connect
65
65
66
66
on:
67
67
push:
68
68
branches: [ main ]
69
69
70
+
permissions:
71
+
id-token: write
72
+
contents: read
73
+
```
74
+
75
+
1. Add checkout and login actions. These actions will check out your site code and authenticate with Azure using the GitHub secrets you created earlier.
1. Use the Azure CLI action to upload your code to blob storage and to purge your CDN endpoint. For `az storage blob upload-batch`, replace the placeholder with your storage account name. The script will upload to the `$web` container. For `az cdn endpoint purge`, replace the placeholders with your CDN profile name, CDN endpoint name, and resource group. To speed up your CDN purge, you can add the `--no-wait` option to `az cdn endpoint purge`. To enhance security, you can also add the `--account-key` option with your [storage account key](../common/storage-account-keys-manage.md).
@@ -95,20 +115,26 @@ An Azure subscription and GitHub account.
95
115
1. Complete your workflow by adding an action to logout of Azure. Here is the completed workflow. The file will appear in the `.github/workflows` folder of your repository.
@@ -128,7 +154,8 @@ An Azure subscription and GitHub account.
128
154
if: always()
129
155
```
130
156
131
-
# [OpenID Connect](#tab/openid)
157
+
# [Service principal](#tab/userlevel)
158
+
132
159
133
160
1. Go to **Actions** for your GitHub repository.
134
161
@@ -139,51 +166,30 @@ An Azure subscription and GitHub account.
139
166
1. Delete everything after the `on:` section of your workflow file. For example, your remaining workflow may look like this.
140
167
141
168
```yaml
142
-
name: CI with OpenID Connect
143
-
144
-
on:
145
-
push:
146
-
branches: [ main ]
147
-
```
148
-
149
-
1. Add a permissions section.
150
-
151
-
152
-
```yaml
153
-
name: CI with OpenID Connect
169
+
name: CI
154
170
155
171
on:
156
172
push:
157
173
branches: [ main ]
158
-
159
-
permissions:
160
-
id-token: write
161
-
contents: read
162
174
```
163
175
164
-
1. Add checkout and login actions. These actions will check out your site code and authenticate with Azure using the GitHub secrets you created earlier.
176
+
1. Rename your workflow `Blob storage website CI` and add the checkout and login actions. These actions will check out your site code and authenticate with Azure using the `AZURE_CREDENTIALS` GitHub secret you created earlier.
1. Use the Azure CLI action to upload your code to blob storage and to purge your CDN endpoint. For `az storage blob upload-batch`, replace the placeholder with your storage account name. The script will upload to the `$web` container. For `az cdn endpoint purge`, replace the placeholders with your CDN profile name, CDN endpoint name, and resource group. To speed up your CDN purge, you can add the `--no-wait` option to `az cdn endpoint purge`. To enhance security, you can also add the `--account-key` option with your [storage account key](../common/storage-account-keys-manage.md).
@@ -204,26 +210,20 @@ An Azure subscription and GitHub account.
204
210
1. Complete your workflow by adding an action to logout of Azure. Here is the completed workflow. The file will appear in the `.github/workflows` folder of your repository.
0 commit comments