Azure / Azure/azure-powershell

[Az.Resources] Move-AzResource - Parameter short form -Id gets bound to DestinationSubscriptionId instead of ResourceId

Open Beginner friendly
#15,266 4 comments 0 reactions 0 assignees View on GitHub
act-identity-squad ARM feature-request Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

## Description

auto parameter binding logic maps -Id to DestinationSubscriptionId , Id should be aliased to ResourceId explicitly

PS C:\> Move-AzResource -Id /subscriptions/xxxxxxx9bff36b0/resourceGroups/test1/providers/Microsoft.KeyVault/vaults/test1kv -DestinationResourceGroupName test2 -Verbose

Move-AzResource: Cannot bind parameter 'DestinationSubscriptionId'. Cannot convert value "/subscriptions/dxxxx6b0/resourceGroups/test1/providers/Microsoft.KeyVault/vaults/test1kv" to type "System.Guid". Error: "Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."

## Steps to reproduce

```powershell
Move-AzResource -Id /subscriptions/d464f19f-5e76-43d1-a602-5e039bff36b0/resourceGroups/test1/providers/Microsoft.KeyVault/vaults/test1kv -DestinationResourceGroupName test2 -Verbose
```

## Environment data
Powershell version 5.1

## Module versions
Az.Resources Latest - 4.1.1

Contributor guide

Open the contributing guide

Research direction

Start by locating the Move-AzResource parameter definitions and the binding or alias configuration for -Id. Reproduce the provided PowerShell command, then verify that -Id binds to ResourceId rather than DestinationSubscriptionId and that the command accepts the resource ID without the GUID conversion error.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, powershell
Domain
cloud
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.