App Service Plan
The presented resiliency recommendations in this guidance include App Service Plan and associated settings.
Summary of Recommendations
Recommendation | Category | Impact | State | ARG Query Available |
---|---|---|---|---|
ASP-1 - Migrate App Service to availability Zone Support | Availability | High | Preview | Yes |
ASP-2 - Use Standard or Premium tier | Availability | High | Preview | Yes |
ASP-3 - Avoid scaling up or down | System Efficiency | Medium | Preview | Yes |
ASP-4 - Create separate App Service plans for production and test | Governance | High | Preview | No |
ASP-5 - Enable Autoscale/Automatic scaling to ensure adequate resources are available to service requests | System Efficiency | Medium | Preview | Yes |
Recommendations Details
ASP-1 - App Service を可用性ゾーン サポートに移行します
Category: Availability
Impact: High
Guidance
可用性ゾーン (AZ) 間での App Service プランと App Service Environment のデプロイは、ビジネスクリティカルなワークロードの回復性と信頼性を強化するために Azure によって提供される機能です。アプリケーションを複数のアベイラビリティーゾーンに分散することで、データセンターレベルの障害が発生した場合でも、アプリケーションの運用を継続できます。このアプローチでは、アプリケーションを異なる Azure リージョンにデプロイする必要なく、優れた冗長性が提供されます。可用性ゾーンは、より高いレベルのフォールトトレランスを提供し、アプリケーションを保護し、ダウンタイムを最小限に抑えるのに役立ちます。これにより、ビジネスの継続性を維持し、中断のないサービスをお客様に提供できます。
Resources
- Migrate App Service to availability zone support
- High availability enterprise deployment using App Service Environment
Resource Graph Query
// Azure Resource Graph Query
// The query filters the qualified App Service Plans that do not have Zone Redundancy enabled.
// Its important to check regions that support availability zones for Azure App Services running on multi-tenant and App Service Environments https://learn.microsoft.com/en-us/azure/reliability/reliability-app-service?tabs=graph%2Ccli#:~:text=The%20following%20regions%20support%20Azure%20App%20Services%20running%20on%20multi%2Dtenant%20environments%3A
resources
| where type =~ 'microsoft.web/serverfarms'
| extend zoneRedundant = tobool(properties.zoneRedundant)
| extend sku_tier = tostring(sku.tier)
| where (tolower(sku_tier) contains "isolated" or tolower(sku_tier) contains "premium") and zoneRedundant == false
| project recommendationid="asp-1", name, id, tags, param1=sku_tier, param2="Not Zone Redundant"
ASP-2 - Standard または Premium レベルを使用します
Category: Availability
Impact: High
Guidance
Azure App Service プランの Standard または Premium レベルの使用は、高度なスケーリング、高可用性、トラフィック管理、強化されたパフォーマンス、ネットワーク機能、複数のデプロイ スロットを提供し、潜在的な障害や需要の増加に直面しても中断のない運用と堅牢性を保証するため、回復性の高いアプリケーションにとって非常に重要です。
Resources
Resource Graph Query
// Azure Resource Graph Query
// Provides a list of Azure App Service Plans that are not in the "Standard", "Premium", or "IsolatedV2" SKU tiers.
resources
| where type =~ 'microsoft.web/serverfarms'
| extend sku_tier = tostring(sku.tier)
| where tolower(sku_tier) !contains "standard" and
tolower(sku_tier) !contains "premium" and
tolower(sku_tier) !contains "isolatedv2"
| project recommendationid="asp-2", name, id, tags, param1= strcat("SKU=",sku_tier)
ASP-3 - スケールアップまたはスケールダウンを避けるようにします
Category: System Efficiency
Impact: Medium
Guidance
Azure App Service インスタンスを頻繁にスケールアップまたはスケールダウンすることは避けることをお勧めします。代わりに、一般的なワークロードを処理できる適切なレベルとインスタンスサイズを選択し、トラフィック量の変化に対応するためにインスタンスをスケールアウトします。スケールアップまたはスケールダウンすると、アプリケーションの再起動がトリガーされ、サービスが中断される可能性があります。
Resources
Resource Graph Query
// Azure Resource Graph Query
// Provides a list of Azure App Service Plans and the number of changes that was made to the pricing tier, if the count is higher that 3 it means you need to avoid scaling up and down that often
resourcechanges
| extend changeTime = todatetime(properties.changeAttributes.timestamp), targetResourceId = tostring(properties.targetResourceId),
changeType = tostring(properties.changeType), correlationId = properties.changeAttributes.correlationId,
changedProperties = properties.changes, changeCount = properties.changeAttributes.changesCount
| where changeTime > ago(14d)
| join kind=inner (resources | project resources_Name = name, resources_Type = type, resources_Subscription= subscriptionId, resources_ResourceGroup= resourceGroup, id) on $left.targetResourceId == $right.id
| where resources_Type contains "microsoft.web/serverfarms"
| where changedProperties['sku.name'].propertyChangeType == 'Update' or changedProperties['sku.tier'].propertyChangeType == 'Update'
| summarize count() by targetResourceId, resources_Name ,tostring(changedProperties['sku.name'].previousValue), tostring(changedProperties['sku.tier'].newValue)
| project recommendationid="asp-3", name=resources_Name, id=targetResourceId, tags="", param1=['changedProperties_sku.name_previousValue'], param2=['changedProperties_sku.tier_newValue'], param3=count_
ASP-4 - 運用環境とテスト用に個別の App Service プランを作成します
Category: Governance
Impact: High
Guidance
運用環境とテスト環境用に別々の App Service プランを作成することを強くお勧めします。テスト目的で運用環境内のスロットを使用することは避けてください。同じ App Service プラン内のアプリが VM インスタンスを共有する場合、運用環境とテスト デプロイを組み合わせると、運用環境に悪影響を及ぼす可能性があります。たとえば、テスト展開で実行されるロード テストでは、実際の運用サイトのパフォーマンスが低下する可能性があります。テスト展開を個別の計画に分離することで、運用バージョンの分離と保護を確実に行うことができます。
Resources
Resource Graph Query
// cannot-be-validated-with-arg
ASP-5 - 自動スケーリング/自動スケーリングを有効にして、サービス要求に十分なリソースを使用できるようにします
Category: System Efficiency
Impact: Medium
Guidance
Azure App Service の自動スケーリング/自動スケーリングを有効にして、受信要求を処理するのに十分なリソースを確保することを強くお勧めします。自動スケーリングはルールベースのスケーリングですが、自動スケーリングは、HTTP トラフィックに基づいて自動スケールアウトとスケールインを実行する新しいプラットフォーム機能です。
Resources
Resource Graph Query
// under-development