> 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="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2F7N9z5rpmuBV0VB4O56tD%2FWorkspace_AzureServicePrincipals.png?alt=media&amp;token=c7d37811-f4cc-472f-8799-9694d963ccea" 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="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FjANRAgKXQKnXYOAga3Bl%2FWorkspace_AddAzureServicePrincipal.png?alt=media&amp;token=8e6133a9-3831-40fb-b676-303b7e8636e2" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
