Application Gateway - Cosmos DB

vivlevi1-0127 1 Reputation point

As a requirement, I am trying to put multiple app services and cosmos db behind the application gateway. I am able to access app service behind the gateway but Cosmos DB is not accessible.
When I configure Cosmos db via firewall/VNET and respective backend subnet, while testing from Postman the error 404 is coming.

I able to access app service from gateway but the request further to CosmosDB is giving me 404 error. Request goes like this - Client>>App Service>>Cosmos DB

I have gone through documentation from Microsoft and followed but its just not working.
On Azure portal, on the Cosmos DB, under the Firewall & virtual network , I am able to add existing virtual network along with subnet. But the request is failing and giving me 404 error.

If any one has done similar implementation or aware of this scenario, please let me know. What more can be done here ? Is there a step am missing ? are Database configured differently ?

Appreciate your help!!

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
914 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. TravisCragg-MSFT 5,676 Reputation points Microsoft Employee

    Although your Application Gateway resides in your Virtual Network, the traffic is not translated (SNAT) to your Application Gateway's IP when it is forwarded to your Cosmos DB.

    This means that the requests will appear to originate from their true source and not your Azure Virtual Network, and they will be blocked by your Firewall.

    What exactly are you trying to accomplish?