Child pages
  • Azure Credentials plugin

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. With defaults, which will read specified service principal into four predefined environment variables: AZURE_SUBSCRIPTION_IDAZURE_CLIENT_IDAZURE_CLIENT_SECRETAZURE_TENANT_ID. Sample pipeline code:

    Code Block
    languagegroovy
    withCredentials([azureServicePrincipal('credentials_id')]) {
        sh 'az login --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET -t $AZURE_TENANT_ID'
    }
  2. With custom name, where you can control the names of the variables. Sample pipeline code:

    Code Block
    languagegroovy
    withCredentials([azureServicePrincipal(credentialsId: 'credentials_id',
                                        subscriptionIdVariable: 'SUBS_ID',
                                        clientIdVariable: 'CLIENT_ID',
                                        clientSecretVariable: 'CLIENT_SECRET',
                                        tenantIdVariable: 'TENANT_ID')]) {
        sh 'az login --service-principal -u $CLIENT_ID -p $CLIENT_SECRET -t $TENANT_ID'
    }


Changelog

Version 1.6.0, 2018-03-29

  • Use scoped credentials lookup

Version 1.5.0, 2018-02-09

  • Support for certificate based service principal
  • Fix the configuration verification bug on non-global clouds

...