question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AzureUSGovernment; `az identity create`; NoRegisteredProviderFound API version `2021-09-30-preview` for type `userAssignedIdentities`

See original GitHub issue

Describe the bug

Error when using Az CLI v2.37.0 with API version 2021-09-30-preview for type userAssignedIdentities in AzureUSGovernment cloud. The error happens when doing an az identity create ... (see below).

Note: works correctly if using Az CLI v2.36.0

Command Name

az identity create --subscription {} --name {} --resource-group {}

Errors:

(NoRegisteredProviderFound) No registered resource provider found for location 'usgov*****' and API version '2021-09-30-preview' for type 'userAssignedIdentities'. The supported api-versions are '2015-08-31-PREVIEW, 2018-11-30'. The supported locations are 'usgovvirginia, usgoviowa, usgovtexas, usgovarizona, usdodeast, usdodcentral'.
Code: NoRegisteredProviderFound
Message: No registered resource provider found for location 'usgov*****' and API version '2021-09-30-preview' for type 'userAssignedIdentities'. The supported api-versions are '2015-08-31-PREVIEW, 2018-11-30'. The supported locations are 'usgovvirginia, usgoviowa, usgovtexas, usgovarizona, usdodeast, usdodcentral'.

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • az cloud set --name AzureUSGovernment
  • az login
  • az extension update --name aks-preview
  • az identity create --subscription {} --name {} --resource-group {}

Expected Behavior

Should return a json payload of the created managed identity.

Environment Summary

Windows-10-10.0.19044-SP0
Python 3.10.4
Installer: MSI

azure-cli 2.37.0

Extensions:
account 0.2.3
aks-preview 0.5.75

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1

Additional Context

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
zhoxing-mscommented, May 28, 2022

@aldass-snc This issue is caused by upgrading the api-version for Microsoft.ManagedIdentity in the latest profile. PR link https://github.com/Azure/azure-cli/pull/22284 Since CLI currently does not support setting different api-version for different clouds, so under the same profile, all clouds use the same api-version for easier maintenance. CLI only supports setting different api-version for different profiles.

So we currently have two work arounds to bypass this problem:

  1. If the environment allows, please temporarily downgrade the CLI version to 2.36.0
  2. If the environment does not allow to downgrade the CLI version, before executing the az identity create command, you can execute az cloud set -n AzureUSGovernment --profile 2020-09-01-hybrid to switch the profile. After creating identitites, then you can execute az cloud set -n AzureUSGovernment --profile latest to switch the latest profile back.
2reactions
arndt-scommented, May 30, 2022

@zhoxing-ms

May I ask do you know when the api-version 2021-09-30-preview for Microsoft.ManagedIdentity will be supported in AzureUSGovernment?

We are in the progress of enabling sovereign clouds but don’t have any ETA yet.

@aldass-snc As far as I know the guidance for GA is to support all of them at once. However, this feature is in public preview and the guidance here for Fairfax is 30 days since public preview in public if I’m not mistaken.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Microsoft.ManagedIdentity userAssignedIdentities 2021-09-30 ...
This module allows you to create a user-assigned managed identity and a role assignment scoped to the resource group. Create an API Management ......
Read more >
Use nested ARM template to provision User Assigned ...
Use nested ARM template to provision User Assigned Managed Identity and add access policy to key-vault from different subscription.
Read more >
There is a new way to reference managed identity in ARM ...
First, we need to build a resource identifier using the resourceId template function. We then provide the apiVersion to use for that resource ......
Read more >
Can't reference principalId of user assigned identity for key ...
I got the same error but I had forgotten to assign a managed identity to my resource in the ARM template like: "identity":...
Read more >
Using Managed Identity to Securely Access Azure Resources
To enable MI using an ARM template we add an Identity section and set it to System Assign. { "apiVersion": "2016-08-01", "type": "Microsoft....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found