Azure Managed Identity for Azure resources and Azure VMs
Adding system-managed identity to Azure resources is a straight forward activity: assign the managed identity to a resource and provide permission for this identity to the protected resource.
I am exemplifying here with an Azure function accessing Azure SQL using managed identity.
The Azure function's code required for this to work it is displayed below:
You need to add the following roles in the Azure SQL database:
Running the Azure function will show that it can read and print information from the database.
A more interesting exercise is to configure Azure VMs and set them up to have the code running on them access a SQL Server database located on a different VM in Azure.
This is possible when running a SQL Server 2022 database.
The screen from below shows how this works:
Another way to test this connection:
Note that a single day of work configuring all the resources in Azure cost you around 40$
If you want to learn more about how to configure the whole implementation with VMs, please feel free to contact me on LinkedIn or on my email at: efrunza@hotmail.com
Assoc. Prof. Habil. Dr. (Enseignant-Chercheur, Ma?tre de Conferences des Univ. HDR HC Titulaire), INSA Rennes, France
4 个月Beautiful offre the recognized intelligent nature...