Skip to main content

New Azure API Failed with Error

This alert occurs when Lacework detects a new API that failed with an error within a geolocation.

Why this Alert is Important

APIs are used by applications and services to interact with Azure resources, such as virtual machines, storage accounts, or databases. When an API call fails, it can result in service disruptions, data loss, or other negative impacts.

Investigation

The following sections offer troubleshooting tips for API operations.

Failed request tracing

Use failed request tracing, an Internet Information Services (IIS) 7.0 feature, to trace logs according to filters established within a web role’s configuration.

Logging destination

Azure outputs trace log files to the default IIS directory for failed request logs. By default, this directory is %SystemDrive%\inetpub\logs\FailedReqLogFiles.

Enabling tracing

Each web role must enable tracing by using rules placed in the project's web.config file. To enable tracing, place the following in the system.webServer section of your web.config file:

<tracing>  
<traceFailedRequests>
<add path="*">
<traceAreas>
<add provider="ASP" verbosity="Verbose" />
<add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" />
<add provider="ISAPI Extension" verbosity="Verbose" />
<add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module" verbosity="Verbose" />
</traceAreas>
<failureDefinitions statusCodes="400-599" />
</add>
</traceFailedRequests>
</tracing>

To disable tracing, remove this section from the web.config file.

The x-ms-request-id header

Every request made against Azure Storage returns a response header named x-ms-request-id. This header contains an opaque value that uniquely identifies the request.

If a request is consistently failing, and you have verified that the request is properly formulated, you can use this value to report the error to Microsoft. In your report, include the following information:

  • The value of x-ms-request-id.
  • The approximate time that the request was made.
  • The Storage service against which the request was made.
  • The type of operation that the request attempted.

Resolution

Implement API Management Diagnostics to help you troubleshoot your API published in APIM. When you run into issues with your published APIs, API Management Diagnostics identifies what’s wrong and guides you to the correct information to quickly troubleshoot and resolve the issue.