0

The following commands were previously working from a local PS session using module Az.ManagedServiceIdentity version 0.7.2, but broke once I updated to 0.7.3, now can't get it to work again even after downgrading the module version. I'd like to use this module from cloud shell ideally but get the same error.

*$uamiRg = (Get-AzResourceGroup -Name *identity*).ResourceGroupName
$uami = Get-AzUserAssignedIdentity -ResourceGroupName $uamiRg -Name "my-uami"*

This used to grab the ID, RG, Name, Location, TenantId, etc. needed to use the User Assigned Managed Identity for assigning Azure Blueprints. Now the 2nd command throws this error:

*Get-AzUserAssignedIdentity : Extended 'versions' can't be converted to a boolean
At line:1 char:1
+ Get-AzUserAssignedIdentity -ResourceGroupName $uamiRg -Verbose -Error ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-AzUserAssignedIdentity], CloudException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ManagedServiceIdentity.UserAssignedIdentities.GetAzureRmUserAssignedIdentityCmdlet*

Debug results: DEBUG: 5:51:44 AM - GetAzureRmUserAssignedIdentityCmdlet begin processing with ParameterSet 'ResourceGroupParameterSet'. DEBUG: 5:51:44 AM - using account id ''... DEBUG: [Common.Authentication]: Authenticating using Account: '', environment: 'AzureCloud', tenant: '***' DEBUG: [HttpClientOperations]: Adding Header 'Metadata' DEBUG: Checking Cache request http://localhost:50342/oauth2/token?resource=https%3A%2F%2Fmanagement.core.windows.net%2F&api-version=2018-02-01 DEBUG: Cache Hit DEBUG: ============================ HTTP REQUEST ============================

HTTP Method: GET

Absolute Uri: https://management.azure.com/subscriptions/***/resourceGroups/***Identity-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-uami?api-version=2015-08-31-preview

Headers: x-ms-client-request-id : f0c521dd-5e24-400c-acc5-b47e9f1e75f2 Accept-Language : en-US

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code: BadRequest

Headers: Cache-Control : no-cache Pragma : no-cache Strict-Transport-Security : max-age=31536000; includeSubDomains Server : Microsoft-HTTPAPI/2.0 x-ms-ratelimit-remaining-subscription-reads: 11997 x-ms-request-id : 8164b0a7-a810-4cb0-b5c1-29484e924c3f x-ms-correlation-request-id : 8164b0a7-a810-4cb0-b5c1-29484e924c3f x-ms-routing-request-id : EASTUS:20200405T055145Z:8164b0a7-a810-4cb0-b5c1-29484e924c3f X-Content-Type-Options : nosniff Date : Sun, 05 Apr 2020 05:51:44 GMT

Body: { "error": { "code": "BadRequest", "message": "Extended 'versions' can't be converted to a boolean" } }

Get-AzUserAssignedIdentity: Extended 'versions' can't be converted to a boolean DEBUG: AzureQoSEvent: CommandName - Get-AzUserAssignedIdentity; IsSuccess - False; Duration - 00:00:00.2875296;; Exception - Microsoft.Rest.Azure.CloudException: Extended 'versions' can't be converted to a boolean at Microsoft.Azure.Management.ManagedServiceIdentity.UserAssignedIdentitiesOperations.GetWithHttpMessagesAsync(String resourceGroupName, String resourceName, Dictionary2 customHeaders, CancellationToken cancellationToken) at Microsoft.Azure.Commands.ManagedServiceIdentity.UserAssignedIdentities.GetAzureRmUserAssignedIdentityCmdlet.ExecuteCmdlet() at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__31.b__3_0(T c) at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor) at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet) at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord(); DEBUG: Finish sending metric. DEBUG: 5:51:45 AM - GetAzureRmUserAssignedIdentityCmdlet end processing.

  • It looks like this is a version 0.7.3 bug, I can now run the commands successfully in version 0.7.2 after a proper uninstall-module of 0.7.3 module, also working in cloud shell – Matthew Blessing Apr 05 '20 at 05:33

1 Answers1

0

Not sure what caused the issue, but it is not a bug, the 0.7.3 works on my side.

enter image description here

It also works in cloud shell:

enter image description here


To fix the issue, try to update the Az module, then install the Az.ManagedServiceIdentity module.

Update-Module -Name Az -Force
Install-Module -Name Az.ManagedServiceIdentity -RequiredVersion 0.7.3
Joy Wang
  • 39,905
  • 3
  • 30
  • 54