New to Bitbucket Cloud? Check out our get started guides for new users.
You can use Bitbucket Pipelines with Microsoft Azure in a variety of ways using pipes.
We have the following Azure pipes:
Azure ARM deploy - Deploy resources to Azure using Azure Resource Manager templates.
Azure CLI Run - Run commands using the Azure CLI.
Azure Functions Deploy - Deploy Azure function code.
Azure Kubernetes Service deploy - Deploy to AKS (Azure Kubernetes Service) using Kubectl.
Azure Kubernetes Service Helm deploy - Deploy to AKS (Azure Kubernetes Service) using Helm.
Azure Storage deploy - Deploy to Microsoft Azure Storage.
Azure VM Linux Script Deploy - Run scripts on Azure VM using Custom Script Extension Version 2.
Azure VM Scale Set Linux script deploy - Run scripts on Azure VM Scale Set using Custom Script Extension Version 2.
Azure Web Apps containers deploy - Deploy a container to Azure Web Apps.
Azure Web Apps deploy -Deploy an application to Azure Web Apps.
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.
This will give you a list of values that you can add to your variables in Bitbucket (in repository > Settings > Repository variables.
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.