#author("2020-07-28T04:27:52+00:00","","")
#mynavi(Azureメモ)
#setlinebreak(on);

* 目次 [#e47b545e]
#contents
- 関連
-- [[Azureメモ]]
- 参考
-- [[macOS での Azure CLI のインストール:https://docs.microsoft.com/ja-jp/cli/azure/install-azure-cli-macos?view=azure-cli-latest]]
-- [[Azure CLI を使用してサインインする:https://docs.microsoft.com/ja-jp/cli/azure/authenticate-azure-cli?view=azure-cli-latest]]

* インストール [#mede3398]
#html(<div class="pl10">)

** Azure CLI (Mac) [#if6ccc68]
#html(<div class="pl10">)
#myterm2(){{
brew update && brew install azure-cli
}}
#html(</div>)

** Azure Functions Core Tools (Mac) [#b2b8e0d6]
#html(<div class="pl10">)

https://docs.microsoft.com/ja-jp/azure/azure-functions/functions-run-local?tabs=macos%2Ccsharp%2Cbash

v2.x
#myterm2(){{
brew tap azure/functions
brew install azure-functions-core-tools
}}

v3.x
#myterm2(){{
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
}}

#html(</div>)
#html(</div>)

* ログイン [#v21f0b37]
#html(<div class="pl10">)
#myterm2(){{
az login
}}

ローカルのストレージエミュレータを使用する場合
https://docs.microsoft.com/ja-jp/azure/developer/azure-cli/azure-cli-configuration#cli-configuration-values-and-environment-variables
#myterm2(){{
export AZURE_STORAGE_CONNECTION_STRING="UseDevelopmentStorage=true"
}}
※以降の az storage コマンドはローカルのエミュレータに対して発行される。

#html(</div>)

* リージョン一覧の確認 [#r761a5d3]
#html(<div class="pl10">)
#myterm2(){{
az account list-locations -o table
}}
#html(</div>)

* Azure Function の開発 [#vf10d2c1]
#html(<div class="pl10">)

** ローカル関数プロジェクトの作成 [#m782a70a]
#html(<div class="pl10">)
#myterm2(){{
func init LocalFunctionProj --dotnet
}}
#html(</div>)

** 関数をプロジェクトに追加 [#ce8dceac]
#html(<div class="pl10">)
#myterm2(){{
func new --name HttpExample --template "HTTP trigger"
}}
#html(</div>)

** 関数をローカルで実行する [#scd496d3]
#html(<div class="pl10">)
#myterm2(){{
func start
}}
#html(</div>)

** 関数をデプロイする [#m104bb8a]
#html(<div class="pl10">)
#myterm2(){{
az functionapp deployment source config-zip -g リソースグループ -n 関数名 --src ZIPファイルPATH
}}
参考
[[Azure Functions の zip デプロイ:https://docs.microsoft.com/ja-jp/azure/azure-functions/deployment-zip-push]]
[[Azure Functions のデプロイ テクノロジ:https://docs.microsoft.com/ja-jp/azure/azure-functions/functions-deployment-technologies]]

#html(</div>)

** Premium プランの関数アプリを作成する [#ib558d67]
#html(<div class="pl10">)
[[Azure FunctionsからVMにアクセスする]] を参照。
#html(</div>)

#html(</div>)

* リソースグループの作成 [#v8e25144]
#html(<div class="pl10">)
#myterm2(){{
#TODO
}}
#html(</div>)

* リソースアカウントの作成 [#g3061447]
#html(<div class="pl10">)
#myterm2(){{
#TODO
}}
#html(</div>)

* Blobストレージの操作 [#g29086ae]
#html(<div class="pl10">)

** ストレージコンテナの作成 [#bcda0c9b]
#html(<div class="pl10">)
#myterm2(){{
az storage container create -n コンテナ名
}}
#html(</div>)

** ストレージコンテナの一覧 [#nca87c41]
#html(<div class="pl10">)
#myterm2(){{
az storage container list
}}
#html(</div>)

** Blobオブジェクトの一覧 [#nff73cfa]
#html(<div class="pl10">)
#myterm2(){{
az storage blob list -c コンテナ名
}}
#html(</div>)

** Blobオブジェクトのアップロード [#kc97c05f]
#html(<div class="pl10">)
#myterm2(){{
az storage blob upload -f ファイルPATH -c コンテナ名 -n オブジェクト名
}}
#html(</div>)

** Blobオブジェクトのダウンロード [#r46c69a6]
#html(<div class="pl10">)
#myterm2(){{
az storage blob download -f 出力ファイルPATH -c コンテナ名 -n オブジェクト名
}}
#html(</div>)

#html(</div>)

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