How to add alert for Pricing plan not equal to expected in Azure app service plan?

Azurin4848484 0 Reputation points
2024-10-07T09:06:03.16+00:00

Hi! We need to add an alert for Pricing plan not equal to expected (e.g. B1) in Azure app service plan and send email e.g. hourly until it is fixed - how to do it?

Thanks!

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,261 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,979 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vinodh247 20,636 Reputation points
    2024-10-07T09:45:19.4733333+00:00

    Hi Azurin4848484,

    Thanks for reaching out to Microsoft Q&A.

    1. Use Azure Policy to Monitor Pricing Plan: Azure Policy can help you monitor and ensure that resources comply with specific configurations, such as the pricing plan of an Azure App Service Plan.
      1. Create a custom policy that checks if the pricing tier of your App Service Plan matches the expected value (B1).
      2. Use a policy definition that evaluates the pricing tier of the App Service Plan.
      3. Assign the policy to the specific subscription/resource group where the App Service resides.
    2. Create a Policy Definition: This policy should audit any App Service Plans that are not using the "B1" pricing tier.
    3. Assign the Policy:
      1. Assign the policy to your subscription or resource group where the App Service Plan resides.
      2. Ensure that the Remediation option is enabled (if needed) for automatic fixing.
    4. Set Up Alerts via Log Analytics:
      1. Enable Azure Monitor for the App Service Plan to send logs to a Log Analytics workspace.
      2. Use Log Analytics queries to monitor the pricing plan.
    5. Configure an Alert Rule:
      1. Create a new Alert Rule:
        • Scope: Select the App Service Plan resource.
        • Condition: Set up a query (using the one from Log Analytics) to monitor the pricing plan.
        • Action Group: Create an Action Group that includes an email notification and configure the repeating frequency (ex: every hour).
      2. Set the condition to trigger an alert when the pricing plan does not equal the expected value.
    6. Action Group:
    • When setting up the Action Group, choose Email/SMS/Push/Voice as the action type.
      • Add your email recipients and ensure that the alert is sent repeatedly (hourly) until the issue is resolved.

    This will ensure that any deviation from the expected pricing plan triggers an email notification, and you can receive these alerts hourly until it is fixed.

    Please 'Upvote'(Thumbs-up) and 'Accept' as an answer if the reply was helpful. This will benefit other community members who face the same issue.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.