https://github.com/mildronize/actions-get-azure-credential
GitHub Action Helper to extract Azure Service Principal from secrets
https://github.com/mildronize/actions-get-azure-credential
Last synced: 4 months ago
JSON representation
GitHub Action Helper to extract Azure Service Principal from secrets
- Host: GitHub
- URL: https://github.com/mildronize/actions-get-azure-credential
- Owner: mildronize
- Created: 2022-04-08T13:23:13.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-08T15:45:25.000Z (about 4 years ago)
- Last Synced: 2025-11-06T15:07:29.231Z (7 months ago)
- Size: 198 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Get Azure Credential
[](https://github.com/mildronize/actions-get-azure-credential/actions/workflows/test.yml)
Simple GitHub Action Helper to extract Azure Service Principal from secrets
The secrets should be hidden from the log, but it still require to write the secret into file.

## Usage
When you create Azure Credential with:
```bash
az ad sp create-for-rbac -n "my-service-principal-name" --role Contributor --scopes /subscriptions/xxxxxxx
```
it will generate json, the structure of secret:
```json
{
"appId": "",
"displayName": "my-service-principal-name",
"password": "",
"tenant": ""
}
```
Set the secrets name `Azure_Credential` or name what you want.
### Example
```yaml
steps:
- name: get azure credential
id: credential
uses: mildronize/actions-get-azure-credential@v1
with:
secret: ${{ secrets.Azure_Credential }}
- run: |
echo App ID: ${{ steps.credential.outputs.app-id }}
echo Display Name: ${{ steps.credential.outputs.display-name }}
echo Tenant: ${{ steps.credential.outputs.tenant }}
echo Password: ${{ steps.credential.outputs.password }}
```