• Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • _unsorted
    • Azure Credentials 1.6.0
      Jenkins ver. 2.150.3
      Centos 7.4

      Hello,

      Before, I used Environment variables in Jenkins configuration to set Azure credentials and my terraform init worked.

      I installed the Azure credentials in order to use several tenant credentials.

      but my terraform init complain this:

      Error configuring the backend "azurerm": resource_group_name and credentials must be provided when access_key is absent

      when I set back Environment variables in Jenkins, everything works.

      this is my pipeline script:

       

      ---------------

       
      def checkout() {
      stage('Clone repository') {
      git branch: 'dev',
      credentialsId: 'gitalb-token-ci',
      url: 'https://url.git'
      sh "ls -lat"
      }
      }
       
      def terraformFmt() {
      stage('Terraform fmt') {
      sh 'terraform fmt'
      }
      }

      def terraformInit() {
      stage('Terraform Init') {
      sh "az login --service-principal -u $CLIENT_ID -p $CLIENT_SECRET -t $TENANT_ID"
      sh "az account set -s $SUBS_ID"
      sh "terraform init"
      }
      }

      def terraformPlan() {
      stage('Terraform Plan') {
      sh "terraform plan -input=false"
      }
      }

      def terraformApply() {
      stage('Terraform Apply') {
      input "Are you ready for APPLY ?"
      sh "terraform apply -input=false -auto-approve"
      }
      }
       
      node {
      withCredentials([azureServicePrincipal(credentialsId: 'credentials_id_ci,
      subscriptionIdVariable: 'SUBS_ID',
      clientIdVariable: 'CLIENT_ID',
      clientSecretVariable: 'CLIENT_SECRET',
      tenantIdVariable: 'TENANT_ID')]) {
       
      checkout()
      terraformFmt()
      terraformInit()
      terraformPlan()
      terraformApply()
      }
      ---------------
       
      thanks for your help.

          [JENKINS-56482] custom name variable seems to not working

          Omega BK created issue -
          Jie Shen made changes -
          Assignee Original: Azure DevOps [ azure_devops ] New: Jie Shen [ jieshe ]
          Azure DevOps made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jie Shen made changes -
          Resolution New: Won't Fix [ 2 ]
          Status Original: In Progress [ 3 ] New: Fixed but Unreleased [ 10203 ]
          Jie Shen made changes -
          Resolution Original: Won't Fix [ 2 ]
          Status Original: Fixed but Unreleased [ 10203 ] New: Reopened [ 4 ]
          Jie Shen made changes -
          Resolution New: Won't Fix [ 2 ]
          Status Original: Reopened [ 4 ] New: Resolved [ 5 ]
          Jenkins IRC Bot made changes -
          Component/s New: _unsorted [ 19622 ]
          Component/s Original: azure-credentials-plugin [ 22020 ]

            jieshe Jie Shen
            krugg3r Omega BK
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: