azurefunctions-extensions-bindings-blob/azurefunctions/extensions/bindings/blob/blobClient.py [23:53]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if self._data:
            self._version = data.version
            self._source = data.source
            self._content_type = data.content_type
            content_json = json.loads(data.content)
            self._connection = get_connection_string(content_json.get("Connection"))
            self._using_managed_identity = using_managed_identity(
                content_json.get("Connection")
            )
            self._containerName = content_json.get("ContainerName")
            self._blobName = content_json.get("BlobName")

    def get_sdk_type(self):
        """
        When using Managed Identity, the only way to create a BlobClient is
        through a BlobServiceClient. There are two ways to create a
        BlobServiceClient:
        1. Through the constructor: this is the only option when using Managed Identity
        2. Through from_connection_string: this is the only option when
        not using Managed Identity

        We track if Managed Identity is being used through a flag.
        """
        if self._data:
            blob_service_client = (
                BlobServiceClient(
                    account_url=self._connection, credential=DefaultAzureCredential()
                )
                if self._using_managed_identity
                else BlobServiceClient.from_connection_string(self._connection)
            )
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



azurefunctions-extensions-bindings-blob/azurefunctions/extensions/bindings/blob/containerClient.py [23:44]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if self._data:
            self._version = data.version
            self._source = data.source
            self._content_type = data.content_type
            content_json = json.loads(data.content)
            self._connection = get_connection_string(content_json.get("Connection"))
            self._using_managed_identity = using_managed_identity(
                content_json.get("Connection")
            )
            self._containerName = content_json.get("ContainerName")
            self._blobName = content_json.get("BlobName")

    # Returns a ContainerClient
    def get_sdk_type(self):
        if self._data:
            blob_service_client = (
                BlobServiceClient(
                    account_url=self._connection, credential=DefaultAzureCredential()
                )
                if self._using_managed_identity
                else BlobServiceClient.from_connection_string(self._connection)
            )
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



