Microsoft Azure にデプロイする
You can use Bitbucket Pipelines with Microsoft Azure in a variety of ways using pipes.
次の Azure パイプを提供しています。
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.
これらのパイプで bitbucket-pipelines.yml をセットアップする方法についてのガイダンスが必要な場合は、リポジトリをご覧ください。
パイプを使用する前に、いくつかの構成を行う必要があります。
認証情報のセットアップ
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.
サービス プリンシパルの作成
Azure App Service アプリを作成するのに十分なアクセス権を持つサービス プリンシパルを作成する必要があります。サービス プリンシパルは、Azure を操作するツールで使用できる ID です。次のコマンドを使ってサービス プリンシパルを作成します。
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.
ここで:
appId → AZURE_APP_ID
password → AZURE_PASSWORD
tenant → AZURE_TENANT_ID
Find out more from the Azure docs on creating a service principle.
これで、Azure パイプを使用する準備が整いました。bitbucket-pipelines.yml ファイルをオンラインで編集してエディタからパイプを選択するか、パイプ リポジトリから直接スクリプトをコピーして貼り付けます。
この内容はお役に立ちましたか?