{Azure Front Door}クイックスタート:Azure CLI を使用して高可用性を実現するグローバル Web アプリケーションのための Front Door を作成する

 


https://learn.microsoft.com/ja-jp/azure/frontdoor/quickstart-create-front-door-cli

https://marcelzehner.ch/2020/04/19/managing-azure-front-door-with-the-azure-cli/


Azure Front Door には、Azure Front Door Standard と Azure Front Door Premium の 2 つのレベルがあります。 
Azure Front Door Standard および Premium レベルは、
Azure Front Door (クラシック)、Microsoft の Azure CDN Standard (クラシック)、Azure WAF の機能を、
インテリジェントな脅威保護を用いて、セキュリティで保護された 1 つのクラウド CDN プラットフォームに統合したものです。


ここでは、シンプルなAzure Front Door (クラシック)を使用する

 

-- 1. 前作業

az login --use-device-code
az account show

az version

az configure --list-defaults
az configure --defaults location=japaneast
az configure --list-defaults

az group create \
--name rg999999900 \
--location centralus


az group create \
--name rg999999901 \
--location centralus

az group create \
--name rg999999902 \
--location eastus

az group list

az upgrade

 

-- 2. App Service プランを作成する

az appservice plan create \
--name plan01 \
--resource-group rg999999901 \
--location centralus \
--sku F1


az appservice plan create \
--name plan02 \
--resource-group rg999999902 \
--location eastus \
--sku F1

 

az appservice plan list

 

-- 3. Web アプリを作成する

az webapp create \
--name app9999999901 \
--resource-group rg999999901 \
--plan plan01 \
--runtime "ASPNET:V4.8"


az webapp create \
--name app9999999902 \
--resource-group rg999999902 \
--plan plan02 \
--runtime "ASPNET:V4.8"


az webapp list

 

-- 4. Front Door を作成する

-- 4.1 Front Door を作成する

az extension add --name front-door

az network front-door create \
--backend-address app9999999901.azurewebsites.net \
--resource-group rg999999900 \
--name fd123 \
--accepted-protocols Http Https

az network front-door list


-- 4.2 バックエンドプールにバックエンド追加

az network front-door backend-pool backend list \
--front-door-name fd123 \
--resource-group rg999999900 \
--pool-name DefaultBackendPool

az network front-door backend-pool backend add \
--address app9999999902.azurewebsites.net \
--front-door-name fd123 \
--resource-group rg999999900 \
--pool-name DefaultBackendPool


az network front-door backend-pool backend list \
--front-door-name fd123 \
--resource-group rg999999900 \
--pool-name DefaultBackendPool


-- 4.3 ルーティング規則確認

az network front-door routing-rule list \
--front-door-name fd123 \
--resource-group rg999999900

 

 


-- 5. Front Door をテストする

curl https://app9999999901.azurewebsites.net

curl https://app9999999902.azurewebsites.net

curl https://fd123.azurefd.net


app9999999901を停止

Error 403 - This web app is stopped.

しばらく待つ

Your web app is running and waiting for your content


-- 6. クリーンアップ


az network front-door delete \
--resource-group rg999999900 \
--name fd123

 

az group list

az group delete \
--name rg999999900 \
--yes

az group delete \
--name rg999999901 \
--yes

az group delete \
--name rg999999902 \
--yes