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: README.md
+6-35Lines changed: 6 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,22 +36,16 @@ jobs:
36
36
37
37
```
38
38
39
-
## Configure deployment credentials:
39
+
## Configure Azure credentials:
40
40
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:
42
42
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 \
# 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
55
49
56
50
# The command should output a JSON object similar to this:
57
51
@@ -62,31 +56,8 @@ Follow the steps to configure the secret:
62
56
"tenantId": "<GUID>",
63
57
(...)
64
58
}
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'
89
59
```
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.
0 commit comments