#author("2020-07-11T03:19:33+00:00","","")
#mynavi(Azureメモ)
#setlinebreak(on);

* 概要 [#f4049305]
#html(<div>)
#TODO
Azure Functions をローカル開発する手順。
#html(</div>)

* 目次 [#z94f443e]
#contents
- 関連
-- [[Azureメモ]]
- 参考
-- [[Azure Functions をローカルでコーディングしてテストする:https://docs.microsoft.com/ja-jp/azure/azure-functions/functions-develop-local]]

* 起動コマンドの例 [#ued47e54]
#html(<div>)

[[Azurite>https://docs.microsoft.com/ja-jp/azure/storage/common/storage-use-azurite]] と [[Azure Functions Core Tools>https://docs.microsoft.com/ja-jp/azure/azure-functions/functions-run-local?tabs=macos%2Ccsharp%2Cbash]]  が入っていれば普通に func start するだけでローカル起動が可能。
※DBなどにアクセスする場合は、ローカル開発用の環境変数を local.settings.json の Values 配下に定義しておく。

#myterm2(){{

# ストレージエミュレータ(azurite)を起動
mkdir -p local_azurite
azurite --silent --location `pwd`/local_azurite &

sleep 5

# 必要に応じてストレージコンテナなどを作成
export AZURE_STORAGE_CONNECTION_STRING="UseDevelopmentStorage=true"  # az storage コマンドの向け先をエミュレータにしておく
az storage container create -n $storageContainerIn
az storage container create -n $storageContainerOut

# ビルド
exefile=`cat host.json | grep defaultExecutablePath | awk '{print $2}' | sed 's/"//g'`
echo go build -o $exefile
go build -o $exefile

# ローカルで関数アプリを起動
func start
}}

#html(</div>)


トップ   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS