Deploy to Microsoft Azure

You can use Bitbucket Pipelines with Microsoft Azure in a variety of ways using pipes.

We have the following Azure pipes:

If you'd like some guidance on how to set up your bitbucket-pipelines.yml with these pipes, have a peek at the repositories:

Before you use the pipes you need to do some configuration:

Set up your credentials

First you will need to configure your Azure resources. The most common way to do it is by using the Azure CLI. You can either install the Azure CLI on your local machine, or you can use the Azure Cloud Shell provided by the Azure Portal in a browser.

Create a service principal

You will need create a service principal with enough access to create an Azure App Service app. A service principal is an identity you can use in tools to interact with Azure. Use the following command to create a service principal.

1 az ad sp create-for-rbac --name <name for your principal>

This will give you a list of values that you can add to your variables in Bitbucket (in repository > Settings > Repository variables.

Where:

  • appId → AZURE_APP_ID

  • password → AZURE_PASSWORD

  • tenant → AZURE_TENANT_ID

Find out more from the Azure docs on creating a service principle.

You are now ready to use the Azure pipes, just edit your bitbucket-pipelines.yml file online to select the pipe from the editor, or copy and paste the script directly from a pipe repository.

Additional Help