question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Confusion about CosmosDB binding and retries

See original GitHub issue

I am currently trying to use the retry policy in the CosmosDB binding in the Function. However, I think that the docs are bit misleading as of now and I am unsure whether the retry policy will work or not.

Repro steps

Provide the steps required to reproduce the problem

  1. I have a python Function that uses the CosmosDB binding. I wanted also to add retry policy as stated here: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-error-pages?tabs=fixed-delay%2Cin-process&pivots=programming-language-python#retries The definition of the function.json looks like this:
{
  "scriptFile": "../src/handler.py",
  "entryPoint": "handle",
  "bindings": [
    {
      "type": "cosmosDBTrigger",
      "name": "documents",
      "direction": "in",
      "connectionStringSetting": "CosmosDB_Endpoint",
      "databaseName": "database",
      "collectionName": "collection",
      "CreateLeaseCollectionIfNotExists": true
    }],
    "retry": {
      "strategy": "exponentialBackoff",
      "maxRetryCount": 3,
      "minimumInterval": "00:01:00",
      "maximumInterval": "00:15:00"
    }
}
  1. When the host is initializing is is showing the following log: image

Expected behavior

Based on the information found on the https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-error-pages?tabs=fixed-delay%2Cin-process&pivots=programming-language-python#retries it seems that the retry policy is supported for the CosmosDB binding. I was expecting that this kind of log won’t be shown.

Actual behavior

The log regarding the support of the retry policy is showing which is somewhat confusing in relation to the documents.

Related information

Provide any related information

  • Version of the azure functions python runner = 4.15.1.1
  • Host.json
{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": false,
        "excludedTypes": "Request"
      }
    }
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[2.*, 3.0.0)"
  }
}
  

Issue Analytics

  • State:closed
  • Created 7 months ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Ceglowacommented, Mar 2, 2023

Okay, I posted a issue on the azure-docs github repository so that the documentation is clearer about this (https://github.com/MicrosoftDocs/azure-docs/issues/106040). Closing this ticket

0reactions
ealsurcommented, Mar 1, 2023

@Ceglowa The documentation page has a Feedback section at the bottom, please use that to report documentation related issues. I understand what you are describing, but there is nothing that can be changed on this repo to either update the documentation or to handle Bundle related questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automatic retry to CosmosDb output binding - azure
I'm using an Azure function that sends an array of around 200 documents to a CosmosDB via the Output Binding. That function gets...
Read more >
A technical overview of Azure Cosmos DB | Azure Blog
With an upper bound of request processing on every database transaction, Azure Cosmos DB allows clients to clearly distinguish between ...
Read more >
Automatic retry to CosmosDb output binding
The Output binding uses SDK 1.13.2 which already has the retry mechanism in place. Assuming you are using Azure Functions v1, if you...
Read more >
A quick review of the Azure Functions new feature "Retry ...
Retry Policy allows you to implement retries in your application by simply adding simple annotations. This is a long-awaited feature for those ...
Read more >
The Curious Case of Cosmos DB - Kunal Sale - Medium
Using this mechanism, Cosmos DB ensures that the data operations are cheap and less expensive. Don't confuse the partitioning with the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found