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.

[QUERY] User Managed Identity not working

See original GitHub issue

Query/Question

Created this issue on behalf of @dsm4u, please be sure to include them on any questions or replies.

I am trying to use usermanaged identity to access storage account from VM scale set. Created a managed identity, added it to scaleset and then given storage contribute access to the identity for the storage account.

But when i try to access the storage account via .net console app running on the scaleset instance, it giving authentication error.

The same scenario is working fine for system managed identity,

Can you please advise.

These are the steps I have followed:

  1. Created a Manged Identity via portal.
  2. In the Virtual Scaleset, went to the identity and added the newly created identity as user assigned identity. image
  3. In the portal, went to the storage account, and in the access control (IAM) added role assignment. In that selected user assigned managed identity and selected the identity created above. image
  4. These are the configuration done on the portal level.
  5. Now in the console app used the queue client and tried to access the storage account. and the console app was executed from the scale set instance. code as below: QueueClient queueClient = new QueueClient(queueUri, new DefaultAzureCredential(false)); var message = queueClient.ReceiveMessage();

Please do let me know if any other details required on this.

Environment:

  • Name and version of the Library package used: [e.g. Azure.Storage.Blobs 12.2.0]
  • Hosting platform or OS and .NET runtime version (dotnet --info output for .NET Core projects): [e.g. Azure AppService or Windows 10 .NET Framework 4.8]
  • IDE and version : [e.g. Visual Studio 16.3]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:29 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
christothescommented, Sep 15, 2021

Thanks this worked… Also, observed that if we turn off the system managed identity for the scaleset and enable only user managed identity then its working fine without explicitly setting the clientid.

FYI - These docs explain this behavior

1reaction
dsm4ucommented, Sep 15, 2021

Thanks this worked… Also, observed that if we turn off the system managed identity for the scaleset and enable only user managed identity then its working fine without explicitly setting the clientid.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Known issues with managed identities for Azure resources
This article discusses a couple of issues around managed identities and how to address them. Common questions about managed identities are ...
Read more >
Using User Managed Identity in Azure function Service Bus ...
I have a function that uses Service bus trigger and wanted to use "User Managed Identity". I couldn't get this working even after...
Read more >
Using Managed Identities to access Azure SQL
The main problem is that adding a managed identity as a SQL Server user is a bit complex. And, requires some “privilege tweaking”....
Read more >
Azure Function and User Assigned Managed Identities
Let's talk about authentication between Azure Functions and resources used by Azure Functions and conclude with many poorly documented ...
Read more >
How to use Azure Managed Identity
In this article, we will look at what Azure Managed Identities are, how to create them and use them of course.
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