PS> $res
Name : privatelink.eventgrid.azure.net
ResourceGroupName : rg-swa-hub-networking-001
ResourceType : Microsoft.Network/privateDnsZones
PS> Update-aztag -ResourceId $res.resourceid -tag $tags -operation replace -debug -verbose
(snip)
Body:
{
"error": {
"code": "InvalidResourceType",
"message": "The resource type 'privateDnsOperationResults' could not be found in the namespace 'Microsoft.Network' for api version '2022-09-01'. The supported api-versions are '2018-09-01,2020-01-01,2020-06-01'."
}
}
DEBUG: 13:01:15 - [ConfigManager] Got nothing from [DisableErrorRecordsPersistence], Module = [], Cmdlet = []. Returning default value [False].
DEBUG: 13:01:15 - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True].
Update-AzTag: Long running operation failed with status 'NotFound'.
As you can see, api version is incorrect if trying to update tags.
Issue script & Debug output
Date : Tue, 05 Dec 2023 13:23:59 GMT
Body:
{
"error": {
"code": "InvalidResourceType",
"message": "The resource type 'privateDnsOperationResults' could not be found in the namespace 'Microsoft.Network' for api version '2022-09-01'. The supported api-versions are '2018-09-01,2020-01-01,2020-06-01'."
}
}
DEBUG: 13:24:06 - [ConfigManager] Got nothing from [DisableErrorRecordsPersistence], Module = [], Cmdlet = []. Returning default value [False].
DEBUG: 13:24:06 - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True].
Update-AzTag: Long running operation failed with status 'NotFound'.
DEBUG: 13:24:06 - [ConfigManager] Got [False] from [DisplayBreakingChangeWarning], Module = [], Cmdlet = [].
DEBUG: 13:24:06 - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 13:24:06 - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent: Module: az.resources:6.12.1; CommandName: Update-AzTag; PSVersion: 7.3.9; IsSuccess: False; Duration: 00:00:32.7845471; Exception: Long running operation failed with status 'NotFound'.;
Environment data
Name Value
---- -----
PSVersion 7.3.9
PSEdition Core
GitCommitId 7.3.9
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Message : Long running operation failed with status 'NotFound'.
ServerMessage : InvalidResourceType: The resource type 'privateDnsOperationResults' could not be found in the namespace 'Microsoft.Network' for api version '2022-09-01'. The supported api-versions are
'2018-09-01,2020-01-01,2020-06-01'. (System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError])
ServerResponse : {NotFound}
InvocationInfo : {Update-AzTag}
Line : update-aztag -ResourceId $res.resourceid -tag $tags -operation replace -debug -verbose
Position : At line:1 char:1
+ update-aztag -ResourceId $res.resourceid -tag $tags -operation replac …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
StackTrace : at Microsoft.Rest.ClientRuntime.Azure.LRO.LROPollState`2.CheckErrorStatusAndThrowAsync(HttpRequestMessage request, HttpResponseMessage response)
at Microsoft.Rest.ClientRuntime.Azure.LRO.LROPollState`2.GetRawAsync(Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Rest.ClientRuntime.Azure.LRO.LROPollState`2.UpdateResourceFromPollingUri(Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Rest.ClientRuntime.Azure.LRO.LROPollState`2.Poll(Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Rest.ClientRuntime.Azure.LRO.AzureLRO`2.StartPollingAsync()
at Microsoft.Rest.ClientRuntime.Azure.LRO.AzureLRO`2.BeginLROAsync()
at Microsoft.Rest.Azure.AzureClientExtensions.GetLongRunningOperationResultAsync[TBody,THeader](IAzureClient client, AzureOperationResponse`2 response, Dictionary`2 customHeaders, CancellationToken
cancellationToken)
at Microsoft.Rest.Azure.AzureClientExtensions.GetPutOrPatchOperationResultAsync[TBody,THeader](IAzureClient client, AzureOperationResponse`2 response, Dictionary`2 customHeaders, CancellationToken
cancellationToken)
at Microsoft.Azure.Management.Resources.TagsOperations.UpdateAtScopeWithHttpMessagesAsync(String scope, TagsPatchResource parameters, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.Management.Resources.TagsOperationsExtensions.UpdateAtScopeAsync(ITagsOperations operations, String scope, TagsPatchResource parameters, CancellationToken cancellationToken)
at Microsoft.Azure.Management.Resources.TagsOperationsExtensions.UpdateAtScope(ITagsOperations operations, String scope, TagsPatchResource parameters)
at Microsoft.Azure.Commands.Tags.Client.TagsClient.UpdateTagAtScope(String scope, TagPatchOperation operation, IDictionary`2 parameters)
at Microsoft.Azure.Commands.Tags.Tag.UpdateAzureTagCommand.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor)
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
H
Description
As you can see, api version is incorrect if trying to update tags.
Issue script & Debug output
Environment data
Module versions
Error output