<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Azure API Management Archives : Binary Bits</title>
	<atom:link href="https://blog.binarybits.net/tag/azure-api-management/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.binarybits.net/tag/azure-api-management/</link>
	<description>Bits &#38; Pieces - A blog by Kannan Balasubramanian</description>
	<lastBuildDate>Sun, 08 Jun 2025 11:53:52 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.1</generator>
	<item>
		<title>Log API request/response payload in Azure Application Insights</title>
		<link>https://blog.binarybits.net/log-api-request-response-payload-in-azure-application-insights/</link>
					<comments>https://blog.binarybits.net/log-api-request-response-payload-in-azure-application-insights/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Sat, 08 Feb 2025 11:39:00 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Azure API Management]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=1606</guid>

					<description><![CDATA[<p>Sometimes when we expose the APIs in Azure API Management (APIM) there will be situations were we face issues when the API fails and we need to log the incoming payload and possibly log the outgoing payloads as well. Fortunately APIM provides an easy way to do this. Steps to log You can also use [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/log-api-request-response-payload-in-azure-application-insights/">Log API request/response payload in Azure Application Insights</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Sometimes when we expose the APIs in Azure API Management (APIM) there will be situations were we face issues when the API fails and we need to log the incoming payload and possibly log the outgoing payloads as well.</p>



<p class="wp-block-paragraph">Fortunately APIM provides an easy way to do this.</p>



<h2 class="wp-block-heading">Steps to log</h2>



<ul class="wp-block-list">
<li>Login into the Azure portal and navigate to the specific API Management resource</li>



<li>Go to settings</li>



<li>Select the specific API</li>



<li>On the right hand side, select the settings</li>



<li>Navigate to Diagnostics Logs</li>



<li>Check the &#8216;Enable&#8217; checkbox under Application Insights</li>



<li>Select the Default sampling rate to 100%</li>



<li>Set the verbosity to Information</li>



<li>Set Correlation protocol as W3C</li>



<li>Go to Advanced Options under Additional settings</li>



<li>Check the Frontend Request and Frontend Response</li>



<li>Under the setting for both the Request &amp; Response</li>



<li>Add &#8220;X-Forwarded-For&#8221; under the headers</li>



<li>Add &#8220;8192&#8221; under the Number of payload bytes to log</li>



<li>Save the changes</li>



<li>Navigate to the App Insights</li>



<li>Open the Live Metrics feature</li>



<li>Allow the API to be hit</li>



<li>Go to the logs</li>



<li>Filter using the API URL</li>



<li>In the results section under the request body node, you should be able to see the request body</li>



<li>The same for the response body can be used.</li>
</ul>



<p class="wp-block-paragraph">You can also use a query like below to filter the App Insight logs</p>



<pre class="wp-block-code"><code>requests
| where url == &lt;API URL>"
| where timestamp >= ago (1h)
| order by timestamp desc</code></pre>
<p>The post <a href="https://blog.binarybits.net/log-api-request-response-payload-in-azure-application-insights/">Log API request/response payload in Azure Application Insights</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/log-api-request-response-payload-in-azure-application-insights/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: blog.binarybits.net @ 2026-07-10 09:27:03 by W3 Total Cache
-->