Skip to content

Commit

Permalink
Removed deprecated flag --sdk-auth (#78)
Browse files Browse the repository at this point in the history
* Removed deprecated flag --sdk-auth

* Update 2-setup-azure-environment.md
  • Loading branch information
51lver authored Apr 30, 2024
1 parent f2047fe commit 681b464
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/steps/2-setup-azure-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ We won't be going into detail on the steps of this workflow, but it would be a g

````shell
az ad sp create-for-rbac --name "GitHub-Actions" --role contributor \
--scopes /subscriptions/{subscription-id} \
--sdk-auth
--scopes /subscriptions/{subscription-id}

# Replace {subscription-id} with the same id stored in AZURE_SUBSCRIPTION_ID.
```
Expand All @@ -62,13 +61,13 @@ We won't be going into detail on the steps of this workflow, but it would be a g

````

1. Copy the entire contents of the command's response, we'll call this `AZURE_CREDENTIALS`. Here's an example of what it looks like:
1. Copy the entire contents of the command's response, we'll store it as secrets to authorize in Azure. Here's an example of what it looks like:
```shell
{
"clientId": "<GUID>",
"clientSecret": "<GUID>",
"subscriptionId": "<GUID>",
"tenantId": "<GUID>",
"appId": "<GUID>",
"displayName": "GitHub-Actions",
"password": "<GUID>",
"tenant": "<GUID>",
(...)
}
```
Expand All @@ -77,7 +76,10 @@ We won't be going into detail on the steps of this workflow, but it would be a g
1. Name your new secret **AZURE_SUBSCRIPTION_ID** and paste the value from the `id:` field in the first command.
1. Click **Add secret**.
1. Click **New repository secret** again.
1. Name the second secret **AZURE_CREDENTIALS** and paste the entire contents from the second terminal command you entered.
1. Name the second secret **AZURE_CLIENT_ID** and paste the value from the `appId:` field from the second terminal command you entered.
1. Click **Add secret**
1. Click **New repository secret** again.
1. Name the third secret **AZURE_TENANT_ID** and paste the value from the `tenant:` field from the second terminal command you entered.
1. Click **Add secret**
1. Go back to the Pull requests tab and in your pull request go to the **Files Changed** tab. Find and then edit the `.github/workflows/deploy-staging.yml` file to use some new actions.

Expand Down Expand Up @@ -164,7 +166,9 @@ jobs:
- name: "Login via Azure CLI"
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- uses: azure/docker-login@v1
with:
Expand Down

0 comments on commit 681b464

Please sign in to comment.