An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
Hello Yashas Manjunath,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you're asking if availability tests content match support regex match.
The failure is caused by the Content must contain validation using a literal text match, not a regex match. Standard availability tests expose ContentMatch, IgnoreCase, and PassIfTextFound, but there is no documented regex option, whitespace-normalization option, JSONPath selector, or “match either value” setting. Therefore, a regex pattern such as OverallStatus:\s*Healthy is not supported for this field. Therefore, standard availability test content validation does not support regex.
The best resolution is to standardize the health endpoint response so every application version returns one stable success token, then configure the availability test to match that exact value. For example, return:
AvailabilityTestStatus=Healthy
and configure Content must contain with the same exact value:
AvailabilityTestStatus=Healthy
If the endpoint cannot be changed and you must support both spacing formats, then Standard availability test content validation is not the right tool for that logic. In that case, implement a custom availability test where your code performs regex or response normalization, and then sends the result to Application Insights using availability telemetry. Microsoft documents custom availability testing as the valid path when you need to run your own test logic and submit results to Application Insights.
Use the below official Microsoft resources for more reading and implementation steps:
- https://learn.microsoft.com/azure/azure-monitor/app/availability
- https://learn.microsoft.com/azure/templates/microsoft.insights/webtests
- https://learn.microsoft.com/troubleshoot/azure/azure-monitor/app-insights/availability/availability-monitoring-common-issues-faq
- https://learn.microsoft.com/troubleshoot/azure/azure-monitor/app-insights/availability/diagnose-ping-test-failure
- https://learn.microsoft.com/troubleshoot/azure/azure-monitor/app-insights/availability/internal-server-availability-tests-firewall
Do not hesitate to let me know if you have any other questions, steps or clarifications.
I hope this is helpful. Please close the thread by upvoting and accepting the answer if any part of it is helpful.