Open RandyDotCom opened 5 days ago
That API version does not show up in the documentation, so maybe use one that is supported?
Also your URL is not correct for calling the api, this works just fine on my end.
$versionURL = "https://management.azure.com/subscriptions/$($subId)/resourceGroups/$($rgName)/providers/Microsoft.ManagedIdentity/userAssignedIdentities?api-version=2023-01-31"
$result = Invoke-AzRestMethod -Method Get -Uri $versionURL
Description
From CoPilot
$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
Environment data
Module versions
Error output