Automating Alerts for Azure Front Door Custom Domains(Apex) in Pending Revalidation State

Chevula, Dilip Reddy 20 Reputation points
2024-03-04T12:42:29.7566667+00:00

Alert Configuration: I would like to set up alerts to notify me whenever a custom domain (apex) in Azure Front Door transitions to the pending revalidation state. Could you please provide me with the necessary steps to configure such alerts?

Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
622 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,253 questions
0 comments No comments
{count} votes

Accepted answer
  1. ChaitanyaNaykodi-MSFT 24,231 Reputation points Microsoft Employee
    2024-03-04T22:29:09.3+00:00

    @Chevula, Dilip Reddy

    Thank you for reaching out.

    I understand you wish to add an automated Alert for Azure Front Door Domain Validation state as you have onboarded an Apex domain and you wish to get an alert when domain states changes to pending revalidation state.

    Currently there is no out of the box solution which can be implemented here, it will help if you could create a feedback item for this on the azure feedback portal here.

    Meanwhile you can create a custom solution in this case using azure logic app and the Management REST API call of Azure Fron door here. This solution requires no code and is easy to set-up. I tried it on my end and below are the steps I followed. This solution will only work for Standard/Premium SKU of AFD.

    • Follow the steps here to Create Azure Logic App.
    • Grant Reader Role Managed Identity to your Logic App for your subscription:

    User's image

    Switch-on System Assigned Managed identity for the logic app.

    User's image

    Add Role Assignment

    User's image

    Add following role assignment. Reader Role as subscription scope, and click Save

    User's image

    Now Go to Azure Logic App's Designer Page.

    User's image

    Create a Reoccurrence Trigger (Please set the re-occurrence as per your requirement, at this frequency the Logic App will trigger) For testing purposes I have set the interval to 3 minutes

    User's image

    Next Add HTTP action and use AFD Custom Domain REST API. Please add the appropriate values to REST API. Add the Authentication parameter and set the parameter as below and use https://management.azure.com as the audience.

    User's image

    Add Parse Json Action as shown below.

    User's image

    Schema to use (You can create this schema for REST API Call above by uploading a sample response or use the schema below)

    {
        "properties": {
            "id": {
                "type": "string"
            },
            "name": {
                "type": "string"
            },
            "properties": {
                "properties": {
                    "azureDnsZone": {},
                    "deploymentStatus": {
                        "type": "string"
                    },
                    "domainValidationState": {
                        "type": "string"
                    },
                    "extendedProperties": {},
                    "hostName": {
                        "type": "string"
                    },
                    "preValidatedCustomDomainResourceId": {},
                    "provisioningState": {
                        "type": "string"
                    },
                    "referencedRoutePaths": {},
                    "tlsSettings": {
                        "properties": {
                            "certificateType": {
                                "type": "string"
                            },
                            "minimumTlsVersion": {
                                "type": "string"
                            },
                            "secret": {}
                        },
                        "type": "object"
                    },
                    "validationProperties": {
                        "properties": {
                            "expirationDate": {
                                "type": "string"
                            },
                            "validationToken": {
                                "type": "string"
                            }
                        },
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "type": {
                "type": "string"
            }
        },
        "type": "object"
    }
    
    
    

    Add a condition action for domainValidationState as shown below. Use Dynamic value of Parse JSON action above.

    User's image

    In the True section, create search for outlook and create a connection using your work account. Then select a send email action as shown below.

    User's image

    This way there will an alert generated when the Front Door Domain is in pending state.

    Sample alert I got (My test domain here was in pending state as I did not have a pending-revalidation domain to test but based on the condition applied above the alert should work for pending-revalidation state ).

    User's image

    This should be the flow in the logic app.

    User's image

    Hope this helps. Please let me know if you have any additional questions.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful