azure-webappsazure-app-service-plans

Is it possible to check scale up logs


I've an azure app service, then i want to know when someone scaleup or scales down my service plan i want to know who did that.

I've used the below command but didnt get any logs

az monitor activity-log list --resource-group YourRGName subscriptions/subscription-id/resourceGroups/YourRGName/providers/Microsoft.Web/serverfarms/AppServicePlan --query "[?operationName.value=='Microsoft.Web/serverfarms/write']"

can please someone help me out.


Solution

  • The reason you're not getting the logs is because, the CLI command is missing the --resource-id flag before specifying the resource path.

    Use the below command to get the logs without any issues.

    az monitor activity-log list --resource-group <resource-group-name> --resource-id /subscriptions/subscription-id/resourceGroups/<resource-group-name>/providers/Microsoft.Web/serverfarms/AppServicePlan --query "[?operationName.value=='Microsoft.Web/serverfarms/write']"
    

    Please refer this Msdoc for Azure CLI command. You can see the logs now.

    enter image description here

    enter image description here

    You can also view the logs in your Azure app service

    Go to App service - > Monitoring -> Diagnostic settings -> follow the below steps

    enter image description here

    enter image description here

    In the activity log of your App Service Plan, you can see who scaled it up or down.

    enter image description here