Overview
This tech blog post will discuss how m-Power customers using a SQL Server datasource may authenticate to said via Microsoft Entra, formally known as Azure Active Directory (AAD).
Traditionally, the datasource connection is made via SQL Authentication, however if wanting to use Microsoft Entra instead when connecting to SQL Server, this post will pertain to you.
Implementation
- Download the necessary JAR files from here.
- Extract the jars from the zip file and place all of them in …/m-power/tomcat/lib
- Edit the /mrcjava mrc-spring-context.xml file in Admin -> Datasources -> Runtime Datasources.
- Create a new datasource for SQL Server. The URL will need to look similar to this:
Please change the appropriate values, such as the port number, database name, and any other details as needed.jdbc:sqlserver://myservername.database.windows.net:1433;databaseName=mpower;authentication=ActiveDirectoryPassword;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net
- Set the username and password appropriately.
- Make sure your dictionary’s Datasource Connector property is pointing to this new datasource bean.
- Restart Tomcat.
- Verify the runtime application can successfully connect to your SQL Server.