Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueueServiceClient.get_queue_client does not inherit credentials #689

Open
washcycle opened this issue May 6, 2021 · 0 comments
Open

QueueServiceClient.get_queue_client does not inherit credentials #689

washcycle opened this issue May 6, 2021 · 0 comments

Comments

@washcycle
Copy link

Which service(blob, file, queue) does this issue concern?

queue

Which version of the SDK was used? Please provide the output of pip freeze.

azure-storage-queue==12.1.6

What problem was encountered?

queue client created from get_queue_client does not inherit credential chain

from azure.identity import AzureCliCredential, ChainedTokenCredential, ManagedIdentityCredential
from azure.identity.aio import DefaultAzureCredential
from azure.keyvault.secrets.aio import SecretClient
import os

from azure.storage.queue import (
        QueueClient,
        QueueServiceClient,
        BinaryBase64EncodePolicy,
        BinaryBase64DecodePolicy
)

managed_identity = ManagedIdentityCredential()
azure_cli = AzureCliCredential()
credential_chain = ChainedTokenCredential(managed_identity, azure_cli)
# client = SecretClient("https://my-vault.vault.azure.net", credential_chain)

q_name="test-q"
print("Creating queue: " + q_name)

queue_service = QueueServiceClient("https://XXXXXX.queue.core.windows.net", credential=credential_chain)

# Create the queue
queue_client = queue_service.get_queue_client(q_name)

queue_client.send_message('foo bar')

Have you found a mitigation/solution?

Call Queue client after get_queue_client

queue_service = QueueServiceClient("https://tozara.queue.core.windows.net", credential=credential_chain)

# Create the queue
queue_client = queue_service.get_queue_client(q_name)

queue_client = QueueClient("https://xxxxxx.queue.core.windows.net", queue_name = q_name, credential=credential_chain)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant