Join our Newsletter — 33% off our NHI Course
Home› Guides› Azure Managed Identities for Beginners: How Cloud Apps…
Guide Cloud & Workload Identity

Azure Managed Identities for Beginners: How Cloud Apps Get Access Without Passwords

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 1 December 2026 10 min read
On this page

An Azure managed identity is an identity Azure gives an app so it can reach services with no stored password.

This guide is for developers, IT staff and anyone new to Azure. It is also a simple first example of a non-human identity: an identity that belongs to software, not a person.

This is an independent guide from NHI Mgmt Group, based on Microsoft's public documentation as of December 2026. It is not sponsored or reviewed by Microsoft. Product features change, so confirm settings against Microsoft's current documentation.

In short

  • A managed identity lets code running in Azure get a token from Microsoft Entra ID. Nobody handles a password or key.
  • A system-assigned identity belongs to one resource and is deleted with it.
  • A user-assigned identity is a separate resource that can be shared by several resources.
  • No password does not mean no risk. Give each identity only the access it needs, and clean up its role assignments.

What you will learn

  • Explain what a managed identity is and why it replaces stored secrets.
  • Tell system-assigned and user-assigned identities apart.
  • Describe how code gets a token and uses it.
  • Spot the common clean-up and permission mistakes.
Software's own identity (non-human identity)
an identity used by an app, script, workload or AI agent instead of a person.
Short-lived pass (token)
a digital pass from Microsoft Entra ID that proves who the caller is for a limited time.
Permission (role assignment)
a record that gives an identity a role, such as reading a storage account.

What is an Azure managed identity?

Think of a staff lanyard that the building prints for each new office. Nobody has to remember a code. The lanyard works because of where it is.

A managed identity works like that for apps in Azure. You assign it to a resource, such as a virtual machine or an app service. Code on that resource can then ask Microsoft Entra ID for a token [1].

Microsoft says the token request needs no secrets. It is authenticated based on the environment where the code runs. You do not manage the credentials, and you cannot even see them [1].

There are two kinds [1]:

  • System-assigned: created as part of one resource. It cannot be shared, and it is deleted when that resource is deleted.
  • User-assigned: created as its own resource. It can be shared by several resources, and it must be deleted on purpose.

Where the comparison stops working: a lanyard is a physical thing you can lose. A managed identity has no copy to lose, but anyone who can run code on the resource can use it.

For the wider idea across clouds, see Cloud Workload Identities for Beginners.

Why does it matter?

Microsoft notes that handling secrets and certificates by hand is a known source of security issues and outages [1]. Managed identities remove that job, but their access still needs care.

If you write code for Azure

What could happen: you put a storage key in your app settings, and it gets copied far and wide.

Check this: ask whether the service you call accepts Microsoft Entra tokens. If it does, use a managed identity.

Next: Environment Variables and .env Files for Beginners

If you manage Azure access

What could happen: a shared identity has broad roles, so every resource using it gets them too.

Check this: list each identity's role assignments and remove what it does not use.

Next: Azure Permissions for Beginners

If you are new to identity security

What could happen: old role assignments stay behind after an identity is deleted.

Check this: look for role assignments shown as "Identity not found".

Next: Non-Human Identities for Beginners

What does it look like?

Here is a made-up summary of one shared identity and what it can do. Real screens in Azure show the same kind of facts.

Example only. All values are made up.

Name:        EXAMPLE-mi-orders                       (1)
Type:        user-assigned                           (2)
Client ID:   00000000-0000-0000-0000-000000000000    (3)
Used by:     EXAMPLE-app-orders, EXAMPLE-func-orders (4)
Role:        Storage Blob Data Reader, one container (5)
Owner:       FAKE-team-orders                        (6)
  1. The identity's name in Azure.
  2. This kind lives on after the apps that use it are gone.
  3. In a real file, this line would contain the identity's ID. It is not a secret.
  4. Two apps share this identity, so both get what it can do.
  5. It can read one folder of files, not the whole account.
  6. A named team that answers for this identity.

Why this is risky: if this identity had wide access, each app that uses it would have that wide access too.

The safer way: keep its access small, list each app that uses it, and give it a named owner.

How does it work?

  1. Turn it on. Enable a system-assigned identity on a resource, or create a user-assigned one and attach it. Either way, Azure creates a special kind of service principal in Microsoft Entra ID [1].
  2. Grant access. Give the identity a role on the service it needs, using Azure role-based access control [1].
  3. Get a token. Code on the resource uses a Microsoft library to ask Entra ID for a token. No secret is needed [1].
  4. Call the service. The code sends the token to any service that supports Microsoft Entra authentication [1].
  5. Watch and clean up. Sign-ins appear in Entra ID sign-in logs [1]. When an identity is deleted, remove its role assignments by hand [2].
Diagram titled System-assigned and user-assigned managed identities. Two rows. Top row, system-assigned: one App box with its own identity inside it, an arrow to Microsoft Entra ID which returns a token, then an arrow to Storage. A note says it is deleted with the app and cannot be shared. Bottom row, user-assigned: two App boxes both pointing to one shared identity box, then to Microsoft Entra ID and Storage. A note says it lives on its own, can be shared, and must be deleted on purpose. A footer says role assignments are not removed automatically in either case.
Figure 1. The two kinds of managed identity, side by side.

Microsoft gives simple rules for choosing. Use system-assigned when each resource needs its own permissions and you want them removed with the resource. It also shows which exact resource did something in the logs [2].

Use user-assigned when many resources do the same job and need the same access. It also suits access that must exist before a resource is deployed [2].

Tokens are cached for around 24 hours. A change to roles or groups can take several hours to take effect [2].

A worked example

This story is made up to show the idea.

Quinn Lindahl builds a small web app in Azure for a charity. The app saves uploaded forms to a storage account. The first version kept the storage key in the app settings.

Sana Yilmaz, who looks after the charity's Azure account, asks Quinn to remove the key. Quinn turns on a system-assigned managed identity for the web app.

Sana gives that identity one role: write access to the single container for forms. She does not give it access to the whole storage account.

Quinn changes the code to use the Azure Identity library. The app now asks for a token at run time. The storage key is deleted from the settings and then changed, so old copies no longer work.

Months later the charity adds a second app that writes to the same container. Quinn creates a user-assigned identity and attaches it to the second app.

When the charity retires the first app, Sana deletes it. Its system-assigned identity goes with it. She then checks the container's access list and finds a role assignment marked "Identity not found". She removes it.

Quinn and Sana learned that a managed identity removes the password. It does not remove the need to keep access narrow and tidy.

Myths and mistakes

What people thinkWhat is true
No password means no risk.Anyone who can run code on the resource can use its identities and all their permissions.[2]
Deleting the identity removes its access everywhere.Role assignments are not deleted automatically. Remove them by hand.[2]
A role change takes effect straight away.Tokens are cached for around 24 hours, so changes can take several hours.[2]
Managed identities cost extra.Microsoft says they can be used at no extra cost.[1]
Sharing one identity is always simpler.Every resource using it gets all its permissions, so share only between resources doing the same job.[2]

What can I do this week?

  • Find one app that keeps a key in its settings. Check if the service it calls takes Entra tokens.
  • List what one managed identity can do, and remove what it does not need.
  • Look for old access marked "Identity not found" and remove it.
  • Write down an owner for each user-assigned identity.

Checklist

  • Apps use managed identities instead of stored keys where the service supports Entra tokens.
  • Each identity holds only the roles it needs, at the narrowest scope.
  • Shared identities are used only by resources doing the same job.
  • Few people can run code on resources that hold powerful identities.
  • Role assignments are removed when an identity is deleted.
  • Each user-assigned identity has a named owner.
  • Sign-in logs for managed identities are kept and checked.

Common questions

Is a managed identity the same as a service principal?

Not quite. Each managed identity comes with a special kind of service principal in Entra ID. The big change is who looks after the secret behind it. Azure does, and you never see it.[1]

Should I pick system-assigned or user-assigned?

Pick system-assigned when one app needs its own access that should go when the app goes. Pick user-assigned when many apps do the same job, or need access ready first. Microsoft says user-assigned fits more cases.[2]

Can a managed identity be used outside Azure?

It is given to things that run in Azure, such as virtual machines and app hosts. Its tokens can reach any service that accepts Entra sign-in, even your own apps. Microsoft keeps a list of the Azure services that do.[1]

Why has my new permission not worked yet?

Tokens are kept for around 24 hours. Microsoft says a change to roles or groups can take several hours to apply. You cannot force a new token early, so plan changes ahead.[2]

Are managed identities non-human identities?

Yes. They are used by software, not people. Like other non-human identities, such as AI agents, they need an owner, small access and a regular check. That is true even though no one types a password.

Where next?

Ready for the detail? Read the practitioner guide: Service Principals vs Managed Identities. It explains when to use each and how they differ in practice.

Also useful:

Related NHI Mgmt Group resources: Non-Human Identities for Beginners, How to Find Over-Privileged Azure Managed Identities and Blast Radius for Beginners.

Key terms

Non-human identity (NHI)
A digital identity given to software, such as an app, service account, API key, bot, workload or AI agent, rather than to a person.
Managed identity
A cloud-managed identity given to a compute resource, so it can authenticate to services without stored credentials.
System-assigned managed identity
A managed identity tied to one Azure resource and deleted with it.
User-assigned managed identity
A managed identity created as its own Azure resource, which can be shared by several resources.
Service principal
An identity object in Microsoft Entra ID that represents an app in a tenant and holds its permissions.
Blast radius
How much damage could follow if a specific identity or credential were misused.

Sources and further reading

  1. Microsoft, "What are managed identities for Azure resources?", Microsoft Learn. https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview (accessed 1 Dec 2026).
  2. Microsoft, "Managed identity best practice recommendations", Microsoft Learn. https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/managed-identity-best-practice-recommendations (accessed 1 Dec 2026).

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.