Skip to content

[QUESTION] Can I auth jdbc with service principal id and certificate(either a file or path)? #1666

@jiahh-ms

Description

@jiahh-ms

Question

Hi,

I'm working on connect sql database with jdbc using service principal auth, and exploring if we can use a certificate instead of secret.

In this doc page it says it needs a SP id and a secret when the auth type is setting to SP.
I verified this option works and now trying to see if we can connect sql db using jdbc with SP id and a certificate, from either a path or binary content. The SP is from a AAD app I created and cert is created from a AKV signed by me. I'm trying to upload the cert to the AAD app and use this access sql db.

Can some one please tell me if this is supported and how?

And we are doing this this because we are trying to mimic how a AAD app use MSI to connect to SQL.
I created a Azure VM and I'm able to use the MSI created by VM to access SQL.
But I'm not sure on a random machine how can a AAD app get this MSI and use it to connect SQL with jdbc.

If you know the answer for either please let me know. Thank you!

Regards,
Jiaheng He

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementAn enhancement to the driver. Lower priority than bugs.QuestionUsed when a question is asked, as opposed to an issue being raised

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions