Seafish
Seafish

Reputation: 2261

Use Service Principal in Azure CLI in VSTS Release Definition

We have a Resource Manager service principal configured through VSTS settings to access an Azure subscription. Everything works wonderfully when we use the Powershell Resource Manager built in tasks. However, we have a build agent that is running on a Mac because it needs to build a Xamarin project.

After Xamarin builds the .ipa we need to upload it to blob storage. We would like to grab the storage access token from Azure using the service principal on every release instead of storing the token ourselves, but we don't have access to Powershell because we're running on a Mac. We can use the Azure CLI, but we need to access the same service principal information that the built in Powershell Azure RM tasks use.

Any ideas?

Upvotes: 1

Views: 476

Answers (2)

Seafish
Seafish

Reputation: 2261

Powershell is now available on Mac.

You may have to install the preview versions of the AzureRM cmdlets until the real ones are released.

Upvotes: 1

Eddie Chen - MSFT
Eddie Chen - MSFT

Reputation: 29958

You can separate the build and upload action into build and release. In the build definition, run the Xamarin build and publish the .ipa file to artifacts with Mac agents, and then in the release definition, upload the artifacts to Azure Blob with Windows agent.

Upvotes: 1

Related Questions