Azure Function requests to Cosmos periodically getting blocked

James 1 Reputation point
2021-04-05T15:57:36.033+00:00

We're on an Azure function consumption plan that connects with a CosmosDB. We have a vnet setup so that CosmosDB doesn't need to be publicly accessible. however, we're still getting periodic IP blocking with the following error message:

"One or more errors occurred. (Request originated from client IP ##.###.##.## through public internet. This is blocked by your Cosmos DB account firewall settings"

Help me understand why this happens and how to resolve it.

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
{count} votes

3 answers

Sort by: Most helpful
  1. Anonymous
    2021-04-08T02:04:56.803+00:00

    @James

    We checked with our team internally and they have proposed the following

    "The problem looks like on the Azure Functions end. We are not sure how you have set up VNET integration but they noticed that you are using Consumption plan for Az Functions, The consumption plan doesn’t support VNET integration.

    You could review these to check you have set things up correctly:

    Configure virtual network based access for an Azure Cosmos account | Microsoft Learn
    Azure Functions networking options | Microsoft Learn

    Please let us know if you need any further info.

    Regards
    Navtej S


  2. Anonymous
    2021-04-12T16:56:01.647+00:00

    @James

    We are glad the issue is resolved for now. We did get a further response from the team on the same lines where a review of the architecture is needed and they have shared few documents as well:

    If they are on Premium then yes VNET integration is possible, but I still think this is really an Az Functions issue or maybe the way they have set up VNET integration, rather than a Cosmos issue. Cosmos wouldn’t block those requests if they were sourced from within the VNET so I think they should review their network architecture to ensure the function app is calling Cosmos DB service endpoint in the same VNET or via private link if appropriate.

    See:
    Azure Functions networking options | Microsoft Learn
    Integrate app with Azure Virtual Network - Azure App Service | Microsoft Learn
    Configure virtual network based access for an Azure Cosmos account | Microsoft Learn

    Hope these documents help and provide more info.

    0 comments No comments

  3. devopsfj 261 Reputation points
    2024-01-19T10:33:44.9866667+00:00

    Did you ever get a resolution to this? I have a similar issue with AKS.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.