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/app-service/app-service-sql-asp-github-actions.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,9 +69,7 @@ In the example, replace the placeholders with your subscription ID, resource gro
69
69
70
70
## Configure the GitHub secret for authentication
71
71
72
-
In [GitHub](https://github.com/), browse your repository, select **Settings > Secrets > Add a new secret**.
73
-
74
-
To use [user-level credentials](#generate-deployment-credentials), paste the entire JSON output from the Azure CLI command into the secret's value field. Name the secret `AZURE_CREDENTIALS`.
Copy file name to clipboardExpand all lines: articles/app-service/app-service-sql-github-actions.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,9 +70,7 @@ In the example, replace the placeholders with your subscription ID, resource gro
70
70
71
71
## Configure the GitHub secret for authentication
72
72
73
-
In [GitHub](https://github.com/), browse your repository, select **Settings > Secrets > Add a new secret**.
74
-
75
-
To use [user-level credentials](#generate-deployment-credentials), paste the entire JSON output from the Azure CLI command into the secret's value field. Give the secret the name `AZURE_CREDENTIALS`.
Copy file name to clipboardExpand all lines: articles/app-service/deploy-container-github-action.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,7 +126,7 @@ OpenID Connect is an authentication method that uses short-lived tokens. Setting
126
126
127
127
# [Publish profile](#tab/publish-profile)
128
128
129
-
In [GitHub](https://github.com/), browse your repository, select **Settings > Secrets > Add a new secret**.
129
+
In [GitHub](https://github.com/), browse your repository. Select **Settings > Security > Secrets and variables > Actions > New repository secret**.
130
130
131
131
To use [app-level credentials](#generate-deployment-credentials), paste the contents of the downloaded publish profile file into the secret's value field. Name the secret `AZURE_WEBAPP_PUBLISH_PROFILE`.
132
132
@@ -140,7 +140,7 @@ When you configure your GitHub workflow, you use the `AZURE_WEBAPP_PUBLISH_PROFI
140
140
141
141
# [Service principal](#tab/service-principal)
142
142
143
-
In [GitHub](https://github.com/), browse your repository, select**Settings > Secrets > Add a new secret**.
143
+
In [GitHub](https://github.com/), browse your repository. Select**Settings > Security > Secrets and variables > Actions > New repository secret**.
144
144
145
145
To use [user-level credentials](#generate-deployment-credentials), paste the entire JSON output from the Azure CLI command into the secret's value field. Give the secret the name like `AZURE_CREDENTIALS`.
146
146
@@ -156,7 +156,7 @@ When you configure the workflow file later, you use the secret for the input `cr
156
156
157
157
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.
158
158
159
-
1. Open your GitHub repository and go to **Settings**.
159
+
1. Open your GitHub repository and go to **Settings > Security > Secrets and variables > Actions > New repository secret**.
160
160
161
161
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. You can find these values in the Azure portal by searching for your active directory application.
Copy file name to clipboardExpand all lines: articles/app-service/deploy-github-actions.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,7 +160,7 @@ To learn how to create a Create an active directory application, service princip
160
160
161
161
# [Publish profile](#tab/applevel)
162
162
163
-
In [GitHub](https://github.com/), browse your repository, select **Settings > Secrets > Add a new secret**.
163
+
In [GitHub](https://github.com/), browse your repository. Select **Settings > Security > Secrets and variables > Actions > New repository secret**.
164
164
165
165
To use [app-level credentials](#generate-deployment-credentials), paste the contents of the downloaded publish profile file into the secret's value field. Name the secret `AZURE_WEBAPP_PUBLISH_PROFILE`.
166
166
@@ -174,7 +174,7 @@ When you configure your GitHub workflow, you use the `AZURE_WEBAPP_PUBLISH_PROFI
174
174
175
175
# [Service principal](#tab/userlevel)
176
176
177
-
In [GitHub](https://github.com/), browse your repository, select**Settings > Secrets > Add a new secret**.
177
+
In [GitHub](https://github.com/), browse your repository. Select**Settings > Security > Secrets and variables > Actions > New repository secret**.
178
178
179
179
To use [user-level credentials](#generate-deployment-credentials), paste the entire JSON output from the Azure CLI command into the secret's value field. Give the secret the name `AZURE_CREDENTIALS`.
180
180
@@ -190,7 +190,7 @@ When you configure the workflow file later, you use the secret for the input `cr
190
190
191
191
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.
192
192
193
-
1. Open your GitHub repository and go to **Settings**.
193
+
1. Open your GitHub repository and go to **Settings > Security > Secrets and variables > Actions > New repository secret**.
194
194
195
195
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:
1. Select **Security > Secrets and variables > Actions**.
54
54
55
-
1. Add a new secret using `AZURE_FUNCTIONAPP_PUBLISH_PROFILE` for **Name**, the content of the publishing profile file for **Value**, and then select **Add secret**.
55
+
1. Select **New repository secret**.
56
+
57
+
1. Add a new secret with the name `AZURE_FUNCTIONAPP_PUBLISH_PROFILE` and the value set to the contents of the publishing profile file.
58
+
59
+
1. Select **Add secret**.
56
60
57
61
GitHub can now authenticate to your function app in Azure.
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.
38
-
39
-
Create a resource group if you do not already have one.
40
-
41
-
```azurecli-interactive
42
-
az group create -n {MyResourceGroup} -l {location}
43
-
```
44
-
45
-
Replace the placeholder `myApp` with the name of your application.
46
-
47
-
```azurecli-interactive
48
-
az ad sp create-for-rbac --name {myApp} --role contributor --scopes /subscriptions/{subscription-id}/resourceGroups/{MyResourceGroup} --sdk-auth
49
-
```
50
-
51
-
In the example above, replace the placeholders with your subscription ID and resource group name. The output is a JSON object with the role assignment credentials that provide access to your App Service app similar to below. Copy this JSON object for later. You will only need the sections with the `clientId`, `clientSecret`, `subscriptionId`, and `tenantId` values.
52
-
53
-
```output
54
-
{
55
-
"clientId": "<GUID>",
56
-
"clientSecret": "<GUID>",
57
-
"subscriptionId": "<GUID>",
58
-
"tenantId": "<GUID>",
59
-
(...)
60
-
}
61
-
```
62
-
63
-
> [!IMPORTANT]
64
-
> It is always a good practice to grant minimum access. The scope in the previous example is limited to the resource group.
65
-
66
-
# [OpenID Connect](#tab/openid)
67
-
68
-
69
-
OpenID Connect is an authentication method that uses short-lived tokens. Setting up [OpenID Connect with GitHub Actions](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect) is more complex process that offers hardened security.
70
-
71
-
1. If you do not have an existing application, register a [new Active Directory application and service principal that can access resources](../../active-directory/develop/howto-create-service-principal-portal.md). Create the Active Directory application.
72
-
73
-
```azurecli-interactive
74
-
az ad app create --display-name myApp
75
-
```
76
-
77
-
This command will output JSON with an `appId` that is your `client-id`. Save the value to use as the `AZURE_CLIENT_ID` GitHub secret later.
78
-
79
-
You'll use the `objectId` value when creating federated credentials with Graph API and reference it as the `APPLICATION-OBJECT-ID`.
80
-
81
-
1. Create a service principal. Replace the `$appID` with the appId from your JSON output.
82
-
83
-
This command generates JSON output with a different `objectId` and will be used in the next step. The new `objectId` is the `assignee-object-id`.
84
-
85
-
Copy the `appOwnerTenantId` to use as a GitHub secret for `AZURE_TENANT_ID` later.
86
-
87
-
```azurecli-interactive
88
-
az ad sp create --id $appId
89
-
```
90
-
91
-
1. Create a new role assignment by subscription and object. By default, the role assignment will be tied to your default subscription. Replace `$subscriptionId` with your subscription ID, `$resourceGroupName` with your resource group name, and `$assigneeObjectId` with the generated `assignee-object-id`. Learn [how to manage Azure subscriptions with the Azure CLI](/cli/azure/manage-azure-subscriptions-azure-cli).
92
-
93
-
```azurecli-interactive
94
-
az role assignment create --role contributor --subscription $subscriptionId --assignee-object-id $assigneeObjectId --assignee-principal-type ServicePrincipal --scopes /subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Web/sites/
95
-
```
96
-
97
-
1. Run the following command to [create a new federated identity credential](/graph/api/application-post-federatedidentitycredentials?view=graph-rest-beta&preserve-view=true) for your active directory application.
98
-
99
-
* Replace `APPLICATION-OBJECT-ID` with the **objectId (generated while creating app)** for your Active Directory application.
100
-
* Set a value for `CREDENTIAL-NAME` to reference later.
101
-
* Set the `subject`. The value of this is defined by GitHub depending on your workflow:
102
-
* Jobs in your GitHub Actions environment: `repo:< Organization/Repository >:environment:< Name >`
103
-
* For Jobs not tied to an environment, include the ref path for branch/tag based on the ref path used for triggering the workflow: `repo:< Organization/Repository >:ref:< ref path>`. For example, `repo:n-username/ node_express:ref:refs/heads/my-branch` or `repo:n-username/ node_express:ref:refs/tags/my-tag`.
104
-
* For workflows triggered by a pull request event: `repo:< Organization/Repository >:pull_request`.
105
-
106
-
```azurecli
107
-
az rest --method POST --uri 'https://graph.microsoft.com/beta/applications/<APPLICATION-OBJECT-ID>/federatedIdentityCredentials' --body '{"name":"<CREDENTIAL-NAME>","issuer":"https://token.actions.githubusercontent.com","subject":"repo:organization/repository:ref:refs/heads/main","description":"Testing","audiences":["api://AzureADTokenExchange"]}'
108
-
```
109
-
110
-
To learn how to create a Create an active directory application, service principal, and federated credentials in Azure portal, see [Connect GitHub and Azure](/azure/developer/github/connect-from-azure#use-the-azure-login-action-with-openid-connect).
111
-
112
-
113
-
---
114
37
## Configure the GitHub secrets
115
38
116
-
# [Service principal](#tab/userlevel)
117
-
118
-
You need to create secrets for your Azure credentials, resource group, and subscriptions.
119
-
120
-
1. In [GitHub](https://github.com/), browse your repository.
121
-
122
-
1. Select **Settings > Secrets > New secret**.
123
-
124
-
1. Paste the entire JSON output from the Azure CLI command into the secret's value field. Give the secret the name `AZURE_CREDENTIALS`.
1. Create another secret named `AZURE_RG`. Add the name of your resource group to the secret's value field (example: `myResourceGroup`).
127
-
128
-
1. Create an additional secret named `AZURE_SUBSCRIPTION`. Add your subscription ID to the secret's value field (example: `90fd3f9d-4c61-432d-99ba-1273f236afa2`).
129
-
130
-
# [OpenID Connect](#tab/openid)
131
-
132
-
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.
133
-
134
-
1. Open your GitHub repository and go to **Settings**.
135
-
136
-
1. Select **Settings > Secrets > New secret**.
137
-
138
-
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:
139
-
140
-
|GitHub Secret | Active Directory Application |
141
-
|---------|---------|
142
-
|AZURE_CLIENT_ID | Application (client) ID |
143
-
|AZURE_TENANT_ID | Directory (tenant) ID |
144
-
|AZURE_SUBSCRIPTION_ID | Subscription ID |
145
-
146
-
1. Save each secret by selecting **Add secret**.
147
-
148
-
---
149
41
## Add Resource Manager template
150
42
151
43
Add a Resource Manager template to your GitHub repository. This template creates a storage account.
Copy file name to clipboardExpand all lines: articles/container-registry/github-action-scan.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,9 +48,9 @@ In this example, you'll create a three secrets that you can use to authenticate
48
48
49
49
:::image type="content" source="media/github-action-scan/github-repo-settings.png" alt-text="Select Settings in the navigation.":::
50
50
51
-
1. Select **Secrets** and then **New Secret**.
51
+
1. Select **Security > Secrets and variables > Actions**.
52
52
53
-
:::image type="content" source="media/github-action-scan/azure-secret-add.png" alt-text="Choose to add a secret.":::
53
+
1. Select **New repository secret**.
54
54
55
55
1. Paste the following values for each secret created with the following values from the Azure portal by navigating to the **Access Keys** in the Container Registry.
0 commit comments