Skip to main content
14-Alexandrite
August 26, 2025
Question

How to connect Azure SQL server with Service Principal

  • August 26, 2025
  • 2 replies
  • 625 views

Dear Developers,

 

we have a database in Azure and need to connect thingworx with the database.

we cannot use a SQL local account for the connection due to security perspective.

 

we have a service principal and confirmed we can connect with the database via the service principal.

 

I want to know how to create a thing which can connect with the SQL by using the service principal.

 

what thingtemplate do we need to use ?

what connection string do we need to use to specify the authentication mode ?

is it ok to put client ID as user name and secret key as password ?

 

 

2 replies

18-Opal
August 27, 2025

Hello @Yoshihiko.N,

 

You can provide authentication=ActiveDirectoryServicePrincipal JDBC connection string parameter, and use your client ID as the username and the service principal's secret as the password. See MS docs: https://learn.microsoft.com/en-us/sql/connect/jdbc/setting-the-connection-properties

 

You can find information about how to create a database Thing in Help: https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Extensibility/jdbc_extension.html

 

Just wrap your Azure SQL JDBC driver in an extension, as this article explains, and specify your normal JDBC connection string, as you'd do with any other web app.

 

/ Constantine

Support
September 10, 2025

Hi @Yoshihiko.N 

 

It appears that a response has been provided that answers your question.  For the benefit of other Community Members who may have the same question, it would be great if you could designate it as the Accepted Solution.

In the event that this response did not answer your question, please post your current status so that we can continue to support.

Thanks for using the PTC Community!

Regards,

--Sharon