Prompt Title: Azure Service Principal.

Created 1 year ago
Votes 0
Views 300 times
0

Prompt Detail:

If you want to use service principal credentials to authenticate in your Azure Pipelines YAML file, you can use the Azure CLI task to run a script that authenticates with the service principal.

Here's an example YAML pipeline that demonstrates how to use the Azure CLI task to authenticate with a service principal:

yaml
trigger: - main pool: vmImage: 'ubuntu-latest' steps: - task: AzureCLI@2 inputs: azureSubscription: '<your-subscription-name>' scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: | az login --service-principal -u "<your-application-id>" -p "<your-client-secret>" --tenant "<your-tenant-id>"

In this example, the Azure CLI task is used to run a Bash script that logs in to Azure

avatar
JP
Shared 1 prompt
Created 1 year ago

Leave a Comment