0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

m1 macでAzure functions(C#)のdocker環境構築

0
Last updated at Posted at 2023-09-27

Azure functionsを触る機会があったのでDocker環境構築した際のつまづいたポイントを残しておきます。

コンテナイメージ

公式が用意しているfunction用のイメージを使用。

# 今回は.NETのv6、func-cliのv4が必要だったのでそのバージョンを取得
FROM mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated6.0-core-tools

こちらはamdでしか動かないのでplatformにlinux/amd64を指定。

※上記のコンテナを知るまで、自前でSDKやfunc-cliをインストールするイメージを作成していた。

起動

上記のコンテナ上で

func start

で動くはずですが、もし動かない場合は言語をオプションで指定。

func start --csharp

備考

Azure functions自体はこれで動いたのですが、
自分のケースでは、残念なことにWindowsでしか動かないライブラリを使用する処理があったようで、Docker上では動きませんでした。
仕方がないのでWindows上で直接func-cliをインストールして実行し、このイメージはお蔵入りとなってしまいました。
ただ、それ以外のAPIは普通に動いたので、何かの際には使えるかと思います。

0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?