How to set Azure Blobs Extension version to min 5.0.0 of python function

Schweiger Manuel 0 Reputation points
2023-05-12T11:59:49.1766667+00:00

We need to set Azure Blobs Extension Bundle version to min 5.0.0 of our Docker python function. According to docs this is required to use managed identity.

However, It seems like it does not work via host.json as the function cannot authenticate.

host.json:

"extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[4.*, 5.0.0)"

So how to set the Microsoft.Azure.WebJobs.Extensions.Storage.Blobs properly?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,917 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. MuthuKumaranMurugaachari-MSFT 22,441 Reputation points Moderator
    2023-05-12T14:59:49.9666667+00:00

    Schweiger Manuel Thanks for posting your question in Microsoft Q&A. The extension bundles are used by Python Function and this bundle has a pre-defined set of binding extensions that include Microsoft.Azure.WebJobs.Extensions.Storage.Blobs. Refer extension.json in GitHub repo for each bundle version and mapped extensions for that bundle and here is the link for V4.x which has min version set as 5. So, you don't need to set this extension specifically in your app other than using extension bundle version in host.json.

    User's image

    I hope you have followed doc: Configure an identity-based connection and Azure Blob storage bindings and assigned permissions/role needed for Blob extension. If you face any issues, let me know the full error message, code snippet, how you configured identity, local or deployed in azure etc. Note, user-assigned identity with a resource ID is not supported.

    Source: Configure an identity-based connectionUser's image

    Update:
    Also, noticed that [4.*, 5.0.0) implies the range 4.* <= x < 5.0.0 (exclusive maximum version) and you would have to change it to [4.*, 5.0.0] to include 5.0.0. Check out doc: Version ranges for more info.

    I hope this helps.

    3 people found this answer helpful.

  2. Schroeder, Michael (CTR) 36 Reputation points
    2023-06-19T21:01:40.9133333+00:00

    For anybody else struggling with this, the key is to understand that binding extensions and extension bundles are not the same thing. An extension bundle will have various versions of binding extensions included. Yes, the Microsoft documentation is very confusing!

    If you look at the documentation https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-register#extension-bundles, then follow the "extensions.json" link in the bundle version tables you will be able to see the specific extension bundle versions included.

    You will also need to be sure that for connection binding you only specify the prefix portion of the name (before the "__"). Following with Microsoft's documentation example (https://learn.microsoft.com/en-us/azure/azure-functions/functions-identity-based-connections-tutorial-2), if Application Settings has the name "ServiceBusConnection__fullyQualifiedNamespace the binding connection should be specified as "ServiceBusConnection".

          "connection": "ServiceBusConnection"
        }
    
    0 comments No comments

Your answer

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