Azure / Azure/azure-powershell

Piped Remove-AzDnsRecordSet -Verbose produces partial, shallow output

Open
#26,895 5 comments 0 reactions 0 assignees View on GitHub
act-quality-productivity-squad bug Network - DNS Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

A standalone command `Remove-AzDnsRecordSet`:

```powershell
Remove-AzDnsRecordSet -ResourceGroupName x-shared-dev-westus3 -ZoneName westus3.data.dev.shared.example.com -Name contoso-dev-westus3-202412173559534-733dc632 -RecordType CNAME -Verbose
```
produces proper verbose output:

```powershell
VERBOSE: Performing the operation "Removing record set ..." on target "contoso-dev-westus3-202412173559534-733dc632".
VERBOSE: Success!
VERBOSE: Record set 'contoso-dev-westus3-202412173559534-733dc632' was removed from zone 'westus3.data.dev.shared.example.com'.
```

However, piping `Get-AzDnsRecordSet | Remove-AzDnsRecordSet -Verbose`:

```powershell
Get-AzDnsRecordSet -ResourceGroupName x-shared-dev-westus3 -ZoneName westus3.data.dev.shared.example.com -Name contoso-dev-westus3-202412173559534-2a27f152 -RecordType CNAME | Remove-AzDnsRecordSet -Verbose
```

does not:

```powershell
VERBOSE: Performing the operation "Removing record set ..." on target "".
VERBOSE: Success!
VERBOSE: Record set '' was removed from zone ''.
```

### Issue script & Debug output

```PowerShell
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
DELETE

Absolute Uri:
https://management.azure.com/subscriptions/7813c048-4dfa-0000-88f2-a06c73024663/resourceGroups/x-shared-dev-westus3/providers/Microsoft.Network/dnsZones/westus3.data.dev.shared.example.com/CNAME/contoso-dev-westus3-202412173559535-41f580e7?api-version=2018-05-01

Headers:
If-Match : 97c0a2a5-eba1-4893-86fd-afbb2c589522
Accept-Language : en-US
x-ms-client-request-id : 8337e4d1-d264-4660-ab78-c0e0918fe8bf

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
OK

Headers:
Cache-Control : private
X-Content-Type-Options : nosniff
Strict-Transport-Security : max-age=31536000; includeSubDomains
x-ms-request-id : 9a1f6867-6e47-4d34-9b49-950cfe0c8208
X-Powered-By : ASP.NET
x-ms-ratelimit-remaining-subscription-resource-requests: 11999
x-ms-correlation-request-id : 7904b4c9-b999-43a9-9d56-1f9927fc80aa
x-ms-routing-request-id : WESTUS2:20241217T180921Z:7904b4c9-b999-43a9-9d56-1f9927fc80aa
X-Cache : CONFIG_NOCACHE
X-MSEdge-Ref : Ref A: 29AAA265B0CC485C8112D94EFF176158 Ref B: CO6AA3150217051 Ref C: 2024-12-17T18:09:20Z
Date : Tue, 17 Dec 2024 18:09:20 GMT

Body:

DEBUG: AzureQoSEvent: Module: Az.Dns:1.1.3; CommandName: Get-AzDnsRecordSet; PSVersion: 7.4.6; IsSuccess: True; Duration: 00:00:01.3422199
DEBUG: 10:09:21 - GetAzureDnsRecordSet end processing.
DEBUG: 10:09:21 - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:09:21 - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [False].
DEBUG: AzureQoSEvent: Module: Az.Dns:1.1.3; CommandName: Remove-AzDnsRecordSet; PSVersion: 7.4.6; IsSuccess: True; Duration: 00:00:01.4447435
DEBUG: 10:09:21 - [ConfigManager] Got [True] from [EnableDataCollection], Module = [], Cmdlet = [].
DEBUG: 10:09:21 - RemoveAzureDnsRecordSet end processing.
```

### Environment data

```PowerShell
Name Value
---- -----
PSVersion 7.4.6
PSEdition Core
GitCommitId 7.4.6
OS Microsoft Windows 10.0.26100
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
Name : Az.Dns
Path : C:\Users\alexbat\OneDrive - Microsoft\Documents\PowerShell\Modules\Az.Dns\1.1.3\Az.Dns.psm1
Description : Microsoft Azure PowerShell - DNS service cmdlets for Azure Resource Manager in Windows PowerShell and
PowerShell Core.

For more information on DNS, please visit the following: https://learn.microsoft.com/azure/dns/
ModuleType : Script
Version : 1.1.3
PreRelease :
NestedModules : {Microsoft.Azure.PowerShell.Cmdlets.Dns}
```

### Error output

```PowerShell

```

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.