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.

Azure App Service をルートドメインで構築してみた

Posted at

Azure App Service をルートドメインで構築した事がなかったので、試してみました。

検証環境構築

bash
prefix=mnrapptest
region=japaneast
domain=example.com

az group create \
  --name ${prefix}-rg \
  --location $region

az appservice plan create \
  --name ${prefix}-plan \
  --resource-group ${prefix}-rg \
  --is-linux \
  --sku B1

az webapp create \
  --name ${prefix} \
  --resource-group ${prefix}-rg \
  --plan ${prefix}-plan \
  --runtime "PHP|8.0" \
  --https-only true

az webapp config set \
  --name ${prefix} \
  --resource-group ${prefix}-rg \
  --always-on true \
  --ftps-state Disabled

「カスタムドメインの追加」で表示される下記レコードをDNSに追加

appservice-rootdomain-01.png

AppService にカスタムドメインとマネージド証明書を登録

bash
az webapp config hostname add \
  --webapp-name ${prefix} \
  --resource-group ${prefix}-rg \
  --hostname $domain

az webapp config ssl create \
  --resource-group ${prefix}-rg \
  --name ${prefix} \
  --hostname $domain

az webapp config ssl bind \
  --certificate-thumbprint $(az webapp config ssl show \
  --resource-group ${prefix}-rg \
  --certificate-name $domain \
  --query thumbprint \
  --output tsv) \
  --resource-group ${prefix}-rg \
  --name ${prefix} \
  --ssl-type SNI

参考

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?