Unexpected GET calls received in API Management instance from Microsoft Datacenter IPs
Unexpected GET calls received in API Management instance (apim-api-gw-prd) from Microsoft Datacenter IPs. Please refer the attached logs registered via app insight (ai-apim-api-gw-prd) associated with the APIM. Why we are receiving such GET calls to the APIM instance from Microsoft datacenter? We need to reduce such unnecessary exception noise. Please let us know how to address this ASAP.
Azure API Management
-
Krishna Chowdary Paricharla • 2,080 Reputation points • Microsoft External Staff • Moderator
2025-07-14T14:09:31.3166667+00:00 Hello Anirban Roy Choudhury •,
If you're getting some unexpected GET calls to your API Management instance from Microsoft datacenter IPs, which sounds frustrating. Here’s a breakdown of what might be going on and how you can address it:
Understand the Source: GET requests from Microsoft datacenter IPs could be legitimate traffic, perhaps coming from Azure services or monitoring tools that interact with your API Management. However, if these calls are causing exceptions and noise, it’s important to identify their purpose.
IP Management: The IP addresses for Azure API Management instances may not always be static, especially if you are using tiers like Consumption or Basic, which run on a shared infrastructure. If your instance is set up in a public tier, it’s essential to check whether you need to allowlist the datacenter IPs to manage unauthorized access properly.
Check the Logs: You mentioned using Application Insights; ensure to analyze the logs for these requests to identify patterns regarding the frequency, origin, and nature of the payloads.
Mitigation Strategies:
- IP Allowlisting: If you determine that the calls are unnecessary, consider implementing IP restrictions. You can refer to the information on making rules with IP addresses to block unwanted traffic.
- Firewall Rules: Utilize Azure Firewall or other network security groups to control incoming traffic effectively.
- IP Allowlisting: If you determine that the calls are unnecessary, consider implementing IP restrictions. You can refer to the information on making rules with IP addresses to block unwanted traffic.
-
Krishna Chowdary Paricharla • 2,080 Reputation points • Microsoft External Staff • Moderator
2025-07-15T10:28:07.0933333+00:00 Hello Anirban Roy Choudhury •,
Just following up to see if you had a chance to review my previous response and if you have any additional questions. -
Anirban Roy Choudhury • 20 Reputation points
2025-07-15T18:20:58.1533333+00:00 @Krishna Chowdary Paricharla, As said before, GET requests are from Microsoft datacenter IP's e.g. 51.104.42.110, 51.141.93.187 . Cloud role name in logs registered as - "apim-api-gw-prd UK West" . Cloud Role Instance - apim-api-gw-prd UK West. Sample exceptions below.
[{"severityLevel":"Error","outerId":"0","message":"Unable to match incoming request to an operation.","type":"OperationNotFound","id":"0","parsedStack":[{"method":"configuration","level":0,"line":0}]}]
[{"severityLevel":"Error","outerId":"0","message":"Client connection was unexpectedly closed.","type":"ClientConnectionFailure","id":"0","parsedStack":[{"method":"policy-configuration","level":0,"line":0}]}]These exceptions are generated as only following operations are called on the APIM instance which doesn't match any API operations.
GET /Also, how do I understand the source more when the cloud role instance is mentioned as API management. Or are you meaning these could be some other Azure services? If yes then how to determine that?
I don't want to put a filter on IP as this could add to the maintenance in future but I can actually try this if I can specifically restrict Microsoft datacenter IPs via APIM policies. Note that consumption tier doesn't support VNET integration. Can you point me in the right direction where i can find a sample policy for such IP restrictions?
Note that I couldn't observe any correlation with azure services. Let me know if i'm missing anything here.
-
Krishna Chowdary Paricharla • 2,080 Reputation points • Microsoft External Staff • Moderator
2025-07-16T05:59:30.3766667+00:00 Hello Anirban Roy Choudhury •,
Thank you for the details.Source of GET Requests: The
GET /
requests from Microsoft datacenter IPs (e.g.,51.104.42.110
,51.141.93.187
) are likely from Azure internal services such as health probes or platform diagnostics. Since you're on the Consumption tier, logs only show the APIM role instance (e.g.,apim-api-gw-prd UK West
), and not the exact Azure service source — this is expected behavior.Understanding the Source: These requests originate from Microsoft-owned IPs, but it’s difficult to correlate with a specific service due to APIM's abstraction in the consumption model. You’re not missing anything — the platform doesn’t expose deeper correlation.
- Recommendations:
- To reduce exception noise, configure a fallback operation for
GET /
in your API to handle such requests gracefully.- If you'd prefer to block such calls, you can use APIM policy to filter by IP. Sample below:
<inbound> <choose> <when condition="@(context.Request.IpAddress == "51.104.42.110" || context.Request.IpAddress == "51.141.93.187")"> <return-response> <set-status code="403" reason="Forbidden" /> </return-response> </when> </choose> <base />
- If you'd prefer to block such calls, you can use APIM policy to filter by IP. Sample below:
</inbound> ```
- Microsoft IP ranges can be referenced from: https://www.microsoft.com/en-us/download/details.aspx?id=56519
-
Anirban Roy Choudhury • 20 Reputation points
2025-07-16T11:32:35.1966667+00:00 Thanks @Krishna Chowdary Paricharla for the quick response. Few more questions.
- Currently API's are surfaced to APIM via function apps underneath. Do you mean to add just a root GET / endpoint within the function app to respond with 403 status code as above? Can this be done in the APIM itself without initiating any code changes on the FA? Or this root GET "/ " endpoint should be defined in APIM as a new API? Can you please provide the steps here clearly?
- Looks like IP addresses are changing daily. So this approach will be difficult to manage. Is there way to restrict via APIM policies based on the URL path pattern?
- Noticed method & outer methods in the logs are pointing towards "Configuration & Policy-Configuration" as shown below. What do these mean as I have a rate limit policy defined at the product level? Do i need to amend anything at the product level policies?
-
Krishna Chowdary Paricharla • 2,080 Reputation points • Microsoft External Staff • Moderator
2025-07-16T12:00:23.7533333+00:00 Hello Anirban Roy Choudhury •,
Thanks for the follow-up. Please find answers to your queries below:Do I need to add the
GET /
endpoint in Function App? No code change is needed on the Function App. You can handleGET /
directly in APIM by adding a dummy operation that returns a 403 response. This prevents unmatched requests from generating exceptions.Can this be handled purely in APIM? Yes. Define a new operation in APIM with method
GET
and URL/
, then return a custom response using policy — no backend call required.IP addresses change frequently — can I restrict by URL instead? Yes. You can apply an APIM policy to block or filter requests based on URL path patterns (e.g., block
GET /
) instead of IPs. This is more maintainable.What do
configuration
andpolicy-configuration
mean in logs?-
configuration
withOperationNotFound
: Request didn’t match any defined operation (likeGET /
). -
policy-configuration
withClientConnectionFailure
: Client closed the connection before policy execution completed. These are gateway-level issues, not related to your backend.
Do I need to change product-level policies like rate limit? No changes are needed. Your current product-level
rate-limit
policy is unrelated to the observed exceptions. -
-
Krishna Chowdary Paricharla • 2,080 Reputation points • Microsoft External Staff • Moderator
2025-07-17T12:00:52.7233333+00:00 Hello Anirban Roy Choudhury •,
Just checking in to see if you've had a chance to review my previous response. Let me know if you have any additional questions.
-
Anirban Roy Choudhury • 20 Reputation points
2025-07-18T14:32:05.4+00:00 Thanks Krishna Chowdary Paricharla . My responses are highlighted in bold.
- Do I need to add the
GET /
endpoint in Function App**?** No code change is needed on the Function App. You can handleGET /
directly in APIM by adding a dummy operation that returns a 403 response - I added the dummy operation but didn't help. Should this require a dummy API to be added? - IP addresses change frequently — can I restrict by URL instead? Yes. You can apply an APIM policy to block or filter requests based on URL path patterns (e.g., block
GET /
) instead of IPs. This is more maintainable. - Applied a policy to filter requests based on URL path patterns. I will update you on this next week.
- Do I need to add the
-
Krishna Chowdary Paricharla • 2,080 Reputation points • Microsoft External Staff • Moderator
2025-07-18T20:56:30.0366667+00:00 Hello Anirban Roy Choudhury •,
Yes, to properly handleGET /
requests, you’ll need to create a separate dummy API in APIM with base URL/
, and then add aGET /
operation under it.Just adding the operation under an existing API won’t work if the request doesn’t match that API’s base path. The dummy API will catch root-level unmatched requests and return a 403 without routing to the backend.
-
Krishna Chowdary Paricharla • 2,080 Reputation points • Microsoft External Staff • Moderator
2025-07-21T08:39:41.3+00:00 Hello Anirban Roy Choudhury •,
Just checking in to see if you've had a chance to review my previous response. Let me know if you have any additional questions. -
Anirban Roy Choudhury • 20 Reputation points
2025-07-21T11:59:25.1633333+00:00 Thanks Krishna Chowdary Paricharla for the quick response.
- I have added the "Catch All" dummy API with a dummy operation as shown below. Hopefully this works. I will update you on this tomorrow.
- But, I was trying the following policy approach as well at the product level. Currently all API's are scoped to a product. Not sure why the following policy is always evaluating to "Otherwise" block. Can you please check what I'm missing here? Note that I tried "Contains" instead of "StartsWith" but didn't work!
-
Krishna Chowdary Paricharla • 2,080 Reputation points • Microsoft External Staff • Moderator
2025-07-22T08:48:42.49+00:00 Hello Anirban Roy Choudhury •,
The reason your policy is always going to the
otherwise
block is because product-level policies don’t reliably have access to the full URL path (context.Request.Url.Path
) at that stage of execution. That’s why conditions likeStartsWith("/v1/customers")
don’t work as expected.To fix this, move the policy to the API-level inbound policy, where the full path will be available and the condition will evaluate correctly.
-
Anirban Roy Choudhury • 20 Reputation points
2025-07-22T12:48:11.8+00:00 Thanks again @Krishna Chowdary Paricharla. However, none of the above methods are working.
- GET pings from microsoft datacenter IPS are still seen in exceptions
- Above policy didn't work in ALL API or API level. Always goes to otherwise block.
Let me know your thoughts.
-
Krishna Chowdary Paricharla • 2,080 Reputation points • Microsoft External Staff • Moderator
2025-07-23T06:15:51.6766667+00:00 Hello Anirban Roy Choudhury •,
Could you please check the private message and provide the required details for troubleshooting the issue further.Here is the reference link on how to access & data retention policy of private messages in Microsoft Q&A.
-
Anirban Roy Choudhury • 20 Reputation points
2025-07-23T17:28:44.4866667+00:00 Hello @Krishna Chowdary Paricharla , I didn't receive any private message assuming the message will come to me as an email. I updated my email id today. May be you need to resend the private message again?
-
Krishna Chowdary Paricharla • 2,080 Reputation points • Microsoft External Staff • Moderator
2025-07-24T04:38:48.89+00:00 Hello Anirban Roy Choudhury •,
Could you please check the private message now and provide the required details for troubleshooting the issue further.
Here is the reference link on how to access & data retention policy of private messages in Microsoft Q&A.
-
Krishna Chowdary Paricharla • 2,080 Reputation points • Microsoft External Staff • Moderator
2025-07-25T05:10:46.47+00:00 Hello Anirban Roy Choudhury •,
Just checking in to see if you've had a chance to review my previous response. Let me know if you have any additional questions.
-
Anirban Roy Choudhury • 20 Reputation points
2025-07-25T11:18:26.3633333+00:00 thanks @Krishna Chowdary Paricharla, I responded to your message.
-
Krishna Chowdary Paricharla • 2,080 Reputation points • Microsoft External Staff • Moderator
2025-07-28T04:48:44+00:00 Hello Anirban Roy Choudhury •,
Could you please check the private message now and provide the required details for troubleshooting the issue further.
Here is the reference link on how to access & data retention policy of private messages in Microsoft Q&A.
-
Anirban Roy Choudhury • 20 Reputation points
2025-07-28T13:00:40.5833333+00:00 @Krishna Chowdary Paricharla , provided the details as per the request. Thanks.
-
Anirban Roy Choudhury • 20 Reputation points
2025-07-31T09:25:46.5066667+00:00 @Krishna Chowdary Paricharla , any updates please?
-
Krishna Chowdary Paricharla • 2,080 Reputation points • Microsoft External Staff • Moderator
2025-07-31T09:31:05.7766667+00:00 Hello Anirban Roy Choudhury •,
Could you please check the private message.
Here is the reference link on how to access & data retention policy of private messages in Microsoft Q&A.
-
Krishna Chowdary Paricharla • 2,080 Reputation points • Microsoft External Staff • Moderator
2025-08-04T22:34:12.9+00:00 Hello Anirban Roy Choudhury •,
Could you please check the private message and provide the required details for troubleshooting the issue further.
Here is the reference link on how to access & data retention policy of private messages in Microsoft Q&A.
-
Anirban Roy Choudhury • 20 Reputation points
2025-08-05T09:21:31.4766667+00:00 @Krishna Chowdary Paricharla, thanks & responded.
-
Anirban Roy Choudhury • 20 Reputation points
2025-08-07T14:05:43.8866667+00:00 @@Krishna Chowdary Paricharla, is there any update on this please?
Sign in to comment