Dynamic Azure Credentials

This feature is currently available only to customers participating in a Private Preview. If you'd like to participate and be among the first to try this feature, ask our support or account team for details.

Each mint from a dynamic Azure secret creates a temporary Microsoft Entra ID client secret. Read Dynamic Secrets first for the prerequisites and how leases work. Azure credentials are also created through a Delinea Platform engine in your environment, so the engine needs outbound HTTPS access to Microsoft Entra ID, Microsoft Graph, and Azure Resource Manager.

There are two ways to grant access:

Mode Each mint creates When the lease ends
Temporary service principal (azureEphemeral) A new app registration, its service principal, a role assignment at the scope you choose, and a client secret The role assignment and the app registration are deleted
Existing app registration (azureExistingApp) A new client secret on an app registration you already have, which keeps its existing roles Only that client secret is removed. The app, its other secrets, and its role assignments don't change

In both modes, the client secret is created with an expiry date equal to the end of the lease, so Entra ID stops accepting it at that time even before it's removed.

Step 1: Set Up the Base App Registration

The base secret holds the credentials of an app registration that Workload Secrets Vault uses to create the temporary credentials. Give that app's service principal these rights:

  • The Microsoft Graph application permission Application.ReadWrite.OwnedBy, so it can create and delete the app registrations and client secrets it owns.

  • For temporary service principals: a role that can create and delete role assignments at the scope you grant, such as Role Based Access Control Administrator. Limit that role to the roles and scopes you intend to grant.

  • For an existing app registration: ownership of that app registration.

Then write the base secret:

Field Description
type Required. Set to azure. An Azure base secret has no targetType, and type can't change after you create the base secret.
externalTenantId Required. Your Microsoft Entra tenant ID.
credential Required. authMechanism set to usernamePassword, the base app's client ID as username, and its client secret as password.
siteId Recommended. The ID of the engine site to use. Without it, Workload Secrets Vault tries your sites in turn, starting with the default site, which makes mints slower.

The CLI can't write base secrets, so send the definition to the REST API. This example uses the TENANT and TOKEN variables from Authenticating to the API:

Copy
base=$(jq -n --arg tid "$AZURE_TENANT_ID" --arg cid "$AZURE_CLIENT_ID" \
             --arg secret "$AZURE_CLIENT_SECRET" --arg site "$SITE_ID" '{
  type: "azure",
  externalTenantId: $tid,
  siteId: $site,
  credential: {authMechanism: "usernamePassword", username: $cid, password: $secret}
}')
curl -sS -X POST "https://$TENANT/workload-secrets/api/v1/secrets/base/dynamic/base/azure-prod" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d "$base"

The body is the definition itself, with no data wrapper, and it takes only the fields in the table. To rotate the base app's client secret later, send the same request again to the same path with the complete definition. Each write stores a new version.

Step 2: Write the Dynamic Secret

As with the base secret, write the dynamic secret through the REST API.

Temporary Service Principal

Set type to azureEphemeral, and set scope and roleDefinitionId:

  • scope is a subscription (/subscriptions/<subscription-id>), a resource group (/subscriptions/<subscription-id>/resourceGroups/<name>), or a single resource. Management group and tenant root scopes aren't supported.

  • roleDefinitionId is the ID of the Azure role to assign, for example acdd72a7-3385-48ef-bd42-f606fba81ae7 for the built-in Reader role or b24988ac-6180-42a0-ab88-20f7382dd24c for Contributor.

Copy
curl -sS -X POST "https://$TENANT/workload-secrets/api/v1/secrets/dynamic/payments/prod/terraform-apply" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{
  "type": "azureEphemeral",
  "baseSecretPath": "dynamic/base/azure-prod",
  "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/payments-prod",
  "roleDefinitionId": "b24988ac-6180-42a0-ab88-20f7382dd24c",
  "ttlSeconds": 3600
}'

Existing App Registration

Set type to azureExistingApp, and set appObjectId to the object ID of the app registration, not its client ID:

Copy
curl -sS -X POST "https://$TENANT/workload-secrets/api/v1/secrets/dynamic/payments/prod/blob-uploader" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{
  "type": "azureExistingApp",
  "baseSecretPath": "dynamic/base/azure-prod",
  "appObjectId": "11111111-2222-3333-4444-555555555555",
  "ttlSeconds": 900
}'

Each type accepts only its own fields: scope and roleDefinitionId for azureEphemeral, and appObjectId for azureExistingApp. A field from the other type, or a database field such as access, is refused with 400.

Step 3: Mint a Credential

Copy
delinea --json workload secret mint payments/prod/terraform-apply > cred.json
export ARM_TENANT_ID=$(jq -r '.data.credential.tenantId' cred.json)
export ARM_CLIENT_ID=$(jq -r '.data.credential.clientId' cred.json)
export ARM_CLIENT_SECRET=$(jq -r '.data.credential.clientSecret' cred.json)
rm cred.json

The response's data holds leaseId, expiresAt, and a credential with "type": "azure", tenantId, clientId, and clientSecret. The client secret is returned only once and isn't stored by Workload Secrets Vault. See Minting a Credential.

Azure needs time to replicate a new credential. In testing, a new credential started to work 10 to 20 seconds after it was created. Before you use it, retry the Azure sign-in, not the mint, until it succeeds. Choose a ttlSeconds value that leaves enough time for this delay and for your job.

The temporary app registration is named workload-secrets-<tenant-id>-<lease-id>, and each client secret is named workload-secrets-lease-<lease-id>, so you can find them in the Azure portal. Here <tenant-id> is your Workload Secrets Vault tenant ID, not your Microsoft Entra tenant ID, and <lease-id> is the lease ID without hyphens.