diff --git a/Jenkinsfile b/Jenkinsfile index 0b2383a..21c080b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,15 +38,18 @@ pipeline { } stage('Deploy to Container App') { steps { - withCredentials([azureServicePrincipal( - credentialsId: 'azure-sp', - subscriptionIdVariable: 'AZ_SUB', - clientIdVariable: 'AZ_CLIENT_ID', - clientSecretVariable: 'AZ_CLIENT_SECRET', - tenantIdVariable: 'AZ_TENANT_ID')]) { + withCredentials([ + string(credentialsId: 'azure-subscription-id', variable: 'AZ_SUB'), + string(credentialsId: 'azure-client-id', variable: 'AZ_CLIENT_ID'), + string(credentialsId: 'azure-client-secret', variable: 'AZ_CLIENT_SECRET'), + string(credentialsId: 'azure-tenant-id', variable: 'AZ_TENANT_ID') + ]) { sh ''' + echo "Logging in to Azure..." az login --service-principal -u $AZ_CLIENT_ID -p $AZ_CLIENT_SECRET --tenant $AZ_TENANT_ID + echo "Setting subscription..." az account set --subscription $AZ_SUB + echo "Updating container app..." az containerapp update \ --name $CONTAINER_APP \ --resource-group $RESOURCE_GROUP \ @@ -61,4 +64,4 @@ pipeline { cleanWs() } } -} +} \ No newline at end of file