Forum Discussion

bhavya5903's avatar
bhavya5903
Advocate II
1 year ago
Solved

How to connect Fabric SQL Database in VS Code using C# or Python with non-interactive authentication

Hi all,

I’m currently working on a data migration project using VS Code, where the destination is a Microsoft Fabric SQL Database. I'm able to successfully connect and write data using C#, but the authentication is currently happening through interactive login (browser-based prompt) using DefaultAzureCredential.

Instead, I want to authenticate non-interactively, i.e., by passing credentials (client ID, secret, tenant ID, etc.) in the code, so the process can be automated.

Has anyone successfully configured this using either:

  • ClientSecretCredential in C#

  • DefaultAzureCredential/ClientSecretCredential in Python

If yes, could you please share:

  • Which credentials setup is supported by Fabric for this?

  • The right authentication flow and permission requirements for this?

  • Any working code snippet or documentation link?

Thanks in advance!

3 Replies