# Connect to Azure AI Foundry

Connect your Azure subscription to Finora to track Azure OpenAI Service and AI Foundry deployments.

> **Before you start**
>
> * You need the **Cost Management Reader** role (or higher) on the Azure subscription you want to connect.
> * This integration uses Azure's secure service-to-service authentication, so your administrator may need to do a one-time setup. If you're not sure, ask your Azure admin to confirm — see the note in Step 2.

## Overview

You'll tell Finora which Azure subscription and resource group to read costs from. Behind the scenes, Finora uses Azure's secure managed-identity authentication — that means there's no password or secret for you to paste. Just two identifiers: your Subscription ID and your Resource Group name.

## Step 1: Find your Subscription ID and Resource Group

1. Sign in to the [Azure Portal](https://portal.azure.com).
2. Open **Subscriptions** and copy the **Subscription ID** of the subscription containing your AI Foundry / Azure OpenAI resources. It's a long ID that looks like `a1b2c3d4-1111-2222-3333-444455556666`.
3. Open **Resource groups** and find the resource group with your AI resources. Copy its **name** (case-sensitive — for example, `rg-ai-prod`).

> **Why a resource group instead of the whole subscription?** Pointing Finora at a specific resource group means it only sees your AI workload spend, not unrelated Azure costs (storage, networking, etc.) that might live in the same subscription.

## Step 2: Make sure Finora can read your subscription

This is a one-time setup that your Azure administrator does for the subscription. They need to grant Finora's service identity the **Cost Management Reader** role on the subscription. Most workspaces have this set up before any user starts connecting providers.

If you're an Azure admin yourself, your support contact at Finora can give you the specific identity to grant the role to.

## Step 3: Connect Azure to Finora

1. In Finora, click **Settings** in the sidebar, then open the **API Keys** tab.
2. From the **Provider** dropdown, choose **Azure AI Foundry**.
3. Fill in:
   * **Subscription ID** — the GUID from Step 1
   * **Resource Group** — the name from Step 1
4. Click **Save**.

Finora makes a test cost lookup to confirm everything works. On success, Azure AI Foundry appears in your connected providers list.

## What Finora tracks for Azure AI Foundry

* Total cost converted to USD
* Date of each charge
* Which Azure resource was billed (e.g. an Azure OpenAI deployment)
* Resource group and subscription context

Costs are returned in your subscription's billing currency and converted to USD using the daily exchange rate.

## FAQs

**Why no API key field?** Azure has a more secure way for services to read each other's data — there's no key for you to manage, rotate, or worry about leaking. Your administrator grants Finora's service the Cost Management Reader role once, and that's it.

**Can I connect more than one subscription?** For now, one subscription per user. Multi-subscription support is on our roadmap.

**Will Finora see costs outside the resource group I picked?** No. Finora is scoped strictly to the resource group you provide. Costs in other resource groups are not visible.

**Saving failed with `AuthorizationFailed`. What's wrong?** The setup in Step 2 isn't done yet, or the role assignment hasn't propagated yet. Wait 5 minutes and try again. If it still fails, check with your Azure admin that Finora's service identity has Cost Management Reader on the subscription.

**Saved successfully but the data is empty.** Azure can take up to 24 hours to publish the most recent day's costs. Wait one full day after saving before troubleshooting an empty dashboard.

## Removing the integration

Open **Settings → API Keys**, find the Azure AI Foundry row, click the trash icon, and confirm. Your subscription and resource group settings are removed. The role assignment in Azure isn't affected — your admin can revoke it from the subscription if Finora was the only consumer.


---

# Agent Instructions: 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:

```
GET https://docs.finora.services/billing-integrations/ai-providers/connect-to-azure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
