azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Get-AzureRmResource -ResourceId case sensitive provider part

Open leovms opened this issue 8 years ago • 1 comments

Description

Calling Get-AzureRmResource -ResourceId returns null or empty if the provider part of a resource ID mismatches case.

Script/Steps for Reproduction

  1. Get a resource ID for something like a Compute VM (i.e. /subscriptions/<subId>/resourceGroups/<rgName>/providers/Microsoft.Compute/virtualMachines/<vmName>).

  2. Execute the PS as shown in the example below. Note the use of microsoft.Compute, small case m.

Get-AzureRmResource -ResourceId /subscriptions/<subId>/resourceGroups/<rgName>/providers/microsoft.Compute/virtualMachines/<vmName>
  1. Observe nothing is returned. If we change the case for the provider to be Microsoft.Compute instead of microsoft.Compute then it works.

Module Version

AzureRM v6.4.0

Environment Data

Name                           Value                                                                                                                                                                                                                             
----                           -----                                                                                                                                                                                                                             
PSVersion                      5.1.17134.112                                                                                                                                                                                                                     
PSEdition                      Desktop                                                                                                                                                                                                                           
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                           
BuildVersion                   10.0.17134.112                                                                                                                                                                                                                    
CLRVersion                     4.0.30319.42000                                                                                                                                                                                                                   
WSManStackVersion              3.0                                                                                                                                                                                                                               
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                               
SerializationVersion           1.1.0.1                                                                                                                                                                                                                           

Debug Output

See attached file: debug.txt

leovms avatar Jul 04 '18 14:07 leovms

@leovms thanks for filing this issue. It is a duplicate of https://github.com/Azure/azure-powershell/issues/6553 and will be fixed in the next release of AzureRM 😀

cormacpayne avatar Jul 04 '18 16:07 cormacpayne