0
votes

I am trying to access cosmos db from an app service which is integrated to a vnet, subnet = "default". This subnet has service endpoint enabled for Cosmos db, and the configuration of vnet+subnet has been added in the cosmos db portal.

I am getting this error - Entity with the specified id does not exist in the system when my app sends a query to the cosmos db account through NodeJS SDK

The virtual network gateway associated with the vnet has

Address pool = 172.16.0.0/24, Tunnel type = SSL VPN(SSTP) [disabled IKEv2 VPN]

SKU = VpnGw1

I would like the app service which is integrated with the vnet to access the cosmos db which has service endpoint enabled for the vnet, subnet

1
More than your environment you may want to add your query and cosmos DB schema which may be the main culprit. - Fakrudeen
The same query works if I allow access from all networks under "Firewall and virtual networks" settings - Devarajan Roopeshwar
Similar to this question but I would want a solution by allowing access from only a vnet - Devarajan Roopeshwar
If the reply makes sense, you could checkmark under "Answer", or let me know if you need more help. - Nancy Xiong
Yes, thanks a lot @NancyXiong - Devarajan Roopeshwar

1 Answers

0
votes

Apps in Azure App Service are hosted in a multi-tenant system, which precludes provisioning an app directly in a VNet. Also, the VNet Integration feature is always used for securely accessing to resources in your virtual network. This does not mean the web app is located in that VNet, and you could not restrict the web app access to cosmos DB via the VNet endpoint section.

If you want to allow access only from a VNet, you could create a web app service with App Service Environments. The web app will be deployed into a VNet that you have fine-grained control over inbound and outbound application network traffic. Then you can add the VNet to the cosmos DB firewall.