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/spring-cloud/spring-cloud-github-actions-key-vault.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,14 +9,14 @@ ms.date: 01/20/2019
9
9
---
10
10
11
11
# Authenticate Azure Spring Cloud with Key Vault in Github Actions
12
-
Key vault is a secure place to store keys. Enterprise users need to store credentials for CI/CD environments in scope that they control. The key to get credentials in the key vault should be limited to resource scope. It has access to only the key vault scope, not the entire Azure scope. It's like a key that can only open a strong box not a master key that can open all doors in a building. It's a way to get a key with another key, but useful in a CICD workflow.
12
+
Key vault is a secure place to store keys. Enterprise users need to store credentials for CI/CD environments in scope that they control. The key to get credentials in the key vault should be limited to resource scope. It has access to only the key vault scope, not the entire Azure scope. It's like a key that can only open a strong box not a master key that can open all doors in a building. It's a way to get a key with another key, which is useful in a CICD workflow.
13
13
14
14
## Generate Credential
15
15
To generate a key to access the key vault, execute command below on your local machine:
16
16
```
17
17
az ad sp create-for-rbac --role contributor --scopes /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.KeyVault/vaults/<KEY_VAULT> --sdk-auth
18
18
```
19
-
Note the scope specified by the `--scopes` parameter, which limits the key access to the resource. It can only access the strong box.
19
+
The scope specified by the `--scopes` parameter limits the key access to the resource. It can only access the strong box.
20
20
21
21
With results:
22
22
```
@@ -36,20 +36,20 @@ With results:
36
36
Then save the results to GitHub **secrets** as described in [Set up your GitHub repository and authenticate with Azure](./spring-cloud-howto-github-actions.md#set-up-github-repository-and-authenticate).
37
37
38
38
## Add Access Policies for the Credential
39
-
The credential you created above can only get general information about the Key Vault, not the contents it stores. To get secrets stored in the Key Vault, you need set access policies for the credential.
39
+
The credential you created above can get only general information about the Key Vault, not the contents it stores. To get secrets stored in the Key Vault, you need set access policies for the credential.
40
40
41
-
Go to the **Key Vault** dashboard in Azure portal, click the **Access control** menu, then open the **Role assignments** tab. Select **Apps** for **Type**,`This resource` for **scope**. You should see the credential you created in previous step:
41
+
Go to the **Key Vault** dashboard in Azure portal, click the **Access control** menu, then open the **Role assignments** tab. Select **Apps** for **Type** and`This resource` for **scope**. You should see the credential you created in previous step:
Copy the credential name, for example, `azure-cli-2020-01-19-04-39-02`. Open the **Access policies** menu, click +Add Access Policy link. Select `Secret Management` for **Template**, then select **Principal**. Paste the credential name in **Principal**/**Select** input box:
45
+
Copy the credential name, for example, `azure-cli-2020-01-19-04-39-02`. Open the **Access policies** menu, click **+Add Access Policy** link. Select `Secret Management` for **Template**, then select **Principal**. Paste the credential name in **Principal**/**Select** input box:
46
46
47
47

48
48
49
-
Click the Add button in the **Add access policy** dialog, then click **Save**.
49
+
Click the **Add** button in the **Add access policy** dialog, then click **Save**.
50
50
51
51
## Generate full-scope Azure Credential
52
-
This is the master key to open all doors in the building. The procedure is similar to the first step, but now we change the scope to generate the master key:
52
+
This is the master key to open all doors in the building. The procedure is similar to the previous step, but here we change the scope to generate the master key:
53
53
54
54
```
55
55
az ad sp create-for-rbac --role contributor --scopes /subscriptions/<SUBSCRIPTION_ID> --sdk-auth
Copy file name to clipboardExpand all lines: articles/spring-cloud/spring-cloud-howto-github-actions.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,11 +35,11 @@ The command should output a JSON object:
35
35
}
36
36
```
37
37
38
-
This example uses the [Piggy Metrics](https://github.com/Azure-Samples/piggymetrics) sample on GitHub. Fork the sample, open GitHub repository page, and click Settings tab. Open Secrets menu, and click Add a new secret:
38
+
This example uses the [Piggy Metrics](https://github.com/Azure-Samples/piggymetrics) sample on GitHub. Fork the sample, open GitHub repository page, and click **Settings** tab. Open **Secrets** menu, and click **Add a new secret**:
39
39
40
40

41
41
42
-
Set the secret name to `AZURE_CREDENTIALS` and its value to the JSON string that you found under the heading *Set up your GitHub repository and authenticate with Azure*.
42
+
Set the secret name to `AZURE_CREDENTIALS` and its value to the JSON string that you found under the heading *Set up your GitHub repository and authenticate*.
@@ -54,7 +54,7 @@ az spring-cloud create -n <service instance name> -g <resource group name>
54
54
az spring-cloud config-server git set -n <service instance name> --uri https://github.com/xxx/piggymetrics --label config
55
55
```
56
56
## Build the workflow
57
-
The workflow can be defined using the following options.
57
+
The workflow is defined using the following options.
58
58
59
59
### Prepare for deployment with Azure CLI
60
60
The command `az spring-cloud app create` is currently not idempotent. We recommend this workflow on existing Azure Spring Cloud apps and instances.
@@ -114,7 +114,7 @@ jobs:
114
114
The az `run` command will use the latest version of Azure CLI. If there are breaking changes, you can also use a specific version of Azure CLI with azure/CLI `action`.
115
115
116
116
> [!Note]
117
-
> This command will run all the az command in a new container, so `env` will not work, and cross action file access may have extra restrictions.
117
+
> This command will run in a new container, so `env` will not work, and cross action file access may have extra restrictions.
118
118
119
119
Create the .github/workflow/main.yml file in the repository:
120
120
```
@@ -189,13 +189,13 @@ jobs:
189
189
```
190
190
191
191
## Run the workflow
192
-
GitHub Actions should be enabled automatically after you push `.github/workflow/main.yml` to GitHub. The action will be triggered when you push a new commit. If you create this file in the browser, your action should have already run.
192
+
GitHub **Actions** should be enabled automatically after you push `.github/workflow/main.yml` to GitHub. The action will be triggered when you push a new commit. If you create this file in the browser, your action should have already run.
193
193
194
194
To verify that the action has been enabled, click **Actions** tab on the GitHub repository page:
If your action runs in error, for example, if you haven't set Azure credential, you can rerun checks after fixing the error. On the GitHub repository page, click **Actions**, select the specific workflow task, and then click Rerun checks button to rerun checks:
198
+
If your action runs in error, for example, if you haven't set the Azure credential, you can rerun checks after fixing the error. On the GitHub repository page, click **Actions**, select the specific workflow task, and then click the **Rerun checks** button to rerun checks:
0 commit comments