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
+11-26Lines changed: 11 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,8 +86,9 @@ For any credentials like Azure Service Principal, Publish Profile etc add them a
86
86
The above example uses user-level credentials i.e., Azure Service Principal for deployment.
87
87
88
88
Follow the steps to configure the secret:
89
-
* Define a new secret under your repository settings, Add secret menu
90
-
* 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'
89
+
* Define a new secret variable under your repository **Settings** -> **Secrets** -> **New secret**. Provide a secret variable **Name**, for example 'AZURE_CREDENTIALS'.
90
+
* Run the below [az cli](https://docs.microsoft.com/en-us/cli/azure/?view=azure-cli-latest) command and Store the output as the **Value** of the secret variable
91
+
* Below *az ad* command scopes the service principal to a specific resource group *{resource-group}* within a specific Azure subscription *{subscription-id}*
91
92
```bash
92
93
93
94
az ad sp create-for-rbac --name "myApp" --role contributor \
@@ -107,33 +108,17 @@ Follow the steps to configure the secret:
107
108
}
108
109
109
110
```
110
-
* 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)
111
-
111
+
* You can also further scope down the Azure Credentials to a specific Azure resource, for example - a Web App by specifying the path to the specic resource in the *--scopes* attribute. Below script is for scoping the credentials to a web app of name *{app-name}*
112
+
```bash
113
+
az ad sp create-for-rbac --name "myApp" --role contributor \
# Replace {subscription-id}, {resource-group}, and {app-name} with the names of your subscription, resource group, and Azure Web App.
118
+
```
119
+
* 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)
114
120
115
-
```yaml
116
121
117
-
# action.yml
118
-
119
-
# Login to Azure subscription
120
-
name: 'Azure Login'
121
-
description: 'Authenticate to Azure and run your Az CLI or Az PowerShell based Actions or scripts. github.com/Azure/Actions'
122
-
inputs:
123
-
creds:
124
-
description: 'Paste output of `az ad sp create-for-rbac` as value of secret variable: AZURE_CREDENTIALS'
125
-
required: true
126
-
enable-AzPSSession:
127
-
description: 'Set this value to true to enable Azure PowerShell Login in addition to Az CLI login'
0 commit comments