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

How to unset static-website property when invoking az storage blob service-properties update #28554

Closed
nulltoken opened this issue Mar 13, 2024 · 11 comments · Fixed by #30510
Closed
Assignees
Labels
AAD Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage az storage
Milestone

Comments

@nulltoken
Copy link

Describe the bug

It might be doco issue or a bug at the az cli level.

When trying to invoke az storage blob service-properties update --account-name my_name --static-website false, this fails with the following error message

ERROR: XML specified is not syntactically valid.
RequestId:8c2c471e-f01e-0019-1836-75bb58000000
Time:2024-03-13T11:07:58.8271647Z
ErrorCode:InvalidXmlDocument
linenumber:2
lineposition:683
reason:Element IndexDocument is only expected when StaticWebsite/Enabled is enabled.

Related command

az storage blob service-properties update

Errors

ERROR: XML specified is not syntactically valid.
RequestId:8c2c471e-f01e-0019-1836-75bb58000000
Time:2024-03-13T11:07:58.8271647Z
ErrorCode:InvalidXmlDocument
linenumber:2
lineposition:683
reason:Element IndexDocument is only expected when StaticWebsite/Enabled is enabled.

Issue script & Debug output

2024-03-13T11:37:29.3963401Z Updating storage properties
2024-03-13T11:37:29.6074589Z DEBUG: cli.knack.cli: Command arguments: ['storage', 'blob', 'service-properties', 'update', '--account-name', 'my_storagename', '--static-website', 'false', '--debug']
2024-03-13T11:37:29.6075309Z DEBUG: cli.knack.cli: __init__ debug log:
2024-03-13T11:37:29.6076029Z Cannot enable color.
2024-03-13T11:37:29.6076334Z DEBUG: cli.knack.cli: Event: Cli.PreExecute []
2024-03-13T11:37:29.6076887Z DEBUG: cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f295fbb40e0>, <function OutputProducer.on_global_arguments at 0x7f295fb5e200>, <function CLIQuery.on_global_arguments at 0x7f295fb93ce0>]
2024-03-13T11:37:29.6085971Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
2024-03-13T11:37:29.6094879Z DEBUG: cli.azure.cli.core: Modules found from index for 'storage': ['azure.cli.command_modules.storage']
2024-03-13T11:37:29.6095356Z DEBUG: cli.azure.cli.core: Loading command modules:
2024-03-13T11:37:29.6095773Z DEBUG: cli.azure.cli.core: Name                  Load Time    Groups  Commands
2024-03-13T11:37:29.7671067Z DEBUG: cli.azure.cli.core: storage                   0.157        59       273
2024-03-13T11:37:29.7671621Z DEBUG: cli.azure.cli.core: Total (1)                 0.157        59       273
2024-03-13T11:37:29.7678620Z DEBUG: cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
2024-03-13T11:37:29.7679089Z DEBUG: cli.azure.cli.core: Loading extensions:
2024-03-13T11:37:29.7679626Z DEBUG: cli.azure.cli.core: Name                  Load Time    Groups  Commands  Directory
2024-03-13T11:37:29.7680749Z DEBUG: cli.azure.cli.core: Total (0)                 0.000         0         0  
2024-03-13T11:37:29.7681104Z DEBUG: cli.azure.cli.core: Loaded 59 groups, 273 commands.
2024-03-13T11:37:29.7681415Z DEBUG: cli.azure.cli.core: Found a match in the command table.
2024-03-13T11:37:29.7681877Z DEBUG: cli.azure.cli.core: Raw command  : storage blob service-properties update
2024-03-13T11:37:29.7682927Z DEBUG: cli.azure.cli.core: Command table: storage blob service-properties update
2024-03-13T11:37:29.7683429Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f295ea6d940>]
2024-03-13T11:37:29.7683930Z DEBUG: cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/vsts/work/_temp/.azclitask/commands/2024-03-13.11-37-29.storage_blob_service-properties_update.1622.log'.
2024-03-13T11:37:29.7687676Z INFO: az_command_data_logger: command args: storage blob service-properties update --account-name {} --static-website {} --debug
2024-03-13T11:37:29.7688182Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x7f295ea7bec0>]
2024-03-13T11:37:30.0792396Z DEBUG: cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
2024-03-13T11:37:30.0793162Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/core/profiles/_shared.py", line 659, in _get_attr
2024-03-13T11:37:30.0793457Z     op = getattr(op, part)
2024-03-13T11:37:30.0793630Z          ^^^^^^^^^^^^^^^^^
2024-03-13T11:37:30.0793959Z AttributeError: module 'azure.mgmt.storage.v2023_01_01.models' has no attribute 'ActiveDirectoryPropertiesAccountType'
2024-03-13T11:37:30.0794147Z 
2024-03-13T11:37:30.0823214Z DEBUG: cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
2024-03-13T11:37:30.0823676Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/core/profiles/_shared.py", line 659, in _get_attr
2024-03-13T11:37:30.0824027Z     op = getattr(op, part)
2024-03-13T11:37:30.0826064Z          ^^^^^^^^^^^^^^^^^
2024-03-13T11:37:30.0826576Z AttributeError: module 'azure.mgmt.storage.v2023_01_01.models' has no attribute 'ListKeyExpand'
2024-03-13T11:37:30.0826861Z 
2024-03-13T11:37:30.0912984Z DEBUG: cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
2024-03-13T11:37:30.0913892Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/core/profiles/_shared.py", line 659, in _get_attr
2024-03-13T11:37:30.0914205Z     op = getattr(op, part)
2024-03-13T11:37:30.0914334Z          ^^^^^^^^^^^^^^^^^
2024-03-13T11:37:30.0914605Z AttributeError: module 'azure.mgmt.storage.v2023_01_01.models' has no attribute 'CorsRuleAllowedMethodsItem'
2024-03-13T11:37:30.0914723Z 
2024-03-13T11:37:30.1760874Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
2024-03-13T11:37:30.1761566Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x7f295ead5c60>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x7f295ead5da0>]
2024-03-13T11:37:30.1781927Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
2024-03-13T11:37:30.1782339Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
2024-03-13T11:37:30.1788941Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f295fb5e2a0>, <function CLIQuery.handle_query_parameter at 0x7f295fb93d80>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x7f295ead5d00>]
2024-03-13T11:37:30.1791111Z INFO: cli.azure.cli.command_modules.storage._validators: Try to get storage auth_mode value from environment variables or config file.
2024-03-13T11:37:30.1792493Z INFO: cli.azure.cli.command_modules.storage._validators: Try to get storage connection_string value from environment variables or config file.
2024-03-13T11:37:30.1792991Z INFO: cli.azure.cli.command_modules.storage._validators: Try to get storage key value from environment variables or config file.
2024-03-13T11:37:30.1793643Z INFO: cli.azure.cli.command_modules.storage._validators: Try to get storage sas_token value from environment variables or config file.
2024-03-13T11:37:30.1797782Z WARNING: cli.azure.cli.command_modules.storage._validators: 
2024-03-13T11:37:30.1798174Z There are no credentials provided in your command and environment, we will query for account key for your storage account.
2024-03-13T11:37:30.1799136Z It is recommended to provide --connection-string, --account-key or --sas-token in your command as credentials.
2024-03-13T11:37:30.1799399Z 
2024-03-13T11:37:30.1799991Z You also can add `--auth-mode login` in your command to use Azure Active Directory (Azure AD) for authorization if your login account is assigned required RBAC roles.
2024-03-13T11:37:30.1800393Z For more information about RBAC roles in storage, visit https://docs.microsoft.com/azure/storage/common/storage-auth-aad-rbac-cli.
2024-03-13T11:37:30.1800531Z 
2024-03-13T11:37:30.1800883Z In addition, setting the corresponding environment variables can avoid inputting credentials in your command. Please use --help to get more information about environment variable usage.
2024-03-13T11:37:30.1801412Z DEBUG: cli.azure.cli.core.commands.client_factory: Getting management service client client_type=StorageManagementClient
2024-03-13T11:37:30.1897892Z DEBUG: cli.azure.cli.core.auth.persistence: build_persistence: location='/home/vsts/work/_temp/.azclitask/service_principal_entries.json', encrypt=False
2024-03-13T11:37:30.1900760Z DEBUG: cli.azure.cli.core.auth.persistence: build_persistence: location='/home/vsts/work/_temp/.azclitask/msal_token_cache.json', encrypt=False
2024-03-13T11:37:30.1907363Z DEBUG: cli.azure.cli.core.auth.binary_cache: load: /home/vsts/work/_temp/.azclitask/msal_http_cache.bin
2024-03-13T11:37:30.1930666Z DEBUG: urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
2024-03-13T11:37:30.1933809Z DEBUG: msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/f5ff14e7-93c8-49f7-9706-7beea059bd32/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/f5ff14e7-93c8-49f7-9706-7beea059bd32/discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': 'https://login.microsoftonline.com/f5ff14e7-93c8-49f7-9706-7beea059bd32/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/f5ff14e7-93c8-49f7-9706-7beea059bd32/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/f5ff14e7-93c8-49f7-9706-7beea059bd32/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/f5ff14e7-93c8-49f7-9706-7beea059bd32/oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com/f5ff14e7-93c8-49f7-9706-7beea059bd32/kerberos', 'tenant_region_scope': 'EU', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'}
2024-03-13T11:37:30.1935565Z DEBUG: msal.application: Broker enabled? None
2024-03-13T11:37:30.1963205Z DEBUG: cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
2024-03-13T11:37:30.1963912Z DEBUG: cli.azure.cli.core.auth.msal_authentication: ServicePrincipalCredential.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
2024-03-13T11:37:30.1965115Z DEBUG: msal.application: Cache hit an AT
2024-03-13T11:37:30.1966703Z DEBUG: msal.telemetry: Generate or reuse correlation_id: 6fdfa646-4c64-49b7-871a-123f45ad0e32
2024-03-13T11:37:30.1970500Z DEBUG: cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/a346013a-REDACTED/providers/Microsoft.Storage/storageAccounts?api-version=2023-01-01'
2024-03-13T11:37:30.1971035Z DEBUG: cli.azure.cli.core.sdk.policies: Request method: 'GET'
2024-03-13T11:37:30.1971595Z DEBUG: cli.azure.cli.core.sdk.policies: Request headers:
2024-03-13T11:37:30.1972012Z DEBUG: cli.azure.cli.core.sdk.policies:     'Accept': 'application/json'
2024-03-13T11:37:30.1972395Z DEBUG: cli.azure.cli.core.sdk.policies:     'x-ms-client-request-id': '12cd95b3-e12e-11ee-825d-3bcbe9ce7a41'
2024-03-13T11:37:30.1972939Z DEBUG: cli.azure.cli.core.sdk.policies:     'CommandName': 'storage blob service-properties update'
2024-03-13T11:37:30.1973654Z DEBUG: cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--account-name --static-website --debug'
2024-03-13T11:37:30.1974202Z DEBUG: cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.57.0 (DEB) azsdk-python-azure-mgmt-storage/21.1.0 Python/3.11.7 (Linux-6.5.0-1015-azure-x86_64-with-glibc2.35) VSTS_d2978f71-455e-4127-b7c5-18a884f6af20_build_6123_0'
2024-03-13T11:37:30.1974586Z DEBUG: cli.azure.cli.core.sdk.policies:     'Authorization': '*****'
2024-03-13T11:37:30.1974778Z DEBUG: cli.azure.cli.core.sdk.policies: Request body:
2024-03-13T11:37:30.1974962Z DEBUG: cli.azure.cli.core.sdk.policies: This request has no body
2024-03-13T11:37:30.2000293Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
2024-03-13T11:37:32.1825590Z DEBUG: urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/a346013a-REDACTED/providers/Microsoft.Storage/storageAccounts?api-version=2023-01-01 HTTP/1.1" 200 3444
2024-03-13T11:37:32.1831817Z DEBUG: cli.azure.cli.core.sdk.policies: Response status: 200
2024-03-13T11:37:32.1832256Z DEBUG: cli.azure.cli.core.sdk.policies: Response headers:
2024-03-13T11:37:32.1833786Z DEBUG: cli.azure.cli.core.sdk.policies:     'Cache-Control': 'no-cache'
2024-03-13T11:37:32.1834184Z DEBUG: cli.azure.cli.core.sdk.policies:     'Pragma': 'no-cache'
2024-03-13T11:37:32.1834643Z DEBUG: cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json; charset=utf-8'
2024-03-13T11:37:32.1835208Z DEBUG: cli.azure.cli.core.sdk.policies:     'Expires': '-1'
2024-03-13T11:37:32.1838496Z DEBUG: cli.azure.cli.core.sdk.policies:     'x-ms-request-id': '4970e46d-25da-4c4a-acd4-dbe4a98e40e7'
2024-03-13T11:37:32.1839013Z DEBUG: cli.azure.cli.core.sdk.policies:     'x-ms-correlation-request-id': '4970e46d-25da-4c4a-acd4-dbe4a98e40e7'
2024-03-13T11:37:32.1839615Z DEBUG: cli.azure.cli.core.sdk.policies:     'x-ms-routing-request-id': 'WESTEUROPE:20240313T113732Z:4970e46d-25da-4c4a-acd4-dbe4a98e40e7'
2024-03-13T11:37:32.1840133Z DEBUG: cli.azure.cli.core.sdk.policies:     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
2024-03-13T11:37:32.1894115Z DEBUG: cli.azure.cli.core.sdk.policies:     'X-Content-Type-Options': 'nosniff'
2024-03-13T11:37:32.1894469Z DEBUG: cli.azure.cli.core.sdk.policies:     'Date': 'Wed, 13 Mar 2024 11:37:31 GMT'
2024-03-13T11:37:32.1894753Z DEBUG: cli.azure.cli.core.sdk.policies:     'Content-Length': '3444'
2024-03-13T11:37:32.1894935Z DEBUG: cli.azure.cli.core.sdk.policies: Response content:
2024-03-13T11:37:32.1905054Z DEBUG: cli.azure.cli.core.sdk.policies: {REDACTED}
2024-03-13T11:37:32.1908241Z DEBUG: cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
2024-03-13T11:37:32.1908584Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/core/profiles/_shared.py", line 655, in _get_attr
2024-03-13T11:37:32.1908785Z     op = import_module(full_mod_path)
2024-03-13T11:37:32.1908907Z          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-03-13T11:37:32.1909071Z   File "/opt/az/lib/python3.11/importlib/__init__.py", line 126, in import_module
2024-03-13T11:37:32.1909257Z     return _bootstrap._gcd_import(name[level:], package, level)
2024-03-13T11:37:32.1909408Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-03-13T11:37:32.1909551Z   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
2024-03-13T11:37:32.1909783Z   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
2024-03-13T11:37:32.1909972Z   File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
2024-03-13T11:37:32.1910284Z ModuleNotFoundError: No module named 'azure.mgmt.storage.v2023_01_01.models.storage_account_keys'
2024-03-13T11:37:32.1910394Z 
2024-03-13T11:37:32.1910584Z DEBUG: cli.azure.cli.command_modules.storage._validators: Disable HTTP logging to avoid having storage keys in debug logs
2024-03-13T11:37:32.2951272Z DEBUG: urllib3.connectionpool: https://management.azure.com:443 "POST /subscriptions/a346013a-REDACTED/resourceGroups/my_resourcegroup/providers/Microsoft.Storage/storageAccounts/my_storagename/listKeys?api-version=2023-01-01&$expand=kerb HTTP/1.1" 200 288
2024-03-13T11:37:32.2996168Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): my_storagename.blob.core.windows.net:443
2024-03-13T11:37:32.3863913Z DEBUG: urllib3.connectionpool: https://my_storagename.blob.core.windows.net:443 "GET /?restype=service&comp=properties HTTP/1.1" 200 None
2024-03-13T11:37:32.3910057Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): my_storagename.blob.core.windows.net:443
2024-03-13T11:37:32.4787165Z DEBUG: urllib3.connectionpool: https://my_storagename.blob.core.windows.net:443 "PUT /?restype=service&comp=properties HTTP/1.1" 400 380
2024-03-13T11:37:32.5663841Z DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last):
2024-03-13T11:37:32.5664880Z   File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
2024-03-13T11:37:32.5665113Z     cmd_result = self.invocation.execute(args)
2024-03-13T11:37:32.5665277Z                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-03-13T11:37:32.5665543Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 664, in execute
2024-03-13T11:37:32.5665712Z     raise ex
2024-03-13T11:37:32.5665992Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 729, in _run_jobs_serially
2024-03-13T11:37:32.5666199Z     results.append(self._run_job(expanded_arg, cmd_copy))
2024-03-13T11:37:32.5666363Z                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-03-13T11:37:32.5666618Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 721, in _run_job
2024-03-13T11:37:32.5666814Z     return cmd_copy.exception_handler(ex)
2024-03-13T11:37:32.5666937Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-03-13T11:37:32.5667320Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/storage/__init__.py", line 430, in new_handler
2024-03-13T11:37:32.5667501Z     first(ex)
2024-03-13T11:37:32.5667785Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/storage/__init__.py", line 429, in new_handler
2024-03-13T11:37:32.5667965Z     raise ex
2024-03-13T11:37:32.5668276Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 698, in _run_job
2024-03-13T11:37:32.5668460Z     result = cmd_copy(params)
2024-03-13T11:37:32.5668574Z              ^^^^^^^^^^^^^^^^
2024-03-13T11:37:32.5668838Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 334, in __call__
2024-03-13T11:37:32.5669018Z     return self.handler(*args, **kwargs)
2024-03-13T11:37:32.5669148Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-03-13T11:37:32.5669407Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 240, in handler
2024-03-13T11:37:32.5669621Z     result = cached_put(self.cmd, setter, **setterargs)
2024-03-13T11:37:32.5669767Z              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-03-13T11:37:32.5670025Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 453, in cached_put
2024-03-13T11:37:32.5670207Z     return _put_operation()
2024-03-13T11:37:32.5670317Z            ^^^^^^^^^^^^^^^^
2024-03-13T11:37:32.5670664Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 447, in _put_operation
2024-03-13T11:37:32.5670845Z     result = operation(**kwargs)
2024-03-13T11:37:32.5670974Z              ^^^^^^^^^^^^^^^^^^^
2024-03-13T11:37:32.5671282Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/storage/operations/blob.py", line 357, in set_service_properties_track2
2024-03-13T11:37:32.5671506Z     client.set_service_properties(**kwargs)
2024-03-13T11:37:32.5671785Z   File "/opt/az/lib/python3.11/site-packages/azure/core/tracing/decorator.py", line 76, in wrapper_use_tracer
2024-03-13T11:37:32.5672203Z     return func(*args, **kwargs)
2024-03-13T11:37:32.5672315Z            ^^^^^^^^^^^^^^^^^^^^^
2024-03-13T11:37:32.5672636Z   File "/opt/az/lib/python3.11/site-packages/azure/multiapi/storagev2/blob/v2022_11_02/_blob_service_client.py", line 402, in set_service_properties
2024-03-13T11:37:32.5672848Z     process_storage_error(error)
2024-03-13T11:37:32.5673180Z   File "/opt/az/lib/python3.11/site-packages/azure/multiapi/storagev2/blob/v2022_11_02/_shared/response_handlers.py", line 189, in process_storage_error
2024-03-13T11:37:32.5673571Z     exec("raise error from None")   # pylint: disable=exec-used # nosec
2024-03-13T11:37:32.5673710Z     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-03-13T11:37:32.5673839Z   File "<string>", line 1, in <module>
2024-03-13T11:37:32.5674012Z azure.core.exceptions.HttpResponseError: XML specified is not syntactically valid.
2024-03-13T11:37:32.5674289Z RequestId:afa41755-001e-007f-493a-75f478000000
2024-03-13T11:37:32.5674505Z Time:2024-03-13T11:37:32.4768367Z
2024-03-13T11:37:32.5674665Z ErrorCode:InvalidXmlDocument
2024-03-13T11:37:32.5674792Z linenumber:2
2024-03-13T11:37:32.5674931Z lineposition:683
2024-03-13T11:37:32.5675102Z reason:Element IndexDocument is only expected when StaticWebsite/Enabled is enabled.
2024-03-13T11:37:32.5675533Z Content: <?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidXmlDocument</Code><Message>XML specified is not syntactically valid.
2024-03-13T11:37:32.5675823Z RequestId:afa41755-001e-007f-493a-75f478000000
2024-03-13T11:37:32.5676246Z Time:2024-03-13T11:37:32.4768367Z</Message><LineNumber>2</LineNumber><LinePosition>683</LinePosition><Reason>Element IndexDocument is only expected when StaticWebsite/Enabled is enabled.</Reason></Error>
2024-03-13T11:37:32.5676424Z 
2024-03-13T11:37:32.5752036Z ERROR: cli.azure.cli.core.azclierror: XML specified is not syntactically valid.
2024-03-13T11:37:32.5752754Z RequestId:afa41755-001e-007f-493a-75f478000000
2024-03-13T11:37:32.5753083Z Time:2024-03-13T11:37:32.4768367Z
2024-03-13T11:37:32.5753331Z ErrorCode:InvalidXmlDocument
2024-03-13T11:37:32.5753537Z linenumber:2
2024-03-13T11:37:32.5753750Z lineposition:683
2024-03-13T11:37:32.5754010Z reason:Element IndexDocument is only expected when StaticWebsite/Enabled is enabled.
2024-03-13T11:37:32.5754356Z ERROR: az_command_data_logger: XML specified is not syntactically valid.
2024-03-13T11:37:32.5754689Z RequestId:afa41755-001e-007f-493a-75f478000000
2024-03-13T11:37:32.5754980Z Time:2024-03-13T11:37:32.4768367Z
2024-03-13T11:37:32.5755214Z ErrorCode:InvalidXmlDocument
2024-03-13T11:37:32.5755426Z linenumber:2
2024-03-13T11:37:32.5755633Z lineposition:683
2024-03-13T11:37:32.5755887Z reason:Element IndexDocument is only expected when StaticWebsite/Enabled is enabled.
2024-03-13T11:37:32.5756200Z DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f295ea6dbc0>]
2024-03-13T11:37:32.5756496Z INFO: az_command_data_logger: exit code: 1
2024-03-13T11:37:32.5757418Z INFO: cli.__main__: Command ran in 3.149 seconds (init: 0.180, invoke: 2.969)
2024-03-13T11:37:32.6443416Z INFO: cli.azure.cli.core.decorators: Suppress exception:
2024-03-13T11:37:32.6444004Z Traceback (most recent call last):
2024-03-13T11:37:32.6444550Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/__main__.py", line 62, in <module>
2024-03-13T11:37:32.6444792Z     raise ex
2024-03-13T11:37:32.6445127Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/__main__.py", line 55, in <module>
2024-03-13T11:37:32.6445383Z     sys.exit(exit_code)
2024-03-13T11:37:32.6445599Z SystemExit: 1
2024-03-13T11:37:32.6446861Z 
2024-03-13T11:37:32.6447153Z During handling of the above exception, another exception occurred:
2024-03-13T11:37:32.6447326Z 
2024-03-13T11:37:32.6447523Z Traceback (most recent call last):
2024-03-13T11:37:32.6447911Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/core/decorators.py", line 79, in _wrapped_func
2024-03-13T11:37:32.6448462Z     return func(*args, **kwargs)
2024-03-13T11:37:32.6448662Z            ^^^^^^^^^^^^^^^^^^^^^
2024-03-13T11:37:32.6449031Z   File "/opt/az/lib/python3.11/site-packages/azure/cli/core/telemetry.py", line 532, in _get_secrets_warning_config
2024-03-13T11:37:32.6449439Z     show_secrets_warning = _get_config().getboolean('clients', 'show_secrets_warning', fallback=None)
2024-03-13T11:37:32.6449711Z                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-03-13T11:37:32.6450053Z   File "/opt/az/lib/python3.11/site-packages/knack/config.py", line 147, in getboolean
2024-03-13T11:37:32.6450481Z     raise ValueError('Not a boolean: {}'.format(val))
2024-03-13T11:37:32.6450723Z ValueError: Not a boolean: None
2024-03-13T11:37:32.6450866Z 
2024-03-13T11:37:32.6527766Z INFO: telemetry.main: Begin splitting cli events and extra events, total events: 1
2024-03-13T11:37:32.6528209Z INFO: telemetry.client: Accumulated 0 events. Flush the clients.
2024-03-13T11:37:32.6528512Z INFO: telemetry.main: Finish splitting cli events and extra events, cli events: 1
2024-03-13T11:37:32.6531165Z INFO: telemetry.save: Save telemetry record of length 3755 in cache
2024-03-13T11:37:32.6531445Z INFO: telemetry.main: Begin creating telemetry upload process.
2024-03-13T11:37:32.6532004Z INFO: telemetry.process: Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.11/site-packages/azure/cli/telemetry/__init__.py /home/vsts/work/_temp/.azclitask"
2024-03-13T11:37:32.6536250Z INFO: telemetry.process: Return from creating process
2024-03-13T11:37:32.6536554Z INFO: telemetry.main: Finish creating telemetry upload process.
2024-03-13T11:37:32.9974371Z �[31;1m�[31;1mError while updating storage properties�[0m
2024-03-13T11:37:32.9975288Z �[31;1m�[31;1mAt /home/vsts/work/_temp/azureclitaskscript1710329842600_inlinescript.ps1:8 char:3�[0m
2024-03-13T11:37:32.9978750Z �[31;1m�[31;1m+   throw "Error while updating storage properties"�[0m
2024-03-13T11:37:32.9979288Z �[31;1m�[31;1m+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~�[0m
2024-03-13T11:37:32.9979824Z �[31;1m�[31;1m+ CategoryInfo          : OperationStopped: (Error while updating storage properties:String) [], RuntimeException�[0m
2024-03-13T11:37:32.9980381Z �[31;1m�[31;1m+ FullyQualifiedErrorId : Error while updating storage properties�[0m

Expected behavior

No error and the property unset

Environment Summary

2024-03-13T11:37:23.9284685Z azure-cli 2.57.0 *
2024-03-13T11:37:23.9285088Z
2024-03-13T11:37:23.9285333Z core 2.57.0 *
2024-03-13T11:37:23.9285568Z telemetry 1.1.0
2024-03-13T11:37:23.9285717Z
2024-03-13T11:37:23.9285921Z Extensions:
2024-03-13T11:37:23.9286199Z azure-devops 1.0.0
2024-03-13T11:37:23.9286351Z
2024-03-13T11:37:23.9286573Z Dependencies:
2024-03-13T11:37:23.9286802Z msal 1.26.0
2024-03-13T11:37:23.9287081Z azure-mgmt-resource 23.1.0b2

Additional context

No response

@nulltoken nulltoken added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Mar 13, 2024
Copy link

Hi @nulltoken,

2.57.0 is not the latest Azure CLI(2.58.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

@azure-client-tools-bot-prd azure-client-tools-bot-prd bot added the Auto-Resolve Auto resolve by bot label Mar 13, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage az storage labels Mar 13, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Mar 13, 2024

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that AAD labels Mar 13, 2024
@yonzhan yonzhan added this to the Backlog milestone Mar 13, 2024
@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Mar 13, 2024
@calvinhzy
Copy link
Member

Hi @nulltoken , it seems your settings might be conflicting
image
Can you run az storage blob service-properties show and see there is an existing statisWebsite.indexDocument now and staticWebsite.enabled is true
image

@nulltoken
Copy link
Author

nulltoken commented Mar 14, 2024

@calvinhzy Hey! Thanks for getting back to me

$ az storage blob service-properties show --account-name my_storagename

{
  "cors": [],
  "deleteRetentionPolicy": {
    "allowPermanentDelete": null,
    "days": 40,
    "enabled": true
  },
  "hourMetrics": {
    "enabled": false,
    "includeApis": null,
    "retentionPolicy": {
      "allowPermanentDelete": null,
      "days": null,
      "enabled": false
    },
    "version": "1.0"
  },
  "logging": {
    "delete": false,
    "read": false,
    "retentionPolicy": {
      "allowPermanentDelete": null,
      "days": null,
      "enabled": false
    },
    "version": "1.0",
    "write": false
  },
  "minuteMetrics": {
    "enabled": false,
    "includeApis": null,
    "retentionPolicy": {
      "allowPermanentDelete": null,
      "days": null,
      "enabled": false
    },
    "version": "1.0"
  },
  "staticWebsite": {
    "defaultIndexDocumentPath": null,
    "enabled": true,
    "errorDocument_404Path": "404.html",
    "indexDocument": "index.html"
  },
  "target_version": null
}

As you can see, everything is set.

And, as the issue title states, I want to turn off that static website capability. What should be the command to run?

The doco indicates

image

When running, az storage blob service-properties update account-name my_storagename --static-website false, I would expect it to switch it off, and not complain about a malformed XML document issue.

@nulltoken
Copy link
Author

@calvinhzy 👋 Any news?

@nulltoken
Copy link
Author

@calvinhzy 👋 Have you got the chance the dig deeper into this one?

Although this issue been labeled as a question, this may rather look like a bug to me. Thoughts?

@nulltoken
Copy link
Author

@calvinhzy Hey! I understand this may not be seen as a major blocking issue to most, however a little feedback would be greatly appreciated 😉

@nulltoken
Copy link
Author

@yonzhan Would there be any way to get any feedback on this?

@c-ryan-k
Copy link
Member

@nulltoken I just ran into this myself - you'll need to use a different argument to unset (set to null) the indexDocument property before disabling the static website:

az storage blob service-properties update --account-name my_name --remove staticWebsite.indexDocument

And then you should see the indexDocument property as null in the response, so you can follow up with:

az storage blob service-properties update --account-name my_name --static-website false

@calvinhzy
Copy link
Member

@nulltoken So sorry about the late response, will look into making --static-website false auto delete the indexDocument as well as it make sense this way, thanks.

@nulltoken
Copy link
Author

nulltoken commented Jun 18, 2024

@nulltoken So sorry about the late response, will look into making --static-website false auto delete the indexDocument as well as it make sense this way, thanks.

@calvinhzy Thanks for that. I haven't tested this yet, but maybe the errorDocument404Path should also be unset as well for this to completely work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AAD Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage az storage
Projects
None yet
6 participants