Skip to content

Commit bb25f45

Browse files
authored
Update README.md
1 parent bb8d70a commit bb25f45

1 file changed

Lines changed: 6 additions & 35 deletions

File tree

README.md

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,16 @@ jobs:
3636
3737
```
3838
39-
## Configure deployment credentials:
39+
## Configure Azure credentials:
4040
41-
For any credentials like Azure Service Principal, Publish Profile etc add them as [secrets](https://help.github.com/en/articles/virtual-environments-for-github-actions#creating-and-using-secrets-encrypted-variables) in the GitHub repository and then use them in the workflow.
41+
To fetch the credentials required to authenticate with Azure, run the following command to generate an Azure Service Principal (SPN) with Contributor permissions:
4242
43-
The above example uses user-level credentials i.e., Azure Service Principal for deployment.
44-
45-
Follow the steps to configure the secret:
46-
* Define a new secret under your repository settings, Add secret menu
47-
* Store the output of the below [az cli](https://docs.microsoft.com/en-us/cli/azure/?view=azure-cli-latest) command as the value of secret variable, for example 'AZURE_CREDENTIALS'
48-
```bash
49-
50-
az ad sp create-for-rbac --name "myApp" --role contributor \
43+
```sh
44+
az ad sp create-for-rbac --name "myApp" --role contributor \
5145
--scopes /subscriptions/{subscription-id}/resourceGroups/{resource-group} \
5246
--sdk-auth
5347

54-
# Replace {subscription-id}, {resource-group} with the subscription, resource group details
48+
# Replace {subscription-id}, {resource-group} with the subscription, resource group details of your keyvault
5549

5650
# The command should output a JSON object similar to this:
5751

@@ -62,31 +56,8 @@ Follow the steps to configure the secret:
6256
"tenantId": "<GUID>",
6357
(...)
6458
}
65-
66-
```
67-
* Now in the workflow file in your branch: `.github/workflows/workflow.yml` replace the secret in Azure login action with your secret (Refer to the example above)
68-
69-
70-
# Azure Login metadata file
71-
72-
```yaml
73-
74-
# action.yml
75-
76-
# Login to Azure subscription
77-
name: 'Login Azure'
78-
description: 'Login Azure wraps the az login, allowing for Azure actions to log into Azure'
79-
inputs:
80-
creds: # id of input
81-
description: 'Paste the contents of `az ad sp create-for-rbac... as value of secret variable: AZURE_CREDENTIALS'
82-
required: true
83-
branding:
84-
icon: 'login.svg'
85-
color: 'blue'
86-
runs:
87-
using: 'node12'
88-
main: 'main.js'
8959
```
60+
Add the json output as [a secret](https://aka.ms/create-secrets-for-GitHub-workflows) (let's say with the name `AZURE_CREDENTIALS`) in the GitHub repository.
9061

9162
# Contributing
9263

0 commit comments

Comments
 (0)