注: この質問は、同じシナリオを提示する一連の質問の一部です。シリーズの各質問には、指定された目標を達成できる独自のソリューションが含まれています。問題セットには、複数の正解があるものもあれば、正解がないものもあります。 このセクションの質問に回答すると、その質問に戻ることはできなくなります。そのため、これらの質問はレビュー画面に表示されません。 Azure App Service API アプリを開発し、Development という名前の Windows でホストされているデプロイ スロットにデプロイします。Production という名前の追加のデプロイ スロットを作成します。運用デプロイ スロットで自動スワップを有効にします。 スワップ操作が発生する前に、スクリプトが実行され、リソースが利用可能であることを確認する必要があります。 解決策: 自動スワップを無効にします。statuscheck という名前のメソッドを使用してアプリを更新し、スクリプトを実行します。自動スワップを再度有効にして、アプリを本番スロットにデプロイします。 ソリューションは目標を満たしていますか?
正解:A
Explanation Instead update the web.config file to include the applicationInitialization configuration element. Specify custom initialization actions to run the scripts. Note: Some apps might require custom warm-up actions before the swap. The applicationInitialization configuration element in web.config lets you specify custom initialization actions. The swap operation waits for this custom warm-up to finish before swapping with the target slot. Here's a sample web.config fragment. <system.webServer> <applicationInitialization> <add initializationPage="/" hostName="[app hostname]" /> <add initializationPage="/Home/About" hostName="[app hostname]" /> </applicationInitialization> </system.webServer> Reference: https://docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots#troubleshoot-swaps