1
votes

We are debugging our systems to see failed azure posts and want to learn why they failed in the first place.

The AzureMetric and Azure diagnostics are not helping when we are running the query over OMS.

Where do we see which values made us fail ?

Our OMS Query

search * | where Resource == "xxx-API-NONPRODUCTION" | where Type == "AzureDiagnostics"

Sample Error from OMS

$table AzureDiagnostics TenantId yyy-0a7b-4833-8fb6-yyy SourceSystem Azure TimeGenerated [UTC] 2017-12-20T15:05:00.845Z Type AzureDiagnostics Environment_s PROD lastError_source_s configuration lastError_reason_s OperationNotFound lastError_message_s Unable to match incoming request to an operation. lastError_section_s backend OperationName Microsoft.ApiManagement/GatewayLogs Category GatewayLogs CallerIPAddress 51.yyy.34.yyy location_s UK West method_s GET url_s https://xxx-api-nonproduction.azure-api.net/qa/user/api/zzz/UserAccountExistsByEmailAddressAndIsEnabled/[email protected] cache_s none apiId_s tttt productId_s tttt userId_s 1 apimSubscriptionId_s vvvv ResourceId /SUBSCRIPTIONS/vvvv-2F08-4DED-92B8-vvvv/RESOURCEGROUPS/xxx-CORE-NONPRODUCTION/PROVIDERS/MICROSOFT.APIMANAGEMENT/SERVICE/xxx-API-NONPRODUCTION SubscriptionId vvv-vvvv-vvv-vvv-vvv ResourceGroup xxx-CORE-NONPRODUCTION ResourceProvider MICROSOFT.APIMANAGEMENT Resource uuuu-API-NONPRODUCTION ResourceType SERVICE CorrelationId vvv-vvv-vvv-vvv-vvvvv isRequestSuccess_b false Level_d 4 EventId_d 222 DurationMs 0 responseCode_d 404 responseSize_d 130

1

1 Answers

1
votes

By default API management service does not log request body or headers, that can be done but with some extra work. You'll have to use log-to-eventhub policy to send body into eventhub and read it there later to log. Or you could save request body into a variable and return it as a response bidy from on-error section when request fails.

But from your log I can see that you get OperationNotFound: Unable to match incoming request to an operation. That means that URL was called on APIM service that didn't match any operation defined in API. The URL in question is https://xxx-api-nonproduction.azure-api.net/qa/user/api/zzz/UserAccountExistsByEmailAddressAndIsEnabled/[email protected]

If we assume that "qa/user" is API suffix, then "/zzz/UserAccountExistsByEmailAddressAndIsEnabled/[email protected]" should match URL template of one of operations in such API, and such operation must have method set as GET since that's what is being called.