Skip to content

Commit 0398f18

Browse files
authored
Replace incorrect -o json flag when creating service principal
The instructions for creating the service principal are incorrect. The the `-o json` flag outputs properties incompatible with the Azure Login action. The correct flag is `--sdk-auth` as noted in https://github.com/Azure/actions-workflow-samples/blob/master/assets/create-secrets-for-GitHub-workflows.md Other changes: - update azure login action to latest v1.4.3 version since the authentication is compatible - update azure cli action to latest v1.0.6 version since it is still compatible.
1 parent ced242c commit 0398f18

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

articles/aks/node-upgrade-github-actions.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,26 +95,31 @@ Download and sign in to the Azure CLI.
9595
9696
steps:
9797
- name: Azure Login
98-
uses: Azure/login@v1.1
98+
uses: Azure/login@v1.4.3
9999
with:
100100
creds: ${{ secrets.AZURE_CREDENTIALS }}
101101
```
102102

103103
1. From the Azure CLI, run the following command to generate a new username and password.
104104

105105
```azurecli-interactive
106-
az ad sp create-for-rbac --role Contributor -o json
106+
az ad sp create-for-rbac --role Contributor --sdk-auth
107107
```
108108

109109
The output should be similar to the following json:
110110

111111
```output
112112
{
113-
"appId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
114-
"displayName": "azure-cli-xxxx-xx-xx-xx-xx-xx",
115-
"name": "http://azure-cli-xxxx-xx-xx-xx-xx-xx",
116-
"password": "xXxXxXxXx",
117-
"tenant": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
113+
"clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
114+
"clientSecret": "xXxXxXxXx",
115+
"subscriptionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
116+
"tenantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
117+
"activeDirectoryEndpointUrl": "https://login.microsoftonline.com",
118+
"resourceManagerEndpointUrl": "https://management.azure.com/",
119+
"activeDirectoryGraphResourceId": "https://graph.windows.net/",
120+
"sqlManagementEndpointUrl": "https://management.core.windows.net:8443/",
121+
"galleryEndpointUrl": "https://gallery.azure.com/",
122+
"managementEndpointUrl": "https://management.core.windows.net/"
118123
}
119124
```
120125

@@ -149,11 +154,11 @@ To create the steps to execute Azure CLI commands.
149154
150155
steps:
151156
- name: Azure Login
152-
uses: Azure/login@v1.1
157+
uses: Azure/login@v1.4.3
153158
with:
154159
creds: ${{ secrets.AZURE_CREDENTIALS }}
155160
- name: Upgrade node images
156-
uses: Azure/[email protected].0
161+
uses: Azure/[email protected].6
157162
with:
158163
inlineScript: az aks upgrade -g {resourceGroupName} -n {aksClusterName} --node-image-only --yes
159164
```
@@ -190,7 +195,7 @@ jobs:
190195
191196
steps:
192197
- name: Azure Login
193-
uses: Azure/login@v1.1
198+
uses: Azure/login@v1.4.3
194199
with:
195200
creds: ${{ secrets.AZURE_CREDENTIALS }}
196201

0 commit comments

Comments
 (0)