Azure / azure-cli

Azure Command-Line Interface
MIT License
3.99k stars 2.97k forks source link

'az tag' does not work in certain locations #27745

Closed usrme closed 9 months ago

usrme commented 11 months ago

Describe the bug

Overnight, az tag commands have started to fail in certain locations, such as West US 2 and Sweden Central.

Related command

az tag

Errors

$ az tag create --resource-id "<resource ID>" --tags some_tag=value
(InvalidResourceType) The resource type 'locations/diskoperations' could not be found in the 
namespace 'Microsoft.Compute' for api version '2022-09-01'. The supported api-versions are 
'2016-04-30-preview,2017-03-30,2018-04-01,2018-06-01,2018-09-30,2019-03-01,2019-07-01,
2019-11-01,2020-05-01,2020-06-30,2020-09-30,2020-12-01,2021-04-01,2021-08-01,2021-12-01,
2022-03-02,2022-07-02,2023-01-02,2023-04-02'.
Code: InvalidResourceType
Message: The resource type 'locations/diskoperations' could not be found in the namespace 
'Microsoft.Compute' for api version '2022-09-01'. The supported api-versions are 
'2016-04-30-preview,2017-03-30,2018-04-01,2018-06-01,2018-09-30,2019-03-01,2019-07-01,
2019-11-01,2020-05-01,2020-06-30,2020-09-30,2020-12-01,2021-04-01,2021-08-01,2021-12-01,
2022-03-02,2022-07-02,2023-01-02,2023-04-02'.

Issue script & Debug output

DEBUG: cli.knack.cli: Command arguments: ['tag', 'create', '--resource-id', '/subscriptions/<subscription ID>/resourceGroups/<resource group>/providers/Microsoft.Compute/snapshots/<snapshot name>', '--tags', 'in_deletion=yes', '--debug']
DEBUG: cli.knack.cli: __init__ debug log:
Cannot enable color.
DEBUG: cli.knack.cli: Event: Cli.PreExecute []
DEBUG: cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f0742186440>, <function OutputProducer.on_global_arguments at 0x7f074209dc60>, <function CLIQuery.on_global_arguments at 0x7f0741ecee60>]
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
DEBUG: cli.azure.cli.core: Modules found from index for 'tag': ['azure.cli.command_modules.resource']
DEBUG: cli.azure.cli.core: Loading command modules:
DEBUG: cli.azure.cli.core: Name                  Load Time    Groups  Commands
DEBUG: cli.azure.cli.core: resource                  0.104        51       227
DEBUG: cli.azure.cli.core: Total (1)                 0.104        51       227
DEBUG: cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
DEBUG: cli.azure.cli.core: Loading extensions:
DEBUG: cli.azure.cli.core: Name                  Load Time    Groups  Commands  Directory
DEBUG: cli.azure.cli.core: Total (0)                 0.000         0         0  
DEBUG: cli.azure.cli.core: Loaded 51 groups, 227 commands.
DEBUG: cli.azure.cli.core: Found a match in the command table.
DEBUG: cli.azure.cli.core: Raw command  : tag create
DEBUG: cli.azure.cli.core: Command table: tag create
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f0740f96290>]
DEBUG: cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/usrme/.azure/commands/2023-11-02.11-38-47.tag_create.38036.log'.
INFO: az_command_data_logger: command args: tag create --resource-id {} --tags {} --debug
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x7f0740fb2c20>]
DEBUG: cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
  File "project/.venv/lib/python3.10/site-packages/azure/cli/core/profiles/_shared.py", line 655, in _get_attr
    op = getattr(op, part)
AttributeError: module 'azure.mgmt.resource.resources.v2022_09_01.models' has no attribute 'ExemptionCategory'

DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x7f0740da0f70>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x7f0740da1090>]
DEBUG: cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f074209dcf0>, <function CLIQuery.handle_query_parameter at 0x7f0741eceef0>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x7f0740da1000>]
DEBUG: cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ResourceManagementClient
DEBUG: cli.azure.cli.core.auth.persistence: build_persistence: location='/home/usrme/.azure/msal_token_cache.json', encrypt=False
DEBUG: cli.azure.cli.core.auth.binary_cache: load: /home/usrme/.azure/msal_http_cache.bin
DEBUG: urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
DEBUG: msal.application: Broker enabled? False
DEBUG: cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
DEBUG: cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://management.core.windows.net//.default',), claims=None, kwargs={}
DEBUG: msal.application: Cache hit an AT
DEBUG: msal.telemetry: Generate or reuse correlation_id: 81a9e0b3-4901-4606-b323-589bd49e312f
DEBUG: cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/<subscription ID>/resourceGroups/<resource group>/providers/Microsoft.Compute/snapshots/<snapshot name>/providers/Microsoft.Resources/tags/default?api-version=2022-09-01'
DEBUG: cli.azure.cli.core.sdk.policies: Request method: 'PUT'
DEBUG: cli.azure.cli.core.sdk.policies: Request headers:
DEBUG: cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json'
DEBUG: cli.azure.cli.core.sdk.policies:     'Content-Length': '48'
DEBUG: cli.azure.cli.core.sdk.policies:     'Accept': 'application/json'
DEBUG: cli.azure.cli.core.sdk.policies:     'x-ms-client-request-id': '9f28c654-7963-11ee-926a-0068eb6a3884'
DEBUG: cli.azure.cli.core.sdk.policies:     'CommandName': 'tag create'
DEBUG: cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--resource-id --tags --debug'
DEBUG: cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.53.1 (PIP) azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.13 (Linux-6.5.8-200.fc38.x86_64-x86_64-with-glibc2.37)'
DEBUG: cli.azure.cli.core.sdk.policies:     'Authorization': '*****'
DEBUG: cli.azure.cli.core.sdk.policies: Request body:
DEBUG: cli.azure.cli.core.sdk.policies: {"properties": {"tags": {"in_deletion": "yes"}}}
DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
DEBUG: urllib3.connectionpool: https://management.azure.com:443 "PUT /subscriptions/<subscription ID>/resourceGroups/<resource group>/providers/Microsoft.Compute/snapshots/<snapshot name>/providers/Microsoft.Resources/tags/default?api-version=2022-09-01 HTTP/1.1" 202 0
DEBUG: cli.azure.cli.core.sdk.policies: Response status: 202
DEBUG: cli.azure.cli.core.sdk.policies: Response headers:
DEBUG: cli.azure.cli.core.sdk.policies:     'Cache-Control': 'no-cache'
DEBUG: cli.azure.cli.core.sdk.policies:     'Pragma': 'no-cache'
DEBUG: cli.azure.cli.core.sdk.policies:     'Expires': '-1'
DEBUG: cli.azure.cli.core.sdk.policies:     'Location': 'https://management.azure.com//subscriptions/<subscription ID>/tagsoperationresults?api-version=2022-09-01&$originalLocation=<Base64 value>'
DEBUG: cli.azure.cli.core.sdk.policies:     'x-ms-ratelimit-remaining-subscription-writes': '1199'
DEBUG: cli.azure.cli.core.sdk.policies:     'x-ms-request-id': '592de0ca-b2fd-40e6-94c9-66140f0da17a'
DEBUG: cli.azure.cli.core.sdk.policies:     'x-ms-correlation-request-id': '592de0ca-b2fd-40e6-94c9-66140f0da17a'
DEBUG: cli.azure.cli.core.sdk.policies:     'x-ms-routing-request-id': 'SWEDENCENTRAL:20231102T093849Z:592de0ca-b2fd-40e6-94c9-66140f0da17a'
DEBUG: cli.azure.cli.core.sdk.policies:     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
DEBUG: cli.azure.cli.core.sdk.policies:     'X-Content-Type-Options': 'nosniff'
DEBUG: cli.azure.cli.core.sdk.policies:     'Date': 'Thu, 02 Nov 2023 09:38:49 GMT'
DEBUG: cli.azure.cli.core.sdk.policies:     'Content-Length': '0'
DEBUG: cli.azure.cli.core.sdk.policies: Response content:
DEBUG: cli.azure.cli.core.sdk.policies: 
DEBUG: cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com//subscriptions/<subscription ID>/tagsoperationresults?api-version=2022-09-01&$originalLocation=<Base64 value>'
DEBUG: cli.azure.cli.core.sdk.policies: Request method: 'GET'
DEBUG: cli.azure.cli.core.sdk.policies: Request headers:
DEBUG: cli.azure.cli.core.sdk.policies:     'x-ms-client-request-id': '9f28c654-7963-11ee-926a-0068eb6a3884'
DEBUG: cli.azure.cli.core.sdk.policies:     'CommandName': 'tag create'
DEBUG: cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--resource-id --tags --debug'
DEBUG: cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.53.1 (PIP) azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.13 (Linux-6.5.8-200.fc38.x86_64-x86_64-with-glibc2.37)'
DEBUG: cli.azure.cli.core.sdk.policies:     'Authorization': '*****'
DEBUG: cli.azure.cli.core.sdk.policies: Request body:
DEBUG: cli.azure.cli.core.sdk.policies: This request has no body
DEBUG: urllib3.connectionpool: https://management.azure.com:443 "GET //subscriptions/<subscription ID>/tagsoperationresults?api-version=2022-09-01&$originalLocation=<Base64 value> HTTP/1.1" 404 434
DEBUG: cli.azure.cli.core.sdk.policies: Response status: 404
DEBUG: cli.azure.cli.core.sdk.policies: Response headers:
DEBUG: cli.azure.cli.core.sdk.policies:     'Cache-Control': 'no-cache'
DEBUG: cli.azure.cli.core.sdk.policies:     'Pragma': 'no-cache'
DEBUG: cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json; charset=utf-8'
DEBUG: cli.azure.cli.core.sdk.policies:     'Expires': '-1'
DEBUG: cli.azure.cli.core.sdk.policies:     'x-ms-failure-cause': 'gateway'
DEBUG: cli.azure.cli.core.sdk.policies:     'x-ms-ratelimit-remaining-subscription-reads': '11997'
DEBUG: cli.azure.cli.core.sdk.policies:     'x-ms-request-id': '80441677-fc97-492b-b6cf-4f4b9f6cbe2d'
DEBUG: cli.azure.cli.core.sdk.policies:     'x-ms-correlation-request-id': '80441677-fc97-492b-b6cf-4f4b9f6cbe2d'
DEBUG: cli.azure.cli.core.sdk.policies:     'x-ms-routing-request-id': 'SWEDENCENTRAL:20231102T093849Z:80441677-fc97-492b-b6cf-4f4b9f6cbe2d'
DEBUG: cli.azure.cli.core.sdk.policies:     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
DEBUG: cli.azure.cli.core.sdk.policies:     'X-Content-Type-Options': 'nosniff'
DEBUG: cli.azure.cli.core.sdk.policies:     'Date': 'Thu, 02 Nov 2023 09:38:49 GMT'
DEBUG: cli.azure.cli.core.sdk.policies:     'Content-Length': '434'
DEBUG: cli.azure.cli.core.sdk.policies: Response content:
DEBUG: cli.azure.cli.core.sdk.policies: {"error":{"code":"InvalidResourceType","message":"The resource type 'locations/diskoperations' could not be found in the namespace 'Microsoft.Compute' for api version '2022-09-01'. The supported api-versions are '2016-04-30-preview,2017-03-30,2018-04-01,2018-06-01,2018-09-30,2019-03-01,2019-07-01,2019-11-01,2020-05-01,2020-06-30,2020-09-30,2020-12-01,2021-04-01,2021-08-01,2021-12-01,2022-03-02,2022-07-02,2023-01-02,2023-04-02'."}}
DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "project/.venv/lib/python3.10/site-packages/azure/core/polling/base_polling.py", line 517, in run
    self._poll()
  File "project/.venv/lib/python3.10/site-packages/azure/core/polling/base_polling.py", line 551, in _poll
    self.update_status()
  File "project/.venv/lib/python3.10/site-packages/azure/core/polling/base_polling.py", line 596, in update_status
    _raise_if_bad_http_status_and_method(self._pipeline_response.http_response)
  File "project/.venv/lib/python3.10/site-packages/azure/core/polling/base_polling.py", line 114, in _raise_if_bad_http_status_and_method
    raise BadStatus(
azure.core.polling.base_polling.BadStatus: Invalid return status 404 for 'GET' operation

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "project/.venv/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "project/.venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "project/.venv/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 "project/.venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 708, in _run_job
    result = LongRunningOperation(cmd_copy.cli_ctx, 'Starting {}'.format(cmd_copy.name))(result)
  File "project/.venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 1013, in __call__
    raise exception
  File "project/.venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 1000, in __call__
    result = poller.result()
  File "project/.venv/lib/python3.10/site-packages/azure/core/polling/_poller.py", line 255, in result
    self.wait(timeout)
  File "project/.venv/lib/python3.10/site-packages/azure/core/tracing/decorator.py", line 78, in wrapper_use_tracer
    return func(*args, **kwargs)
  File "project/.venv/lib/python3.10/site-packages/azure/core/polling/_poller.py", line 275, in wait
    raise self._exception # type: ignore
  File "project/.venv/lib/python3.10/site-packages/azure/core/polling/_poller.py", line 192, in _start
    self._polling_method.run()
  File "project/.venv/lib/python3.10/site-packages/azure/core/polling/base_polling.py", line 521, in run
    raise HttpResponseError(
azure.core.exceptions.HttpResponseError: (InvalidResourceType) The resource type 'locations/diskoperations' could not be found in the namespace 'Microsoft.Compute' for api version '2022-09-01'. The supported api-versions are '2016-04-30-preview,2017-03-30,2018-04-01,2018-06-01,2018-09-30,2019-03-01,2019-07-01,2019-11-01,2020-05-01,2020-06-30,2020-09-30,2020-12-01,2021-04-01,2021-08-01,2021-12-01,2022-03-02,2022-07-02,2023-01-02,2023-04-02'.
Code: InvalidResourceType
Message: The resource type 'locations/diskoperations' could not be found in the namespace 'Microsoft.Compute' for api version '2022-09-01'. The supported api-versions are '2016-04-30-preview,2017-03-30,2018-04-01,2018-06-01,2018-09-30,2019-03-01,2019-07-01,2019-11-01,2020-05-01,2020-06-30,2020-09-30,2020-12-01,2021-04-01,2021-08-01,2021-12-01,2022-03-02,2022-07-02,2023-01-02,2023-04-02'.

ERROR: cli.azure.cli.core.azclierror: (InvalidResourceType) The resource type 'locations/diskoperations' could not be found in the namespace 'Microsoft.Compute' for api version '2022-09-01'. The supported api-versions are '2016-04-30-preview,2017-03-30,2018-04-01,2018-06-01,2018-09-30,2019-03-01,2019-07-01,2019-11-01,2020-05-01,2020-06-30,2020-09-30,2020-12-01,2021-04-01,2021-08-01,2021-12-01,2022-03-02,2022-07-02,2023-01-02,2023-04-02'.
Code: InvalidResourceType
Message: The resource type 'locations/diskoperations' could not be found in the namespace 'Microsoft.Compute' for api version '2022-09-01'. The supported api-versions are '2016-04-30-preview,2017-03-30,2018-04-01,2018-06-01,2018-09-30,2019-03-01,2019-07-01,2019-11-01,2020-05-01,2020-06-30,2020-09-30,2020-12-01,2021-04-01,2021-08-01,2021-12-01,2022-03-02,2022-07-02,2023-01-02,2023-04-02'.
ERROR: az_command_data_logger: (InvalidResourceType) The resource type 'locations/diskoperations' could not be found in the namespace 'Microsoft.Compute' for api version '2022-09-01'. The supported api-versions are '2016-04-30-preview,2017-03-30,2018-04-01,2018-06-01,2018-09-30,2019-03-01,2019-07-01,2019-11-01,2020-05-01,2020-06-30,2020-09-30,2020-12-01,2021-04-01,2021-08-01,2021-12-01,2022-03-02,2022-07-02,2023-01-02,2023-04-02'.
Code: InvalidResourceType
Message: The resource type 'locations/diskoperations' could not be found in the namespace 'Microsoft.Compute' for api version '2022-09-01'. The supported api-versions are '2016-04-30-preview,2017-03-30,2018-04-01,2018-06-01,2018-09-30,2019-03-01,2019-07-01,2019-11-01,2020-05-01,2020-06-30,2020-09-30,2020-12-01,2021-04-01,2021-08-01,2021-12-01,2022-03-02,2022-07-02,2023-01-02,2023-04-02'.
DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f0740f964d0>]
INFO: az_command_data_logger: exit code: 3
INFO: cli.__main__: Command ran in 2.693 seconds (init: 0.180, invoke: 2.514)
INFO: telemetry.main: Begin splitting cli events and extra events, total events: 1
INFO: telemetry.client: Accumulated 0 events. Flush the clients.
INFO: telemetry.main: Finish splitting cli events and extra events, cli events: 1

Expected behavior

The tags should be created/modified as usual/as in other regions.

Environment Summary

$ az --version
azure-cli                         2.53.1

core                              2.53.1
telemetry                          1.1.0

Extensions:
serial-console                     0.1.6

Dependencies:
msal                            1.24.0b2
azure-mgmt-resource             23.1.0b2

Additional context

The value for <Base64 value> resolves to the following:

https://management.azure.com/subscriptions/<subscription ID>/providers/Microsoft.Compute/locations/westeurope/DiskOperations/97614a7d-98d6-46b5-853b-650151767f4c?p=ebb08ca3-36e1-43f7-8312-376b77d3fbcc&monitor=true&api-version=2022-03-02

When executing the exact same command, but from a different location (e.g. France South or Central US) then everything works as expected. We have not changed anything on our side and this was also the case with at least version 2.52.0 of Azure CLI.

yonzhan commented 11 months ago

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

hanusto commented 11 months ago

Seems to have the same issue:

az tag update --resource-id /subscriptions/<subId>/resourceGroups/<rg>/providers/Microsoft.DBforPostgreSQL/flexibleServers/<id> --operation Merge --tags "TEST=OK" -o none

Code: InvalidResourceType
Message: The resource type 'locations/operationResults' could not be found in the namespace 'Microsoft.DBforPostgreSQL' for api version '2022-09-01'. The supported api-versions are '2017-12-01-preview,2017-12-01,2020-02-14-privatepreview,2020-02-14-preview,2020-11-05-preview,2022-03-08-privatepreview,2022-01-20-preview,2021-06-01-preview,2021-06-01,2022-03-08-preview,2022-05-01-privatepreview,2022-05-01-preview,2022-06-01-privatepreview,2022-11-01-preview,2022-12-01,2023-01-01-privatepreview,2023-03-01-preview,2023-06-01-preview,2020-10-05-privatepreview,2022-11-08,2023-03-02-preview'.

AZ version (

azure-cli                         2.53.1

core                              2.53.1
telemetry                          1.1.0

Extensions:
ssh                                1.1.6

Dependencies:
msal                            1.24.0b2
azure-mgmt-resource             23.1.0b2

The same result also for

az version
{
  "azure-cli": "2.49.0",
  "azure-cli-core": "2.49.0",
  "azure-cli-telemetry": "1.0.8",
  "extensions": {
    "ssh": "1.1.6"
  }
}
sharvarikhedkar commented 11 months ago

Been running into same issue,

"stderr_lines": ["ERROR: (InvalidResourceType) The resource type 'locations/operationResults' 
could not be found in the namespace 'Microsoft.DBforPostgreSQL' for api version '2022-09-01'. 
The supported api-versions are '2017-12-01-preview,2017-12-01,2020-02-14-privatepreview,
2020-02-14-preview,2020-11-05-preview,2022-03-08-privatepreview,2022-01-20-preview,2021-06-01-
preview,2021-06-01,2022-03-08-preview,2022-05-01-privatepreview,2022-05-01-preview,2022-06-01-
privatepreview,2022-11-01-preview,2022-12-01,2023-01-01-privatepreview,2023-03-01-preview,
2023-06-01-preview,2020-10-05-privatepreview,2022-11-08,2023-03-02-preview'.", 
"Code: InvalidResourceType", ...."], "stdout": "", "stdout_lines": []}

Fails az tag consistently with above error when trying to update tags to following Azure resources:

  1. /subscriptions/XXXXXXX/resourceGroups/XXXXXXX/providers/Microsoft.Network/privateDnsZones
  2. /subscriptions/XXXXXXX/resourceGroups/XXXXXXX/providers/Microsoft.Network/privateDnsZones/XXXXXXX/virtualNetworkLinks/networkLink
  3. /subscriptions/XXXXXXX/resourceGroups/XXXXXXX/providers/Microsoft.DBforPostgreSQL/flexibleServers
JeffHarkavy commented 11 months ago

Not CLI, but I've run into this exact error using Azure.ResourceManager in C#. I've tried it in both West US 2 and East US 2 regions. Azure.ResourceManager 1.8.0 Azure.ResourceManager.Compute 1.2.0

var snapshotResource = await snapshotCollection.CreateOrUpdateAsync(WaitUntil.Completed, snapshotName, snapshotData, cancellationToken);
var tags = new Dictionary<string, string>()
  {
    { "Tag A", "Tag Value A" },
    { "Tag B", "Tag Value B" },
    { "Tag C", "Tag Value C" },
};
await snapshotResource.Value.SetTagsAsync(tags, cancellationToken);

Throws the following Exception: Azure.RequestFailedException: 'The resource type 'locations/diskoperations' could not be found in the namespace 'Microsoft.Compute' for api version '2022-09-01'. The supported api-versions are '2016-04-30-preview,2017-03-30,2018-04-01,2018-06-01,2018-09-30,2019-03-01,2019-07-01,2019-11-01,2020-05-01,2020-06-30,2020-09-30,2020-12-01,2021-04-01,2021-08-01,2021-12-01,2022-03-02,2022-07-02,2023-01-02,2023-04-02'. Status: 404 (Not Found) ErrorCode: InvalidResourceType

The code above worked as recently as 30-Oct. I've discovered I can work around it by doing snapshotData.Tags.Add(tag, value) before calling CreateOrUpdateAsync, but the fact that I have to change code that's worked for the past year is more than a bit frustrating.

maciejduk commented 11 months ago

Same issue here using az cli version 2.53.1.

Message: The resource type 'locations/diskoperations' could not be found in the namespace 'Microsoft.Compute' for api version '2022-09-01'. The supported api-versions are '2016-04-30-preview,2017-03-30,2018-04-01,2018-06-01,2018-09-30,2019-03-01,2019-07-01,2019-11-01,2020-05-01,2020-06-30,2020-09-30,2020-12-01,2021-04-01,2021-08-01,2021-12-01,2022-03-02,2022-07-02,2023-01-02,2023-04-02'.
usrme commented 10 months ago

@yonzhan, any updates?

fhusson commented 10 months ago

The Microsoft support said that they are working on a fix, but they didn't give me an ETA.

hanusto commented 10 months ago

Same for me. ETA is couple of weeks :/.

So it works with 2.35.0, even if the command output is kind of weird - properties.tags: null

čt 7. 12. 2023 v 10:37 odesílatel Frédéric Husson @.***> napsal:

The Microsoft support said that they are working on a fix, but they didn't give me an ETA.

— Reply to this email directly, view it on GitHub https://github.com/Azure/azure-cli/issues/27745#issuecomment-1845003584, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU3GA76FVTLG4SYWVG6WTYIGE5NAVCNFSM6AAAAAA62TWYA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBVGAYDGNJYGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

fhusson commented 9 months ago

Hi, I just had a mail from Microsoft support this morning : "the fix has been rolled out in France Central region" I don't have the bug anymore in this region.

usrme commented 9 months ago

Closing as everything seems to be working again as it did before.