Skip to main content

Demystifying system-assigned managed identity and user-assigned managed identity for Azure Resources


Managing credentials and access rights across services it is always a challenge inside the cloud. Storing them inside the applications can be painful, even when they are encrypted. Managing all of them from one central location can be done quickly using managed to identify feature build on top of Azure AD.

Because it is so easy to see and the number of features is high, many people forget to understand better what option they should use depending on the use case. Let’s take a look at some questions that you should ask yourself when you need to manage the identity of cloud services inside Azure.

Q: What is the username password when I’m using user-assigned manage identity
R: When you create a user-assigned managed identity, there is no used as you have for Azure AD. Even if the name contains the word ‘user’, it does not mean that you manage a user. You have an identity that can be operated independently of the service instance that receives the identity.

Q: I want to be able to assign the same identity to multiple resources – configure one time and use in multiple places. What shall I use?
R: In this case, you need to use a user-assigned managed identity. Once the identity is created, you can assign it to multiple services. Remember that system-assigned managed identity is created and assigned from the beginning to a single instance. It is deleted automatically at the moment in time when the instances are deleted. For example, a system-assigned identity that provides access for an Azure Web App to Azure Key Vault will exist as long as the instance of the Azure Web App exist. At the moment in time when the Azure Web App is deleted, the identity it is also removed with all other information that exists in the Azure Key Vault access management and Azure AD.

Q: What is the lifecycle of the user-assigned managed identity?
R: The lifecycle is fully managed by you. You are the one that decide when the identity is deleted and can exist even when there are no Azure services instances assigned to it.

Q: What is the no. of Azure services that I can assign to user-assigned managed identity?
R: 0 to N. There is no limitation from this point of view. In comparison, system-assigned managed identity can be assigned to only one Azure service instance and cannot be defined without being attached to an instance. This is why user-assigned managed identities are seen as a stand-alone Azure resource, in comparison with the other ones that are part of the Azure service instance.

Q: When I shall use system-assigned managed identity?
R: This kind of identity is used with success when the identity is required by only one service. For example, you have only one Azure App Service or Azure Function that needs specific access rights. When you need to assign the identity for multiple services, user-assigned managed identity is the answer.

Q: What are managed identities?
R: Behind the scene, managed identities are service principals of a special type. They can be used only for Azure resources, and their life-cycle is around them.

Q: How does the system-assigned managed identity works?
R: When you assigned a managed identity, the Azure Resource Manager (ARM) would go to IMDS and assign the managed identity to the specific resource. Once the identity is attached to the resource, the Azure AD will 'connect' a role to the resource service principal. From that one, the resource can request an access token from IMDS endpoint that is used to access specific resources. The user-assigned managed identity is similar, with some small expectation because the life-cycle of the managed identity is outside the resource boundary. 

Comments

Popular posts from this blog

Why Database Modernization Matters for AI

  When companies transition to the cloud, they typically begin with applications and virtual machines, which is often the easier part of the process. The actual complexity arises later when databases are moved. To save time and effort, cloud adoption is more of a cloud migration in an IaaS manner, fulfilling current, but not future needs. Even organisations that are already in the cloud find that their databases, although “migrated,” are not genuinely modernised. This disparity becomes particularly evident when they begin to explore AI technologies. Understanding Modernisation Beyond Migration Database modernisation is distinct from merely relocating an outdated database to Azure. It's about making your data layer ready for future needs, like automation, real-time analytics, and AI capabilities. AI needs high throughput, which can be achieved using native DB cloud capabilities. When your database runs in a traditional setup (even hosted in the cloud), in that case, you will enc...

Cloud Myths: Migrating to the cloud is quick and easy (Pill 2 of 5 / Cloud Pills)

The idea that migration to the cloud is simple, straightforward and rapid is a wrong assumption. It’s a common misconception of business stakeholders that generates delays, budget overruns and technical dept. A migration requires laborious planning, technical expertise and a rigorous process.  Migrations, especially cloud migrations, are not one-size-fits-all journeys. One of the most critical steps is under evaluation, under budget and under consideration. The evaluation phase, where existing infrastructure, applications, database, network and the end-to-end estate are evaluated and mapped to a cloud strategy, is crucial to ensure the success of cloud migration. Additional factors such as security, compliance, and system dependencies increase the complexity of cloud migration.  A misconception regarding lift-and-shits is that they are fast and cheap. Moving applications to the cloud without changes does not provide the capability to optimise costs and performance, leading to ...

Cloud Myths: Cloud is Cheaper (Pill 1 of 5 / Cloud Pills)

Cloud Myths: Cloud is Cheaper (Pill 1 of 5 / Cloud Pills) The idea that moving to the cloud reduces the costs is a common misconception. The cloud infrastructure provides flexibility, scalability, and better CAPEX, but it does not guarantee lower costs without proper optimisation and management of the cloud services and infrastructure. Idle and unused resources, overprovisioning, oversize databases, and unnecessary data transfer can increase running costs. The regional pricing mode, multi-cloud complexity, and cost variety add extra complexity to the cost function. Cloud adoption without a cost governance strategy can result in unexpected expenses. Improper usage, combined with a pay-as-you-go model, can result in a nightmare for business stakeholders who cannot track and manage the monthly costs. Cloud-native services such as AI services, managed databases, and analytics platforms are powerful, provide out-of-the-shelve capabilities, and increase business agility and innovation. H...