How to track API requests in Azure APIM to Table Storage
The article explains how to track API requests in Azure API Management (APIM) by logging them to Azure Table Storage for detailed usage analytics. It describes using the send-one-way-request policy to log requests without impacting API performance, ensuring all requests are captured regardless of success or failure. The setup involves creating a storage account, generating a scoped SAS token for secure access, and storing the token as a named value in APIM for secure, reusable configuration.
- ▪Azure APIM can log every incoming API request to Azure Table Storage using a fire-and-forget method.
- ▪The send-one-way-request policy ensures no added latency by not waiting for a response from Table Storage.
- ▪A Shared Access Signature (SAS) token with Add permission is used to securely grant APIM write-only access to the table.
- ▪The SAS token should be stored as a Named Value in APIM to avoid hardcoding secrets in policies.
- ▪Logging in both outbound and on-error sections ensures all requests, including failed ones, are captured.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 1282259) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Sam Vanhoutte Posted on May 2 How to track API requests in Azure APIM to Table Storage #azure #apim #cloud When you run a mobile API (like us at libelo), you quickly reach a point where you want to understand how people are actually using it. Not just error counts or latency histograms, but the real detail: which operations are called, from which platform, with what location data, at what time.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).