Azure / Azure/azure-powershell

Invoke−AzRestMethod −Method Get Not Supported for any version

Open
#26,097 2 comments 0 reactions 0 assignees View on GitHub
bug customer-reported needs-triage
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

From CoPilot
```powershell
$managedIdentity = Get-AzUserAssignedIdentity -ResourceGroupName -Name

$associatedResources = Invoke-AzRestMethod -Method Get -Path "/subscriptions/$($managedIdentity.SubscriptionId)/resourceGroups/$($managedIdentity.ResourceGroupName)/providers/Microsoft.ManagedIdentity/userAssignedIdentities/$($managedIdentity.Name)/listAssociatedResources?api-version=2021-09-30-preview"
```
I tried all API Versions
2023-07-31-PREVIEW
2023-01-31
2022-01-31-PREVIEW
2021-09-30-PREVIEW
2018-11-30
2015-08-31-PREVIEW

All Versions reported that Method "Get" was unsupported.
Az cli worked, so I am assuming it was not permissions.

### Issue script & Debug output

```PowerShell
Not applicable / Protected environment
```

### Environment data

```PowerShell
Name Value
---- -----
PSVersion 7.4.5
PSEdition Core
GitCommitId 7.4.5
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

```PowerShell
ModuleType Version PreRelease Name
---------- ------- ---------- ----
Script 3.0.0 Az.Accounts
Script 1.2.1 Az.ManagedServiceIdentity
Script 7.1.0 Az.Resources
```

### Error output

```PowerShell
Not applicable
```

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.