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

# Microsoft Azure

> Connect a Microsoft Customer Agreement billing account, or a CSP partner account through Partner Center, so OPTIMAZE can import Azure cost data.

OPTIMAZE imports Azure billing data in one of two ways, depending on how your organisation buys Azure. Both are read-only, OPTIMAZE reads billing data and does not create or change anything in your Azure tenant or Partner Center.

| How you buy Azure | Choose | How OPTIMAZE connects |
| :- | :- | :- |
| Directly from Microsoft under a **Microsoft Customer Agreement** | **Customer Agreement (MCA)** | An Entra app you register, with the **Billing account reader** role |
| As a **CSP partner or MSP** reselling Azure to your own customers | **Cloud Solution Provider (CSP)** | You sign in with Microsoft and grant read access to Partner Center |

If you buy Azure through a CSP partner rather than being one, use **Customer Agreement (MCA)**, the CSP option is for partners only.

> [!NOTE]
>
> For direct customers, only Microsoft Customer Agreement billing accounts are supported.

To start either, under **Data**, select **Integrations**, then select **Connect** on the **Microsoft Azure** tile and choose the option that matches how you buy Azure.

![Microsoft Azure setup asking you to choose Customer Agreement (MCA) or Cloud Solution Provider (CSP)](https://mintcdn.com/optimaze/1GorH5batRwM9XiF/images/console/azure-choose.png?fit=max\&auto=format\&n=1GorH5batRwM9XiF\&q=85\&s=fe5fa6777c3b7fdf71002c6f209303f9)

## Connect a Customer Agreement (MCA) billing account

### Before you start

* Permission to register an app in **Microsoft Entra ID**.
* The **billing account owner** role on your Microsoft Customer Agreement billing account, which you need to assign roles on it.

![MCA setup step 1, Prepare in Azure, listing the three things to do in Azure](https://mintcdn.com/optimaze/1GorH5batRwM9XiF/images/console/azure-mca-prepare.png?fit=max\&auto=format\&n=1GorH5batRwM9XiF\&q=85\&s=f15143359a1a5d9c1a9ee32ca7396116)

**1. Register an app in Microsoft Entra ID**

In Entra ID, go to **App registrations** > **New registration** and create a single-tenant app, for example *Optimaze billing*. On the app's **Overview** page, copy the **Application (client) ID** and the **Directory (tenant) ID**.

**2. Create a client secret**

In the app, go to **Certificates & secrets** > **New client secret**. Copy the secret's **Value** straight away, Azure only shows it once.

**3. Give the app read access to your billing account**

In the Azure portal, open **Cost Management + Billing** and select your Microsoft Customer Agreement billing account. Go to **Access control (IAM)** > **Add** and assign the **Billing account reader** role to the app. Then open **Properties** and copy the billing account **ID**.

Role assignments can take a few minutes to apply.

**4. Enter the details in OPTIMAZE**

In the OPTIMAZE setup, select **I have these details**, then enter:

| Field | Where to find it |
| :- | :- |
| **Directory (tenant) ID** | Entra ID > **App registrations** > your app > **Overview** |
| **Application (client) ID** | Entra ID > **App registrations** > your app > **Overview** |
| **Client secret** | The secret **Value** from the previous step, not the **Secret ID** |
| **Billing account ID** | **Cost Management + Billing** > your billing account > **Properties** > **ID** |
| **Display name** | Optional, a name for this connection, such as *Azure production* |

The client secret is stored encrypted and never shown again.

**5. Verify and connect**

Select **Verify and connect**. OPTIMAZE checks it can sign in as the app and read your billing account, then saves the integration.

![MCA setup step 2, Connect, with fields for Directory (tenant) ID, Application (client) ID, Client secret and Billing account ID](https://mintcdn.com/optimaze/1GorH5batRwM9XiF/images/console/azure-mca-connect.png?fit=max\&auto=format\&n=1GorH5batRwM9XiF\&q=85\&s=a63ea9a0354bbe566e6f6c3e44678ca7)

## Connect a CSP partner account

Use this if you are a Microsoft CSP partner or MSP. OPTIMAZE imports billing data for all of your customers from Partner Center, so you can report on spend by customer.

### Before you start

* A Microsoft account that is an admin in your partner tenant with access to Partner Center, such as an admin agent or billing admin.
* Multi-factor authentication on that account. Partner Center rejects sign-ins that did not complete MFA, so you will be asked to complete it during sign-in.

### What OPTIMAZE asks Microsoft for

| Permission | What it allows |
| :- | :- |
| **Partner Center** | Read your partner invoices and customer list |
| **Partner billing read** | Export the usage and invoice line items for every customer you bill |
| **Offline access** | Keep the connection working without asking you to sign in again |

![CSP setup step 1, Prepare, listing sign-in requirements and the permissions requested from Microsoft](https://mintcdn.com/optimaze/1GorH5batRwM9XiF/images/console/azure-csp-prepare.png?fit=max\&auto=format\&n=1GorH5batRwM9XiF\&q=85\&s=5167a6652f560ff00861ed8acf889434)

**1. Prepare**

Choose **Cloud Solution Provider (CSP)** and check the requirements on the first screen.

**2. Sign in with Microsoft**

Select **Sign in with Microsoft**, sign in as your partner admin, complete the MFA prompt and approve the permissions above.

**3. Verify and save**

OPTIMAZE confirms the connection and saves the integration.

## What happens next

Cost data appears after the first successful sync. OPTIMAZE converts Azure billing data to the FOCUS standard, the same shape as your other cloud providers, so Azure spend can be attributed, budgeted and compared alongside AWS and Google Cloud. Check the connection from **Manage** on the **Microsoft Azure** tile.

## Revoke access

* **MCA**: delete the client secret or remove the **Billing account reader** role assignment in Azure, or remove the integration in OPTIMAZE.
* **CSP**: disconnect the integration in OPTIMAZE.

## Troubleshooting

* **Verification fails straight after you assign the role.** Role assignments can take a few minutes to apply. Wait, then try again.
* **The client secret is rejected.** Check you copied the secret **Value**, not the **Secret ID**. If you no longer have the value, create a new secret.
* **My billing account is not a Microsoft Customer Agreement.** Only MCA billing accounts are supported for direct customers.
* **CSP sign-in fails.** Check the account is an admin in your partner tenant with Partner Center access, and that it completed MFA.


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