Monitor Azure API Management With Azure Workbooks

Azure API Management (APIM) is a fully-managed service that enables organizations to publish, secure, transform, and monitor APIs. The service features multiple types of monitoring and logging:

  • Metrics give insights into the state and health of an API Management service instance.
  • Analytics show usage details and performance of APIs and operations.
  • Diagnostic logs enable detailed debugging and auditing of individual requests.

Although these tools provide all the necessary information to manage an APIM instance, they are located in different places. For example, metrics and analytics have separate views, while diagnostic logs require manual queries in Application Insights. This can be solved by leveraging Azure Workbooks to combine all data sources into a single view. The view results in an interactive experience for managing an APIM instance and can easily be modified for custom requirements.

Azure Workbooks to the Rescue

Azure Workbooks provide a flexible canvas that is made up of parameters, queries, and metrics. A single workbook may contain many metrics and queries that visualize information from different sources. Parameters allow users to select subscriptions or other resources that must be used in a visualization. Also, parameters can be substituted into queries. This results in an interactive monitoring experience that aggregates data from multiple sources. Workbooks can be updated in a visual editor in the browser without writing code. Complexity is limited to writing queries and parameterizing visualizations.

Azure Workbook for APIM

Our Azure Workbook for APIM contains three levels: service level, API level, and operation level. This results in a top-down view, where issues at the service level can be correlated to the level of a single operation. The service level contains the following components:

  • Three parameters to select the Azure Subscription, the APIM instance, and the time range.
  • Metrics that show the load on the APIM service instance and the number of failed requests.
  • A grid that shows detailed Analytics information per API.
Service Level Monitoring

The user can specify a specific API in a dropdown parameter on the API level. Selecting an API populates a grid with analytics on the Api operations, allowing users to identify issues with specific operations.

Operation Level Monitoring

Finally, the user can specify an operation using a dropdown parameter, which triggers a query in Application Insights to retrieve any requests from the diagnostic logs. The requests are shown in a grid, and logged payloads are included in text fields below the table.

Request Level Monitoring

Call to Action

Perform the following actions to create the workbook described earlier. Create an empty workbook and import the workbook code that is located here.

Subsequently:

  • Select the right subscription, Api Management instance, and time range.
  • The metrics and Api details should become visible.
  • Configure diagnostic logging to capture requests and payloads for debugging.

The Workbook relies on the properties.resourceId parameter from the Logger definition to determine the correct instance of Application Insights. If this field is missing, manually set the Application Insights instance on the query level.

Conclusion

Azure Workbooks are an excellent tool for building and maintaining monitoring solutions. In addition, they can easily be extended with custom functionality, such as automatic visualization of Api Management request tracing or a custom table from Azure Monitor Logs that contains audit information for APIs.

However, the capabilities to securely query custom data sources are currently limited. For example, although it is possible to include static json or to reference a custom endpoint, there is no way to protect a custom data source. Alternatively, Azure Custom Resource Providers can be used, but these are still in preview.

nielsvanderkaap

nielsvanderkaap

Curious to know more about this topic?

Working at i8c

i8c is a system integrator that strives for an informal atmosphere between its employees, who have an average age of approx 30 years old. We invest a lot of effort in the professional development of each individual, through a direct connection between the consultants and the management (no multiple layers of middle management). 

Quality Assurance

i8c is committed to delivering quality services and providing customer satisfaction. That’s why we invested in the introduction of a Quality Management System, which resulted in our ISO9001:2000 certification. This guarantees that we will meet your expectations, as a reliable, efficient and mature partner for your SOA & integration projects.

i8c - ISO9001-2015

Also worth reading

Exploring the world of IBM: Carlos’ journey to Hursley

In today’s fast-paced digital world, user experience is paramount. One of the common challenges faced by organizations using Azure Active Directory B2C for authentication is the default password reset flow. The process, though functional, lacks personal touch and branding consistency. Frederic, one of our integration experts, created a guide for you on how to implement a custom password reset flow using Azure B2C and Logic App.

Read More »

B2C Custom Password Resets with Logic App

In today’s fast-paced digital world, user experience is paramount. One of the common challenges faced by organizations using Azure Active Directory B2C for authentication is the default password reset flow. The process, though functional, lacks personal touch and branding consistency. Frederic, one of our integration experts, created a guide for you on how to implement a custom password reset flow using Azure B2C and Logic App.

Read More »

Secure a Service Bus Queue Endpoint with Azure API Management

In the context of APIM, the backend service can be a Logic App, Azure Function, or Container App. It can also be a service bus queue or topic or an Event Grid topic. In scenarios to persist a message (request) on a queue or topic for further processing or an event handled further down in a process, APIM can be an option to secure the endpoint of a given Service Bus queue or topic or a customer Event Grid topic.

Read More »