Kevin Jones
Kevin Jones

Reputation: 429

Azure functions host.json being ignored

I'm using Azure functions to deal with my service bus queue and I wanted to add a delay for when the item in the queue is processed again when it throws an exception and puts things back into the queue.

I added this piece of code to my host.json from the Microsoft Docs

{
  "version": "2.0",
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[2.*, 3.0.0)"
  },
  "extensions": {
    "serviceBus": {
      "serviceBusOptions": {
        "retryOptions": {
          "mode": "fixed",
          "tryTimeout": "00:00:10",
          "delay": "00:00:30",
          "maxDelay": "00:01:00",
          "maxRetries": 4
        },
        "prefetchCount": 100,
        "autoCompleteMessages": true,
        "maxConcurrentCalls": 32,
        "maxConcurrentSessions": 10,
        "maxMessages": 2000,
        "sessionIdleTimeout": "00:18:00",
        "maxAutoLockRenewalDuration": "00:18:00"
      }
    }
  }
}

However, my function is just ignoring these settings and not honoring the delay I set above.

Upvotes: 0

Views: 1667

Answers (1)

Jason Pan
Jason Pan

Reputation: 21873

You maybe need this offical article.

host.json reference for Azure Functions 2.x and later

If you want to use retry Options, you should use below sample code.

enter image description here

Not use Properties in RetryOptions Class .

Upvotes: 1

Related Questions