Notiz
Zougrëff op dës Säit erfuerdert Autorisatioun. Dir kënnt probéieren, Iech unzemellen oder Verzeechnesser ze änneren.
Zougrëff op dës Säit erfuerdert Autorisatioun. Dir kënnt probéieren, Verzeechnesser ze änneren.
This article outlines a collection of proven FinOps practices for web services. It provides strategies for optimizing costs, improving efficiency, and using Azure Resource Graph (ARG) queries to gain insights into your web resources. By following these practices, you can ensure that your web services are cost-effective and aligned with your organization's financial goals.
App Service
The following sections provide ARG queries for App Service. These queries help you gain insights into your App Service resources and ensure they're configured with the appropriate settings. By analyzing App Service plans and surfacing recommendations from Azure Advisor, you can optimize your App Service resources for cost efficiency.
Query: Web Application Status
This ARG query retrieves the status and basic information of web applications within your Azure environment.
Category
Monitoring
Query
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
Remove empty App Service plans
Recommendation: Remove App Service plans that have no apps or functions hosted to avoid unnecessary charges.
About empty App Service plans
App Service plans define the compute resources for your web apps. Paid plans incur charges based on their configured SKU and instance count, regardless of whether any apps are hosted on them. Empty plans can accumulate during development or when apps are moved between plans. Removing unused plans eliminates unnecessary costs.
Note
FinOps hubs can automatically identify empty App Service plans. Learn more.
Identify empty App Service plans
Use the following ARG query to identify App Service plans with no hosted apps.
resources
| where type =~ 'microsoft.web/serverfarms'
| where toint(properties.numberOfSites) == 0
| where sku.tier !~ 'Free'
| project
ResourceId = tolower(id),
ResourceName = name,
SKUName = tostring(sku.name),
SKUTier = tostring(sku.tier),
Region = location,
ResourceGroupName = resourceGroup,
SubscriptionId = subscriptionId
Query: App Service plan details
This ARG query retrieves detailed information about Azure App Service Plans within your Azure environment.
Category
Resource management
Query
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
Give feedback
Let us know how we're doing with a quick review. We use these reviews to improve and expand FinOps tools and resources.
If you're looking for something specific, vote for an existing or create a new idea. Share ideas with others to get more votes. We focus on ideas with the most votes.
Related content
Related resources:
Related solutions: