Skip to content

Unable to upload image to blob #24056

@zencharcoal

Description

@zencharcoal

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az storage blob upload

Errors:

The command failed with an unexpected error. Here is the traceback:
Unable to determine account name for shared key credential.
Traceback (most recent call last):
  File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_job
    return cmd_copy.exception_handler(ex)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/storage/__init__.py", line 411, in new_handler
    first(ex)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/storage/__init__.py", line 411, in new_handler
    first(ex)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/storage/_exception_handler.py", line 17, in file_related_exception_handler
    raise ex
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 112, in handler
    client = self.client_factory(self.cli_ctx, command_args) if self.client_factory else None
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/storage/_client_factory.py", line 252, in cf_blob_client
    return t_blob_client.from_blob_url(blob_url=kwargs.pop('blob_url'),
  File "/opt/az/lib/python3.10/site-packages/azure/multiapi/storagev2/blob/v2021_06_08/_blob_client.py", line 277, in from_blob_url
    return cls(
  File "/opt/az/lib/python3.10/site-packages/azure/multiapi/storagev2/blob/v2021_06_08/_blob_client.py", line 181, in __init__
    super(BlobClient, self).__init__(parsed_url, service='blob', credential=credential, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/azure/multiapi/storagev2/blob/v2021_06_08/_shared/base_client.py", line 89, in __init__
    self.credential = _format_shared_key_credential(self.account_name, credential)
  File "/opt/az/lib/python3.10/site-packages/azure/multiapi/storagev2/blob/v2021_06_08/_shared/base_client.py", line 351, in _format_shared_key_credential
    raise ValueError("Unable to determine account name for shared key credential.")
ValueError: Unable to determine account name for shared key credential.

To Reproduce:

New disk was already created and temporary write access was enabled

  • Put any pre-requisite steps here...
  • az storage blob upload --auth-mode {} --account-key {} -f {} --blob-url {}

Expected Behavior

Environment Summary

Linux-5.15.0-48-generic-x86_64-with-glibc2.31, Ubuntu 20.04.5 LTS
Python 3.10.5
Installer: DEB

azure-cli 2.40.0

Additional Context

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions