LoginSignup
1
0

More than 3 years have passed since last update.

Azure Functions v3の.Net Core デプロイをAzure DevOpsのPipelinesで行う方法

Posted at

はじめに

Azure Functionsではデプロイセンターから自動でPipelineの作成を行う機能がありますが、.Net Core 3.1用のPipelinesは自動生成できなかっため(2020年8月時)Azure DevOps上で作成する必要があります。
ここではAzure Functions v3向けのPipelinesの作成手順を記載します。

開発環境

  • Windows 10
  • Visual Studio 2019
  • .Net Core 3.1

Azure Functionsの作成

Azure PortalでAzure Functionsを作成します。
Azure Functions v3にするにはランタイムスタックを「.Net Core」、バージョンを「3.1」とします。
image.png
image.png

Azure DevOpsのプロジェクト作成

Azure DevOpsで任意のプロジェクトを作成します。
image.png

コードの作成

Visual StudioでAzure Functionsのプロジェクトを作成します。
今回はHttpトリガーの関数で作成しました。
image.png
image.png
image.png

GitでAzure DevOpsのプロジェクトにリポジトリをpushしてソースコードが共有されていることを確認する。
image.png

Pipelinesの作成

image.png
Azure Repos Gitを選択
image.png
Functionsのソースコードがあるリポジトリを選択
image.png
.Net Core Function App to Windows on Azureを選択
image.png
対象のAzure Functions Appを選択
image.png
YAMLが自動生成されるので、Save and runを選択
image.png
commitの情報を書く
image.png

実行するとFunctionsの関数に関数が追加されます。
image.png

まとめ

Pipelineでは.Net CoreのAzure Functions向けテンプレートが存在するためそれを使いましょう。
もともとは別のやり方でを紹介するつもりだったのですが、もっと楽な方法があることが知れたので良かったです…
image.png

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0