Associate monitoring with Azure App Service using Azure CLI

Associate monitoring with Azure App Service using Azure CLI

Install Azure CLI

If you haven’t already, you can install Azure CLI on your local machine. Follow the instructions provided by Microsoft here to install it.

Log in to Azure

To get started, open a terminal or command prompt and log in to your Azure account using the command: az login.

Set the subscription

If you have multiple Azure subscriptions, you can set the one you want to use for your App Service monitoring by running the command: az account set –subscription <subscription_id>. You can find the subscription id in the output of the previous login command.

Enable Application Insights

To enable monitoring and diagnostics for your App Service using Application Insights, execute the command: az webapp config set –name <app_service_name> –resource-group <resource_group_name> –enabled true –slot-settings. Replace <app_service_name> with the name of your App Service and <resource_group_name> with the name of the resource group where your App Service is located.

Verify monitoring setup

You can verify if the monitoring has been successfully enabled for your App Service by running the command: az webapp config show –name <app_service_name> –resource-group <resource_group_name> –query instrumentationKey. This will give you the Instrumentation Key which can be used to integrate your App Service with monitoring tools like Azure Monitor and Application Insights.

All set! You have now associated monitoring with your Azure App Service using Azure CLI. With the obtained Instrumentation Key, you can configure additional monitoring settings or integrate with other monitoring services according to your needs.

Don’t stop here! Visit to learn about how Skrots can also help you with managing your Azure App Service and provide other useful services.

Thank you for using Skrots!

Show More

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button