azure-powershell
azure-powershell copied to clipboard
Get-AzureRmResource -ResourceId case sensitive provider part
Description
Calling Get-AzureRmResource -ResourceId returns null or empty if the provider part of a resource ID mismatches case.
Script/Steps for Reproduction
-
Get a resource ID for something like a Compute VM (i.e.
/subscriptions/<subId>/resourceGroups/<rgName>/providers/Microsoft.Compute/virtualMachines/<vmName>). -
Execute the PS as shown in the example below. Note the use of
microsoft.Compute, small casem.
Get-AzureRmResource -ResourceId /subscriptions/<subId>/resourceGroups/<rgName>/providers/microsoft.Compute/virtualMachines/<vmName>
- Observe nothing is returned. If we change the case for the provider to be
Microsoft.Computeinstead ofmicrosoft.Computethen 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 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 😀