1. Resources
  2. /
  3. Plugins
  4. /
  5. azure-login-buildkite-plugin

Azure Login Buildkite Plugin

A Buildkite plugin that authenticates to Azure using managed identity or service principal credentials.

Authentication Methods

This plugin supports two authentication methods:

  1. Managed Identity - Uses Azure managed identity (az login --identity). Ideal for agents running on Azure VMs or Azure Container Instances with assigned managed identities.

  2. Service Principal - Uses Azure service principal credentials (az login --service-principal). Suitable for any environment where you have service principal credentials available.

Options

hook (optional, string)

Which Buildkite hook to run the Azure login in. Valid values are environment and pre-command.

Default: environment

use-identity (optional, boolean)

When set to true, authenticates using managed identity (az login --identity).

Default: false

client-id (optional, string)

The Application (client) ID for service principal authentication. When using managed identity with multiple identities assigned, this can be used to specify which identity to use.

client-secret (optional, string)

The client secret for service principal authentication. This can be either:

  • A direct secret value
  • An environment variable name containing the secret (the plugin will resolve it)

Required when using service principal authentication.

tenant-id (optional, string)

The Azure tenant ID. Required when using service principal authentication.

Examples

Managed Identity

Authenticate using the Azure managed identity assigned to the VM or container:

steps:
  - label: ":azure: Deploy to Azure"
    command: "az account show"
    plugins:
      - azure-login#v1.0.1:
          use-identity: true

Managed Identity with Specific Client ID

When multiple managed identities are assigned, specify which one to use:

steps:
  - label: ":azure: Deploy to Azure"
    command: "az account show"
    plugins:
      - azure-login#v1.0.1:
          use-identity: true
          client-id: "00000000-0000-0000-0000-000000000000"

Service Principal

Authenticate using service principal credentials:

steps:
  - label: ":azure: Deploy to Azure"
    command: "az account show"
    plugins:
      - azure-login#v1.0.1:
          client-id: "00000000-0000-0000-0000-000000000000"
          client-secret: "your-client-secret"
          tenant-id: "00000000-0000-0000-0000-000000000000"

Service Principal with Environment Variable Secret

Use an environment variable to provide the client secret:

steps:
  - label: ":azure: Deploy to Azure"
    command: "az account show"
    env:
      AZURE_CLIENT_SECRET: "your-client-secret"
    plugins:
      - azure-login#v1.0.1:
          client-id: "00000000-0000-0000-0000-000000000000"
          client-secret: "AZURE_CLIENT_SECRET"
          tenant-id: "00000000-0000-0000-0000-000000000000"

Using pre-command Hook

Run the Azure login in the pre-command hook instead of the environment hook:

steps:
  - label: ":azure: Deploy to Azure"
    command: "az account show"
    plugins:
      - azure-login#v1.0.1:
          hook: pre-command
          use-identity: true

Debug Mode

Enable verbose logging for troubleshooting:

steps:
  - label: ":azure: Deploy to Azure"
    command: "az account show"
    env:
      BUILDKITE_PLUGIN_DEBUG: "true"
    plugins:
      - azure-login#v1.0.1:
          use-identity: true

Compatibility

Elastic StackAgent Stack K8sHosted (Mac)Hosted (Linux)Notes
⚠️⚠️⚠️⚠️Requires Azure CLI (az) to be installed and available to the agent

Developing

Run all tests:

docker run -it --rm -v "$PWD:/plugin:ro" buildkite/plugin-tester

Validate plugin structure:

docker run -it --rm -v "$PWD:/plugin:ro" buildkite/plugin-linter --id azure-login --path /plugin

Run shellcheck:

shellcheck hooks/* lib/*

License

MIT License. See LICENSE for details.

The plugins listed on this webpage are provided for informational purposes only. They have not undergone any formal security review or assessment. While we strive to provide useful resources, we cannot guarantee the safety, reliability, or integrity of these plugins. Users are strongly advised to conduct their own security evaluations before downloading, installing, or using any plugin. By using these plugins, you acknowledge and accept any risks associated with their use. We disclaim any liability for any harm or damages arising from the use of the plugins listed.

Start turning complexity into an advantage

Create an account to get started for free.

Buildkite Pipelines

Platform

  1. Pipelines
  2. Public pipelines
  3. Test Engine
  4. Package Registries
  5. Mobile Delivery Cloud
  6. Pricing

Hosting options

  1. Self-hosted agents
  2. Mac hosted agents
  3. Linux hosted agents

Resources

  1. Docs
  2. Blog
  3. Changelog
  4. Example pipelines
  5. Plugins
  6. Webinars
  7. Case studies
  8. Events
  9. Migration Services
  10. CI/CD perspectives

Company

  1. About
  2. Careers
  3. Press
  4. Security
  5. Brand assets
  6. Contact

Solutions

  1. Replace Jenkins
  2. Workflows for MLOps
  3. Testing at scale
  4. Monorepo mojo
  5. Bazel orchestration

Legal

  1. Terms of Service
  2. Acceptable Use Policy
  3. Privacy Policy
  4. Subprocessors
  5. Service Level Agreement
  6. Supplier Code of Conduct
  7. Modern Slavery Statement

Support

  1. System status
  2. Forum
© Buildkite Pty Ltd 2026