Not able to create Blob Storage Container
When am trying to create a container in Storage Account using the az storage container create command, am facing the following error
"stderr": "WARNING: Command group 'az storage' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus", "stderr_lines": ["WARNING: Command group 'az storage' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus"], "stdout": "{\n \"created\": false\n}", "stdout_lines": ["{", " \"created\": false", "}"]}
I have went through the documentation and was not able to find an alternative command to it.
Related command
az storage container create --name "{{ terraform_container_name }}" --public-access blob --account-name "{{ sa_name }}" --account-key {{ storage_account_key }}
Errors
"stderr": "WARNING: Command group 'az storage' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus", "stderr_lines": ["WARNING: Command group 'az storage' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus"], "stdout": "{\n "created": false\n}", "stdout_lines": ["{", " "created": false", "}"]}
Issue script & Debug output
cli.knack.cli: Command arguments: ['storage', 'container', 'create', '--name', '{{ blob_name}} ', '--public-access', 'blob', '--account-name', '{{ sa_name }}', '--account-key', '{{ storage_account_key }}', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x1030ed260>, <function OutputProducer.on_global_arguments at 0x10319c400>, <function CLIQuery.on_global_arguments at 0x1031c9ee0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'storage': ['azext_storage_preview', 'azure.cli.command_modules.storage']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: storage 0.113 59 273
cli.azure.cli.core: Total (1) 0.113 59 273
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.knack.cli: Event: CommandLoader.OnLoadCommandTable []
cli.azure.cli.core: storage-preview 0.010 16 52 /Users/strange2x/.azure/cliextensions/storage-preview
cli.azure.cli.core: Total (1) 0.010 16 52
cli.azure.cli.core: Loaded 65 groups, 295 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : storage container create
cli.azure.cli.core: Command table: storage container create
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x103eeab60>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/strange2x/.azure/commands/2024-03-30.08-55-34.storage_container_create.11648.log'.
az_command_data_logger: command args: storage container create --name {} --public-access {} --account-name {} --account-key {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x103f19620>]
cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.58.0/libexec/lib/python3.11/site-packages/azure/cli/core/profiles/_shared.py", line 660, in _get_attr
op = getattr(op, part)
^^^^^^^^^^^^^^^^^
AttributeError: module 'azure.mgmt.storage.v2023_01_01.models' has no attribute 'ActiveDirectoryPropertiesAccountType'
cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.58.0/libexec/lib/python3.11/site-packages/azure/cli/core/profiles/_shared.py", line 660, in _get_attr
op = getattr(op, part)
^^^^^^^^^^^^^^^^^
AttributeError: module 'azure.mgmt.storage.v2023_01_01.models' has no attribute 'ListKeyExpand'
cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.58.0/libexec/lib/python3.11/site-packages/azure/cli/core/profiles/_shared.py", line 660, in _get_attr
op = getattr(op, part)
^^^^^^^^^^^^^^^^^
AttributeError: module 'azure.mgmt.storage.v2023_01_01.models' has no attribute 'CorsRuleAllowedMethodsItem'
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x103f3f880>, <function register_cache_arguments..add_cache_arguments at 0x103f3f9c0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x10319c4a0>, <function CLIQuery.handle_query_parameter at 0x1031c9f80>, <function register_ids_argument..parse_ids_arguments at 0x103f3f920>]
Command group 'az storage' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
cli.azure.cli.command_modules.storage._validators: Try to get storage auth_mode value from environment variables or config file.
cli.azure.cli.command_modules.storage._validators: Try to get storage sas_token value from environment variables or config file.
urllib3.connectionpool: Starting new HTTPS connection (1): {{sa_name}}.blob.core.windows.net:443
urllib3.connectionpool: https://akstestinfrasa.blob.core.windows.net:443 "PUT /{{sa_name}}?restype=container HTTP/1.1" 409 248
cli.knack.cli: Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x103f3c900>, <function _x509_from_base64_to_hex_transform at 0x103f3c9a0>]
cli.knack.cli: Event: CommandInvoker.OnFilterResult []
{
"created": false
}
cli.knack.cli: Event: Cli.SuccessfulExecute []
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x103eeade0>]
az_command_data_logger: exit code: 0
cli.main: Command ran in 0.761 seconds (init: 0.109, invoke: 0.652)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 3679 in cache
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/homebrew/Cellar/azure-cli/2.58.0/libexec/bin/python /opt/homebrew/Cellar/azure-cli/2.58.0/libexec/lib/python3.11/site-packages/azure/cli/telemetry/init.py /Users/strange2x/.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.
Expected behavior
Create a blob container in the provided storage account when running the command
Environment Summary
azure-cli 2.58.0
core 2.58.0
telemetry 1.1.0
Extensions:
storage-preview 1.0.0b1
Dependencies:
msal 1.26.0
azure-mgmt-resource 23.1.0b2
Python location '/opt/homebrew/Cellar/azure-cli/2.58.0/libexec/bin/python'
Extensions directory '/Users/strange2x/.azure/cliextensions'
Python (Darwin) 3.11.8 (main, Feb 6 2024, 21:21:21) [Clang 15.0.0 (clang-1500.1.0.2.5)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
Trying to automate create a resource group, setting up a storage account and then storage blob container which needs to be used for openTofu for state storage
Not able to create Blob Storage Container
When am trying to create a container in Storage Account using the az storage container create command, am facing the following error
I have went through the documentation and was not able to find an alternative command to it.
Related command
Errors
"stderr": "WARNING: Command group 'az storage' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus", "stderr_lines": ["WARNING: Command group 'az storage' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus"], "stdout": "{\n "created": false\n}", "stdout_lines": ["{", " "created": false", "}"]}
Issue script & Debug output
cli.knack.cli: Command arguments: ['storage', 'container', 'create', '--name', '{{ blob_name}} ', '--public-access', 'blob', '--account-name', '{{ sa_name }}', '--account-key', '{{ storage_account_key }}', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x1030ed260>, <function OutputProducer.on_global_arguments at 0x10319c400>, <function CLIQuery.on_global_arguments at 0x1031c9ee0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'storage': ['azext_storage_preview', 'azure.cli.command_modules.storage']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: storage 0.113 59 273
cli.azure.cli.core: Total (1) 0.113 59 273
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.knack.cli: Event: CommandLoader.OnLoadCommandTable []
cli.azure.cli.core: storage-preview 0.010 16 52 /Users/strange2x/.azure/cliextensions/storage-preview
cli.azure.cli.core: Total (1) 0.010 16 52
cli.azure.cli.core: Loaded 65 groups, 295 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : storage container create
cli.azure.cli.core: Command table: storage container create
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x103eeab60>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/strange2x/.azure/commands/2024-03-30.08-55-34.storage_container_create.11648.log'.
az_command_data_logger: command args: storage container create --name {} --public-access {} --account-name {} --account-key {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x103f19620>]
cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.58.0/libexec/lib/python3.11/site-packages/azure/cli/core/profiles/_shared.py", line 660, in _get_attr
op = getattr(op, part)
^^^^^^^^^^^^^^^^^
AttributeError: module 'azure.mgmt.storage.v2023_01_01.models' has no attribute 'ActiveDirectoryPropertiesAccountType'
cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.58.0/libexec/lib/python3.11/site-packages/azure/cli/core/profiles/_shared.py", line 660, in _get_attr
op = getattr(op, part)
^^^^^^^^^^^^^^^^^
AttributeError: module 'azure.mgmt.storage.v2023_01_01.models' has no attribute 'ListKeyExpand'
cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.58.0/libexec/lib/python3.11/site-packages/azure/cli/core/profiles/_shared.py", line 660, in _get_attr
op = getattr(op, part)
^^^^^^^^^^^^^^^^^
AttributeError: module 'azure.mgmt.storage.v2023_01_01.models' has no attribute 'CorsRuleAllowedMethodsItem'
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x103f3f880>, <function register_cache_arguments..add_cache_arguments at 0x103f3f9c0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x10319c4a0>, <function CLIQuery.handle_query_parameter at 0x1031c9f80>, <function register_ids_argument..parse_ids_arguments at 0x103f3f920>]
Command group 'az storage' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
cli.azure.cli.command_modules.storage._validators: Try to get storage auth_mode value from environment variables or config file.
cli.azure.cli.command_modules.storage._validators: Try to get storage sas_token value from environment variables or config file.
urllib3.connectionpool: Starting new HTTPS connection (1): {{sa_name}}.blob.core.windows.net:443
urllib3.connectionpool: https://akstestinfrasa.blob.core.windows.net:443 "PUT /{{sa_name}}?restype=container HTTP/1.1" 409 248
cli.knack.cli: Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x103f3c900>, <function _x509_from_base64_to_hex_transform at 0x103f3c9a0>]
cli.knack.cli: Event: CommandInvoker.OnFilterResult []
{
"created": false
}
cli.knack.cli: Event: Cli.SuccessfulExecute []
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x103eeade0>]
az_command_data_logger: exit code: 0
cli.main: Command ran in 0.761 seconds (init: 0.109, invoke: 0.652)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 3679 in cache
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/homebrew/Cellar/azure-cli/2.58.0/libexec/bin/python /opt/homebrew/Cellar/azure-cli/2.58.0/libexec/lib/python3.11/site-packages/azure/cli/telemetry/init.py /Users/strange2x/.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.
Expected behavior
Create a blob container in the provided storage account when running the command
Environment Summary
azure-cli 2.58.0
core 2.58.0
telemetry 1.1.0
Extensions:
storage-preview 1.0.0b1
Dependencies:
msal 1.26.0
azure-mgmt-resource 23.1.0b2
Python location '/opt/homebrew/Cellar/azure-cli/2.58.0/libexec/bin/python'
Extensions directory '/Users/strange2x/.azure/cliextensions'
Python (Darwin) 3.11.8 (main, Feb 6 2024, 21:21:21) [Clang 15.0.0 (clang-1500.1.0.2.5)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
Trying to automate create a resource group, setting up a storage account and then storage blob container which needs to be used for openTofu for state storage