> ## Documentation Index
> Fetch the complete documentation index at: https://docs.niteshift.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure

> Give tasks Azure credentials through Microsoft Entra workload identity federation.

Niteshift obtains and refreshes OIDC tokens for Azure workload identity authentication.

> [!TIP]
>
> Ask the agent in a task to connect Azure. It writes the configuration, walks you through the
> cloud-side setup below, and verifies access. See the [quick
> start](https://docs.niteshift.dev/integrations/overview.md#quick-start).

For the Niteshift configuration, declare the Microsoft Entra tenant ID and the identity's client ID in the
environment's committed `settings.yaml`:

```yaml settings.yaml theme={"dark"}
version: 1
integrations:
  azure:
    tenantId: 11111111-1111-1111-1111-111111111111
    clientId: 22222222-2222-2222-2222-222222222222
```

Run `ns oidc-token --inspect --audience 'api://AzureADTokenExchange'` in the Niteshift terminal tab to see the trust
values without printing the token.

On the app registration identified by `clientId`, add a federated credential with the exact
inspected `iss`, `aud`, and environment-specific `sub`. Microsoft Entra checks all three values
with case-sensitive matching. Replace the placeholders below with the inspected values:

```json theme={"dark"}
{
  "name": "niteshift-environment",
  "issuer": "<inspected-iss>",
  "subject": "<inspected-sub>",
  "audiences": ["<inspected-aud>"]
}
```

The `subject` is the entire inspected `org:<org_id>:environment:<environment_id>` value.
Use a distinct credential name for each environment you authorize. Separately grant the app's
service principal only the permissions it needs on the intended Azure resources. See [Microsoft
Entra's federated credential guide](https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation-create-trust)
for the Azure-side setup.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.