Skip to content

Commit

Permalink
DEVOPS-8 updated readme doc
Browse files Browse the repository at this point in the history
  • Loading branch information
githubofkrishnadhas committed Dec 10, 2023
1 parent d344448 commit f48f1e1
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,43 @@ usage: kv_mgmt.py [-h] [--client_id CLIENT_ID] [--client_secret CLIENT_SECRET]
|secret_name | | yes |
|secret_value | | yes |
|content | | yes |


## How program works

```
This python program leverages the azure sdks - azure identity and azure-keyvault-secrets.
Azure identity is used for authentication to azure and azure-keyvault-secrets to work with keyvault secrets.
```
* Azure Identity - uses DefaultAzureCredential method for authentication.
- This uses the service principal app id, service principal secret and tenant id to do the authentication
make sure you have the below.
```
AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID are the environment variables it will be using
```
* I use the .env to supply the above vars and load them using python-dotenv package and use it. or you can pass it as
environment variable and use by os method.
The .env file will be of following
```
AZURE_CLIENT_ID= "value"
AZURE_CLIENT_SECRET = "value"
AZURE_SUBSCRIPTION_ID = "value"
AZURE_TENANT_ID = "value"
```
replace the value with your original values.
AZURE_SUBSCRIPTION_ID - an optional parameter in .env file.
* The environment variables are passed in the github workflows in a differnt method.
```
jobs:
keyvault_management:
runs-on: ubuntu-latest
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
```
* I have configued AZURE_CLIENT_ID, AZURE_CLIENT_SECRET and AZURE_TENANT_ID as repository secrets / organizational secrets.

0 comments on commit f48f1e1

Please sign in to comment.