Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.22k stars 3.83k forks source link

Get-AzSqlElasticPool: elastic pool will fail silently when name of pool is wrong by trailing spaces #25680

Open DJawna opened 2 months ago

DJawna commented 2 months ago

Description

affected cmdlet: Get-AzSqlElasticPool 4.14.0 Az.Sql

Current Behavior:

Get-AzSqlElasticPool with all arguments being correct except the name of the elastic pool having a trailing space, then the cmdlet will return nothing and will not report an error.

Expected Behavior:

When the name of the elastic pool is wrong due to trailing spaces, then there should be an error (the same behavior if it is wrong by non whitespace)

Issue script & Debug output

This will fail silently:
-AzSqlElasticPool -ResourceGroupName "AValidRG" -ServerName "avalidsqlserver" -ElasticPoolName "avalidpool "
Output:
NONE

This will fail normaly:
```Get-AzSqlElasticPool -ResourceGroupName "AValidRG" -ServerName "avalidsqlserver" -ElasticPoolName "wrongpoolalltogether"```
OUTPUT:

Get-AzSqlElasticPool: The Resource 'Microsoft.Sql/servers/avalidsqlserver/elasticpools/wrongpoolalltogether' under resource group 'AValidRG' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.3
PSEdition                      Core
GitCommitId                    7.4.3
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.17.0                Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     4.14.0                Az.Sql                              {Add-AzSqlDatabaseToFailoverGroup, Add-AzSqlElasticJobStep, Add-AzSqlElasticJobTarget, Ad…

Error output

There is no error thats the problem see above!
microsoft-github-policy-service[bot] commented 2 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureSQLGitHub.

microsoft-github-policy-service[bot] commented 2 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureSQLGitHub.