本文概述 Web 服務的已實證 FinOps 做法集合。 其提供將成本優化、提高效率,以及使用 Azure Resource Graph (ARG) 查詢以深入瞭解 Web 資源的策略。 遵循這些做法,您可以確保 Web 服務符合成本效益,並符合貴組織的財務目標。
應用程式服務
下列各節提供 App Service 的 ARG 查詢。 這些查詢可協助您深入瞭解 App Service 資源,並確保這些資源已使用適當的設定進行設定。 藉由分析 Azure Advisor 的 App Service 方案和呈現建議,您可以將 App Service 資源優化,以達到成本效益。
查詢:Web 應用程式狀態
此 ARG 查詢會擷取 Azure 環境中 Web 應用程式的狀態和基本資訊。
類別
監視
查詢
resources
| where type =~ 'Microsoft.Web/sites'
| project
id,
WebAppName = name,
Type = kind,
Status = tostring(properties.state),
WebAppLocation = location,
AppServicePlan = tostring(properties.serverFarmId),
WebAppRG = resourceGroup,
SubscriptionId = subscriptionId
| order by id asc
查詢:App Service 方案詳細數據
此 ARG 查詢會擷取 Azure 環境中 Azure App 服務 方案的詳細資訊。
類別
資源管理
查詢
resources
| where type == "microsoft.web/serverfarms" and sku.tier !~ 'Free'
| project
planId = tolower(tostring(id)),
name,
skuname = tostring(sku.name),
skutier = tostring(sku.tier),
workers = tostring(properties.numberOfWorkers),
maxworkers = tostring(properties.maximumNumberOfWorkers),
webRG = resourceGroup,
Sites = tostring(properties.numberOfSites),
SubscriptionId = subscriptionId
| join kind=leftouter (
resources
| where type == "microsoft.insights/autoscalesettings"
| project
planId = tolower(tostring(properties.targetResourceUri)),
PredictiveAutoscale = properties.predictiveAutoscalePolicy.scaleMode,
AutoScaleProfiles = properties.profiles,
resourceGroup
) on planId
提供意見反應
請寫下您的快速評價,讓我們知道我們的表現如何。 我們會使用這些評論來改善及擴充 FinOps 工具和資源。
如果您要尋找特定專案,請投票給現有專案或建立新想法。 與其他人分享想法,以獲得更多的選票。 我們專注於擁有最多選票的想法。
相關內容
相關資源:
相關解決方案: