Environment Variables
| Variable | Required | Notes |
|---|---|---|
SECRETS_MANAGER_TYPE | Yes | Set to azure_key_vault. |
SECRETS_MANAGER_AZURE_VAULT_URL | Conditionally required | Required if SECRETS_MANAGER_AZURE_VAULT_NAME is not set. |
SECRETS_MANAGER_AZURE_VAULT_NAME | Conditionally required | If set, URL is derived as https://<vault-name>.vault.azure.net/. |
SECRETS_MANAGER_AZURE_TENANT_ID | Optional | Used with client credential auth. |
SECRETS_MANAGER_AZURE_CLIENT_ID | Optional | Used with client credential auth. |
SECRETS_MANAGER_AZURE_CLIENT_SECRET | Optional | Used with client credential auth. |
SECRETS_MANAGER_AZURE_USE_MANAGED_IDENTITY | Optional | Config field exists. Authentication still follows Azure default credential chain when client credential values are not set. |
- If
TENANT_ID,CLIENT_ID, andCLIENT_SECRETare all set, client secret auth is used. - Otherwise, Azure default credential chain is used.
Create Azure Resources and Credentials
- Create a Key Vault:
- Azure Portal -> Key vaults -> Create.
- Choose subscription, resource group, region, and vault name.
- Create an app identity for service-to-service auth:
- Azure Portal -> Microsoft Entra ID -> App registrations -> New registration.
- Open the app and copy Application (client) ID.
- Copy Directory (tenant) ID from app or tenant overview.
- Generate a client secret:
- App registration -> Certificates & secrets -> New client secret.
- Copy the secret value.
- Grant the app permissions to the vault:
- If using Access Policies: Key Vault -> Access policies -> Add secret permissions (Get, Set, Delete).
- If using RBAC: assign a role that includes secret read/write/delete on the vault scope.
Map Credentials to Env Vars
| Azure value | Env var |
|---|---|
| Vault name | SECRETS_MANAGER_AZURE_VAULT_NAME |
Vault URL (https://<vault-name>.vault.azure.net/) | SECRETS_MANAGER_AZURE_VAULT_URL |
| Tenant ID | SECRETS_MANAGER_AZURE_TENANT_ID |
| Client ID | SECRETS_MANAGER_AZURE_CLIENT_ID |
| Client secret value | SECRETS_MANAGER_AZURE_CLIENT_SECRET |
Local Switch Example
wonderful-secrets after changing these values.
What to Verify
- Run the smoke test from Secret Managers.
- Confirm secrets are created in the configured Key Vault.