> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/fabricate/workspaces/workspace-service-principals.md).

# Configuring available Azure service principals for a workspace

For authentication to a PostgreSQL, MySQL, or SQL Server server connection, you can choose to use an Azure service principal instead of a password.

You configure the available service principals from the **Azure Service Principals** section of the workspace settings page.

<figure><img src="/files/m6tZutRHVnx3JEctQCgQ" alt=""><figcaption><p>Azure Service Principals section of the workspace settings page</p></figcaption></figure>

## Adding a service principal <a href="#service-principal-add" id="service-principal-add"></a>

To add a service principal:

1. Click **Add Azure Service Principal**.

<figure><img src="/files/svVmzfKB1SJfYctrV7vS" alt=""><figcaption><p>Add Azure Service Principal panel to add a service principal</p></figcaption></figure>

2. In the **Name** field, provide a name for the service principal.
3. In the **Tenant ID** field, provide your Microsoft Entra tenant identifier.
4. In the **Client ID** field, provide the application identifier of the service principal
5. In the **Client Secret** field, provide the client secret.
6. Optionally, in the **Note** field, provide a description of how the service principal is intended to be used.
7. To test the service principal, click **Test**.
8. To save the service principal, click **Save**.

## Mapping the service principal to a Microsoft Entra user <a href="#service-principal-user-map-user" id="service-principal-user-map-user"></a>

When you use a service principal as the authentication method for a server connection, you must provide a username.

In your Azure database, create a Microsoft Entra user that is mapped to the service principal.

Grant the user the required permissions.

## Editing a service principal <a href="#service-principal-edit" id="service-principal-edit"></a>

To edit an existing service principal:

1. Click the edit icon for the service principal
2. Update the service principal configuration.
3. Click **Save**.

## Deleting a service principal <a href="#service-principal-delete" id="service-principal-delete"></a>

You cannot delete a service principal that is currently used by a server connection.

To delete a service principal, click its delete icon.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tonic.ai/fabricate/workspaces/workspace-service-principals.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
