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
|**Deploy**| 1. Deploy the Resource Manager template. |
32
32
33
33
## Generate deployment credentials
34
34
35
+
# [Service principal](#tab/userlevel)
36
+
35
37
You can create a [service principal](../../active-directory/develop/app-objects-and-service-principals.md#service-principal-object) with the [az ad sp create-for-rbac](/cli/azure/ad/sp#az-ad-sp-create-for-rbac) command in the [Azure CLI](/cli/azure/). Run this command with [Azure Cloud Shell](https://shell.azure.com/) in the Azure portal or by selecting the **Try it** button.
36
38
37
39
Create a resource group if you do not already have one.
@@ -61,8 +63,29 @@ In the example above, replace the placeholders with your subscription ID and res
61
63
> [!IMPORTANT]
62
64
> It is always a good practice to grant minimum access. The scope in the previous example is limited to the resource group.
63
65
66
+
# [OpenID Connect](#tab/openid)
67
+
68
+
You need to provide your application's **Client ID**, **Tenant ID**, and **Subscription ID** to the login action. These values can either be provided directly in the workflow or can be stored in GitHub secrets and referenced in your workflow. Saving the values as GitHub secrets is the more secure option.
69
+
70
+
1. Open your GitHub repository and go to **Settings**.
71
+
72
+
1. Select **Settings > Secrets > New secret**.
73
+
74
+
1. Create secrets for `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, and `AZURE_SUBSCRIPTION_ID`. Use these values from your Active Directory application for your GitHub secrets:
75
+
76
+
|GitHub Secret | Active Directory Application |
77
+
|---------|---------|
78
+
|AZURE_CLIENT_ID | Application (client) ID |
79
+
|AZURE_TENANT_ID | Directory (tenant) ID |
80
+
|AZURE_SUBSCRIPTION_ID | Subscription ID |
81
+
82
+
1. Save each secret by selecting **Add secret**.
83
+
84
+
---
64
85
## Configure the GitHub secrets
65
86
87
+
# [Service principal](#tab/userlevel)
88
+
66
89
You need to create secrets for your Azure credentials, resource group, and subscriptions.
67
90
68
91
1. In [GitHub](https://github.com/), browse your repository.
@@ -75,6 +98,25 @@ You need to create secrets for your Azure credentials, resource group, and subsc
75
98
76
99
1. Create an additional secret named `AZURE_SUBSCRIPTION`. Add your subscription ID to the secret's value field (example: `90fd3f9d-4c61-432d-99ba-1273f236afa2`).
77
100
101
+
# [OpenID Connect](#tab/openid)
102
+
103
+
You need to provide your application's **Client ID**, **Tenant ID**, and **Subscription ID** to the login action. These values can either be provided directly in the workflow or can be stored in GitHub secrets and referenced in your workflow. Saving the values as GitHub secrets is the more secure option.
104
+
105
+
1. Open your GitHub repository and go to **Settings**.
106
+
107
+
1. Select **Settings > Secrets > New secret**.
108
+
109
+
1. Create secrets for `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, and `AZURE_SUBSCRIPTION_ID`. Use these values from your Active Directory application for your GitHub secrets:
110
+
111
+
|GitHub Secret | Active Directory Application |
112
+
|---------|---------|
113
+
|AZURE_CLIENT_ID | Application (client) ID |
114
+
|AZURE_TENANT_ID | Directory (tenant) ID |
115
+
|AZURE_SUBSCRIPTION_ID | Subscription ID |
116
+
117
+
1. Save each secret by selecting **Add secret**.
118
+
119
+
---
78
120
## Add Resource Manager template
79
121
80
122
Add a Resource Manager template to your GitHub repository. This template creates a storage account.
@@ -94,8 +136,9 @@ The workflow file must be stored in the **.github/workflows** folder at the root
94
136
1. Select **set up a workflow yourself**.
95
137
1. Rename the workflow file if you prefer a different name other than **main.yml**. For example: **deployStorageAccount.yml**.
96
138
1. Replace the content of the yml file with the following:
139
+
# [Service principal](#tab/userlevel)
97
140
98
-
```yml
141
+
```yml
99
142
on: [push]
100
143
name: Azure ARM
101
144
jobs:
@@ -122,15 +165,57 @@ The workflow file must be stored in the **.github/workflows** folder at the root
> You can specify a JSON format parameters file instead in the ARM Deploy action (example: `.azuredeploy.parameters.json`).
172
+
173
+
The first section of the workflow file includes:
174
+
175
+
- **name**: The name of the workflow.
176
+
- **on**: The name of the GitHub events that triggers the workflow. The workflow is trigger when there is a push event on the main branch, which modifies at least one of the two files specified. The two files are the workflow file and the template file.
> You can specify a JSON format parameters file instead in the ARM Deploy action (example: `.azuredeploy.parameters.json`).
211
+
> [!NOTE]
212
+
> You can specify a JSON format parameters file instead in the ARM Deploy action (example: `.azuredeploy.parameters.json`).
129
213
130
-
The first section of the workflow file includes:
214
+
The first section of the workflow file includes:
131
215
132
-
- **name**: The name of the workflow.
133
-
- **on**: The name of the GitHub events that triggers the workflow. The workflow is trigger when there is a push event on the main branch, which modifies at least one of the two files specified. The two files are the workflow file and the template file.
216
+
- **name**: The name of the workflow.
217
+
- **on**: The name of the GitHub events that triggers the workflow. The workflow is trigger when there is a push event on the main branch, which modifies at least one of the two files specified. The two files are the workflow file and the template file.
0 commit comments