This is a maven project with a sample java application that aims to showcase the use of managed identities in Azure by accessing an Azure SQL Database from am Virtual Machine in Azure.
It is based in this turorial from Microsoft : Tutorial: Use a Windows VM system-assigned managed identity to access Azure SQL
This simple application accesses a sample Azure SQL Database. It should be executed from a VM with a managed identity.
Steps:
- Deploy an Azure VM of your choice and enable system-managed identity (see here )
- Create an Azure SQL Database and grant access to your VM as described here
- Access the data by running the sample application from the VM: e.g. by running:
mvn compile exec:java -Dexec.mainClass="mi.AzMiSample"
Related resources: