Microsoft Azure Managed Identity is a service that provides Azure resources with an automatically managed identity in Azure Active Directory (Azure AD). You can use this identity to authenticate to any service that supports Azure AD authentication, without having to manage credentials.
Key Features of Azure Managed Identity
- Credential Management
- Azure handles the lifecycle of these identities, ensuring that credentials are automatically managed and rotated.
- Two Types of Managed Identities
- System-assigned Managed Identity: Automatically created when enabled on an Azure service instance. The lifecycle is tied to the lifecycle of this Azure service instance.
- User-assigned Managed Identity: Created as a standalone Azure resource, independent of any particular service. It can be assigned to multiple Azure service instances.
Benefits
- Security: Eliminates the need for hardcoded credentials in application code.
- Ease of Use: Simplifies access to Azure resources by providing a straightforward and secure method of authentication.
- Automatic Handling: Credentials are managed and rotated by Azure, reducing the administrative overhead.
Use Cases
- Accessing Azure Key Vault: Retrieve secrets without storing sensitive credentials in code.
- Connecting to Azure SQL Database: Authenticate and access databases securely.
Use Managed Identity in Azure Function
We have a Python program that would fetch the data from GraphQlAPI and place the file in Azure blob Storage and it would be stored with the help of Managed Identity.
Code that would be used to achieve the Managed Identity Authentication.
We also need to switch on the identity option of Function App so that it can have a ID that would get a System Managed Identity access on Storage.
![Function App]()
Post We need to provide it access to a storage account which we can do from the Azure storage account giving it RBAC.
![RBAC]()
This would help your Azure function to connect to a storage account without a SAS Token.