Simplified Solution: Troubleshooting Backend API Failures in Azure Cloud
This article simples troubleshooting backend API failures in Azure cloud applications without extensive debugging application code.
Join the DZone community and get the full member experience.
Join For FreeApplication failures can be classified into three main types: User Interface failures, Backend API failures, and Infrastructure failures. When users encounter issues, they often submit tickets based on the priority of the problems.
Troubleshooting Application From User Interface
This article focuses on identifying the root cause of Backend API failures without debugging the application code. The main challenge lies in pinpointing the exact cause of the issue. The initial step involves using developer tools Network Fetch/XHR option for debugging, which helps identify the failing API and its response code. Application Support Engineer may get an initial idea about the issue. With this information and timestamp of the issue occurs can help debugging from Azure Portal.
Troubleshooting From API Management Service in Azure Portal
API Management Services Analytics in Azure involves using the Azure portal to gain insights into the usage and performance of your APIs. To further investigate, the Azure portal's API Management service has Monitoring features. Analytics can be utilized and use filter API then search the API name.
API Management Service Analytics Filters Screenshot From Azure Portal
The API Management service displays details such as the Method, URL, and Response Code of all API requests during the particular period. You need to observe the response codes from the portal and copy the failure API URL from the URL column in Azure Portal. From API Management Service we can be able to find the API response code and the URL.
API Management Service Analytics Result Screenshot from Azure Portal
Troubleshooting From Application Insights
Application Insights in the Azure portal allows you to perform transaction searches to analyze and troubleshoot traces, exceptions, and request events in your applications. Copying the failure URL and pasting it into Application Insight transaction search for further investigation. Apply necessary filters to retrieve the closest relevant information. You need to analyze the search results one by one to find the root cause of the issue, and based on the information fix can be applied.
Application Insights Transactions Search Screenshot from Azure Portal
Cross-Check With Postman Results
To cross-verify backend API failures from Postman, start by reproducing the API request using Postman and analyzing the response code. Referencing the payload information obtained earlier from the troubleshooting process, such as the failing API's URL and response code, enter these details into Postman. Execute the request and carefully examine the response code returned by the API. By comparing the response code obtained in Postman with the information gathered from tools like the Azure portal's API Management service, you can confirm whether the issue persists outside the application environment. This cross-verification step using Postman provides an additional layer of confirmation and helps ensure that the API failures are consistently reproducible and accurately identified.
Conclusion
This article offers a straightforward approach to troubleshooting backend API failures in Azure Cloud applications. It categorizes application failures into different types and emphasizes the importance of quickly identifying and resolving issues reported by users. The troubleshooting process involves using developer tools for initial debugging and then leveraging Azure's API Management service and Application Insights for deeper insights. Utilize Postman to verify the API response code for the identical payload information identified in Application Insights traces. By following this step-by-step approach, users can efficiently identify the root cause of backend API failures without extensive code debugging.
Opinions expressed by DZone contributors are their own.
Comments