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:
Switch-on System Assigned Managed identity for the logic app.
Add Role Assignment
Add following role assignment. Reader Role as subscription scope, and click Save
Now Go to Azure Logic App's Designer Page.
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
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.
Add Parse Json Action as shown below.
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.
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.
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 ).
This should be the flow in the logic app.
Hope this helps. Please let me know if you have any additional questions.