brew update && brew install azure-cli
v2.x
brew tap azure/functions brew install azure-functions-core-tools
v3.x
brew tap azure/functions brew install azure-functions-core-tools@3 # if upgrading on a machine that has 2.x installed brew link --overwrite azure-functions-core-tools@3
az login
ローカルのストレージエミュレータを使用する場合
https://docs.microsoft.com/ja-jp/azure/developer/azure-cli/azure-cli-configuration#cli-configuration-values-and-environment-variables
export AZURE_STORAGE_CONNECTION_STRING="UseDevelopmentStorage=true"
※以降の az storage コマンドはローカルのエミュレータに対して発行される。
az account list-locations -o table
func init LocalFunctionProj --dotnet
func new --name HttpExample --template "HTTP trigger"
func start
az functionapp deployment source config-zip -g リソースグループ -n 関数名 --src ZIPファイルPATH
storageName=mystorageaccount$RANDOM functionAppName=myappsvcpfunc$RANDOM region=westeurope # Create a resource resourceGroupName az group create \ --name myResourceGroup \ --location $region # Create an azure storage account az storage account create \ --name $storageName \ --location $region \ --resource-group myResourceGroup \ --sku Standard_LRS # Create a Premium plan az functionapp plan create \ --name mypremiumplan \ --resource-group myResourceGroup \ --location $region \ --sku EP1 # Create a Function App az functionapp create \ --name $functionAppName \ --storage-account $storageName \ --plan mypremiumplan \ --resource-group myResourceGroup \ --functions-version 2
参考
Premium プランの関数アプリを作成する
Azure Functions の Premium プラン
サンプルスクリプト
#TODO
#TODO