Azure / Azure/azure-powershell

Update-AzTag on privateDNS uses unavailable API version

Open
#23,668 2 comments 0 reactions 0 assignees View on GitHub
act-identity-squad ARM - Tags bug customer-reported Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

```
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

```PowerShell
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

```PowerShell
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
```

### Module versions

```PowerShell
get-module

ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 2.13.2 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script 6.12.1 az.resources {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…}
Manifest 7.0.0.0 Microsoft.PowerShell.Management {Add-Content, Clear-Content, Clear-Item, Clear-ItemProperty…}
Manifest 7.0.0.0 Microsoft.PowerShell.Security {ConvertFrom-SecureString, ConvertTo-SecureString, Get-Acl, Get-AuthenticodeSignature…}
Manifest 7.0.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object…}
Manifest 7.0.0.0 Microsoft.WSMan.Management {Connect-WSMan, Disable-WSManCredSSP, Disconnect-WSMan, Enable-WSManCredSSP…}
Script 2.2.6 PSReadLine {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler…}
```

### Error output

```PowerShell
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.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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.