How do you set up an Entra service principal so a tool can read your Fabric workspace?

Register an app in Microsoft Entra ID, which creates its service principal, and give it a client secret or certificate. A Fabric admin then enables service principals in the Fabric tenant settings for a security group containing it, and a workspace admin adds the principal to the workspace under Manage access. The tool signs in with the tenant ID, client ID, and secret.

Key points

  • Registering an application in Microsoft Entra ID automatically creates its service principal; you need at least the Cloud Application Administrator role, per Microsoft Learn checked November 2026.
  • Microsoft recommends a certificate from a trusted authority over a client secret, and shows a new client secret's value only once, when you create it.
  • Fabric's developer tenant setting 'Service principals can call Fabric public APIs' is enabled by default for new customers and is scoped to security groups, so the principal must be in an allowed group; older Microsoft pages and TestGen's docs call it 'Service principals can use Fabric APIs'.
  • A Fabric workspace admin grants the principal a workspace role through Manage access; DataOps TestGen needs Contributor or higher to read lakehouse and warehouse tables through the SQL analytics endpoint.
  • Fabric's SQL connection string accepts only Microsoft Entra identities, and tools such as SQL Server Management Studio 19 and later sign in as a service principal with the client ID as user name and the secret as password.

The step that stalls Fabric data tools isn’t the tool. It’s the identity. Fabric’s SQL endpoints take no SQL logins, so an unattended tool needs an Entra ID service principal, and three different admins usually hold the three permissions it needs.

Here are Microsoft’s documented steps, checked November 3, 2026.

1. Register the app (Entra administrator)

From Register a Microsoft Entra app and create a service principal:

  1. Sign in to the Microsoft Entra admin center as at least a Cloud Application Administrator.
  2. Go to Entra ID > App registrations > New registration. Name it for the tool, such as testgen-fabric-reader, and choose Accounts in this organizational directory only.
  3. From the app’s overview page, copy the Directory (tenant) ID and Application (client) ID.
  4. Under Certificates & secrets, add a credential. Microsoft recommends a certificate from a trusted certificate authority. For a New client secret, pick a duration and copy the value right away: it’s shown only once.

Registering the app creates its service principal. Store the secret in a vault, not in a pipeline file.

2. Allow service principals in Fabric (Fabric administrator)

From Fabric’s developer admin settings:

  1. Create a security group, such as fabric-service-principals, and add the service principal.
  2. In tenant settings, under developer settings, enable Service principals can call Fabric public APIs for that group.

That setting is enabled by default for new customers, but it’s scoped to security groups, so check that your principal’s group is allowed. Older Microsoft pages and TestGen’s docs call it “Service principals can use Fabric APIs.” A separate setting, disabled by default for new customers, lets service principals create workspaces, connections, and deployment pipelines. A read-only tool doesn’t need it.

3. Add it to the workspace (workspace admin)

In the Fabric workspace, choose Manage access, add the service principal, and pick a role. Microsoft’s service principal guide says a workspace Administrator can grant this. Give it the smallest role the tool documents and only the workspaces it should read.

4. Connect the tool

FieldValue
ServerThe workspace’s SQL connection string, port 1433
DatabaseThe lakehouse or warehouse name
AuthenticationMicrosoft Entra service principal
User nameApplication (client) ID
PasswordThe client secret
TenantDirectory (tenant) ID, where the tool asks for it

SQL Server Management Studio 19 and later use exactly these fields. If you get “Authentication was successful, but the database was not found,” check the database name: since May 2026, a connection without one goes to master, per Microsoft’s connectivity page.

For DataOps TestGen

TestGen’s Access Requirements for Microsoft OneLake are the principal from step 1, the tenant setting from step 2, and Contributor or higher on the workspace in step 3. No item-level permissions are needed. TestGen then runs only SELECT statements through the SQL analytics endpoint, against both lakehouse and warehouse tables.

Send your Fabric admin this page with the three asks. Then follow the Fabric warehouse answer or the OneLake setup answer, and install from the Microsoft Fabric or OneLake page. Open source is free for one connection.

Frequently asked questions

Short answers to the follow-up questions people ask next.

Who has to do what to set up a Fabric service principal?

Usually three people. An Entra administrator, at least Cloud Application Administrator, registers the app and creates the secret. A Fabric administrator enables the service principal tenant setting for a security group and adds the principal to that group. A workspace admin adds the principal to the workspace through Manage access with the role the tool needs.

Which Fabric tenant setting do service principals need?

Microsoft's developer settings page, checked November 2026, calls it 'Service principals can call Fabric public APIs', enabled by default for new customers and limited to allowed security groups. Earlier Microsoft pages, and TestGen's Access Requirements, use the older name 'Service principals can use Fabric APIs'. A separate setting covers creating workspaces, connections, and deployment pipelines.

Should I use a managed identity instead?

If the tool runs on an Azure resource that has one, Microsoft recommends it: a managed identity has no secret to store or rotate. DataOps TestGen accepts either a managed identity or a service principal for Microsoft OneLake. A tool running on premises or outside Azure needs the service principal.

Why does my service principal connect but fail on COPY INTO or OPENROWSET?

Microsoft says a SQL connection string sign-in doesn't create the Fabric security token a service principal needs to reach external storage. The first successful Fabric REST API call with that principal creates it, and the token lasts 30 days, so automate a periodic API call. Plain SELECT queries on warehouse tables don't depend on it.

Try it on your own data

DataOps TestGen is free and open source. Profile a table and generate its tests this afternoon.