question

SergeyGorbushin avatar image
0 Votes"
SergeyGorbushin asked KalyanChanumolu-MSFT answered

Working with CosmosDB using point to site VPN connection with dynamic public IP

Hi! I'm trying to work with Cosmos DB using point to site VPN connection, but Firewall doesn't allow to operate with DB witout adding my public IP address. Not all of our developers (working home now) have a static IP address, so its could be a problem to add every day a new batch of IP addresses and delete a previous one.
How can we securely work with Cosmos DB using point to site VPN connections without updating our IP adresses at Firewall day to day?

azure-cosmos-dbazure-vpn-gateway
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@SergeyGorbushin Thank you for reaching out.
Could you please provide more details about your P2S VNet configuration?
Is Azure Cosmos DB in the same VNet and subnet as your VPN gateway?

0 Votes 0 ·

Yes, they are in the same vnet, in separated subnets. First subnet is GatewaySubnet, second subnet in PrivateEndpoints. In Cosmos DB connection string I use its local IP address to ensure, that all traffic is internal.

0 Votes 0 ·

1 Answer

KalyanChanumolu-MSFT avatar image
0 Votes"
KalyanChanumolu-MSFT answered

@SergeyGorbushin

You will have to configure a service endpoint to allow traffic from the GatewaySubnet to the Cosmos account.
When a service endpoint for your Azure Cosmos DB account is enabled on a subnet, the source of the traffic that reaches Azure Cosmos DB switches from a public IP to a virtual network and subnet.

The steps with screenshots are here
Do let us know if you have any further questions.


If an answer is helpful, please "Accept answer" or "Up-Vote" for the same which might be beneficial to other community members reading this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.