I created a freestyle project in Jenkins where I tried to log in azure in a groovy file
#!/usr/bin/env groovy
// Jenkinsfile (Declarative Pipeline)
pipeline {
agent any
stages {
stage('Stage') {
steps{
script {
withCredentials([azureServicePrincipal('withplugin')]) {
sh 'az login --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET -t $AZURE_TENANT_ID'
sh 'az account set -s $AZURE_SUBSCRIPTION_ID'
}
}
}
}
}
}
I created the service principal, I can login with "AZ" "sh AZ" "nohup sh AZ" command line but in Jenkins with or without plugin with clear credential or variable
access is denied in my console output
- az login --service-principal -u **** -p ****-t ****
Access is denied.
I tried 2 days back to basics even nothing work ....
Can anyone could help me out ?