CLI
Tasks that run Azure CLI commands within Kestra.
Leverage Microsoft Azure services within Kestra data workflows.
All tasks must be authenticated for the Azure Platform. Multiple authentication methods are supported:
You can set the following task properties:
tenantId: Directory (tenant) ID of the Azure Active Directory instance.clientId: Application (client) ID of your service principal.clientSecret: Secret associated with your service principal.This is a common method for server-to-server authentication and recommended for automation scenarios. This is best used with secrets to avoid exposing credentials in plain text.
Alternatively, you can use a PEM certificate for authentication by specifying:
tenantIdclientIdpemCertificate: PEM-formatted certificate content.This method is preferred over client secrets when enhanced security and certificate lifecycle management are required.
If no client secret or certificate is defined, the DefaultAzureCredential chain will be used. This includes:
AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, etc.).⚠️ In all cases, specifying
tenantIdis required.
Some Azure services support alternate authentication modes:
sharedKeyAccountName and sharedKeyAccountAccessKey for services like Azure Storage.sasToken for temporary delegated access to resources.These can also be stored as secrets.
endpoint: Most tasks require an endpoint property pointing to the Azure service endpoint (e.g., Blob storage URL).scopes: Some tasks allow you to define custom scopes (defaults to https://management.azure.com/.default).id: azure_get_token
namespace: company.team
tasks:
- id: get_access_token
type: io.kestra.plugin.azure.oauth.OauthAccessToken
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
For more information on Azure authentication, see Azure Identity documentation.