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

# Microsoft Azure

> Learn how to connect Microsoft Azure to Pelanor, for automatic billing data ingestion.

Follow the steps below to enable detailed billing export on Microsoft Azure—a prerequisite for ingesting Azure data into Pelanor.

<Info>
  These instructions reference the <a href="https://learn.microsoft.com/en-us/azure/cost-management-billing/costs/tutorial-export-acm-data?tabs=azure-portal" target="_blank">classic exports experience</a>.\
  If you use the <a href="https://learn.microsoft.com/en-us/azure/cost-management-billing/costs/tutorial-improved-exports" target="_blank">improved exports experience</a>, the UI differs slightly—**select CSV, not Parquet**. Pelanor currently supports **CSV** only.
</Info>

***

## Access Control

### 1. Create a Service Principal

<Steps>
  <Step title="Register a new application">
    1. Sign in to the **Azure Portal**.
    2. Go to **Azure Active Directory → App registrations → New registration**.
    3. Enter **Pelanor Service Principal** for the app name and click **Register**.
  </Step>

  <Step title="Save identifiers">
    Copy the **Application (Client) ID** and **Directory (Tenant) ID** for later.
  </Step>
</Steps>

### 2. Set Up Password Authentication

<Steps>
  <Step title="Create a secret">
    1. In the service principal’s page, open **Certificates & Secrets**.
    2. Click **New client secret**.
    3. Add a description (e.g., *Pelanor Integration Key*) and select an expiry period.
  </Step>

  <Step title="Copy secret value">
    Click **Add** and immediately copy the **Value**.
  </Step>
</Steps>

### 3. Grant Recommendation Permissions

<Info>
  This step is only required for displaying Azure Opportunities (optimization recommendations) within the Pelanor platform.
</Info>

Assign the following built‑in roles **at the subscription scope** to the Pelanor service principal.

<Steps>
  <Step title="Open Access Control (IAM)">
    1. In the Azure Portal, navigate to **Subscriptions** and select the target subscription.
    2. Click **Access Control (IAM)**.
  </Step>

  <Step title="Assign Advisor Recommendations Contributor">
    3. Click **Add → Add role assignment**.
    4. In the **Role** tab, search for **Advisor Recommendations Contributor (Assessments and Reviews)**, select it, and click **Next**.
    5. Under **Members**, choose **Select members**, pick the *Pelanor Service Principal*, then **Review + assign**.
  </Step>

  <Step title="Assign Compute Recommendations Role">
    6. Repeat the previous step, but this time select **Compute Recommendations Role**.
    7. Select the Pelanor principal again and **Review + assign**.
  </Step>
</Steps>

***

## Storage Setup

### 1. Create or Modify a Storage Account

<Steps>
  <Step title="Create a new storage account">
    1. Go to **Storage Accounts → Create** in the Azure Portal.
    2. Select your subscription and provide a unique **Storage Account Name**.
    3. Click **Create**.
  </Step>
</Steps>

<Info>
  Save the **Storage Account Name** for later.
</Info>

### 2. Grant Access to the Pelanor Service Principal

<Steps>
  <Step title="Assign the Storage Blob Data Reader role">
    1. Open the storage account and go to **Access Control (IAM)**.
    2. Click **Add → Add role assignment**.
    3. Select the role **Storage Blob Data Reader**.
  </Step>

  <Step title="Select the Pelanor principal">
    4. Under **Members**, click **Select members** and find the Pelanor Service Principal.
    5. Click **Review + assign** to finalize.
  </Step>
</Steps>

***

## Billing Export Setup

### 1. Create Billing Exports

<Steps>
  <Step title="Create two daily exports">
    1. Navigate to **Cost Management + Billing → Exports**.
    2. Create two **daily** exports:
       * **Actual Cost**
       * **Amortized Cost**
  </Step>

  <Step title="Configure file format and paths">
    3. In the export configuration wizard:
       * **File format** → **CSV** (update if default is Parquet)
       * Enter **Container Name**, **Subscription ID**, **Directory Path**, and **Export Name**
  </Step>
</Steps>

<Warning>
  Ensure **CSV** is selected. Parquet is not supported by Pelanor at this time.
</Warning>

### 2. Register the Integration in Pelanor

<Steps>
  <Step title="Open Pelanor Integrations">
    Go to **Integrations → Add Integration → Azure** in Pelanor.
  </Step>

  <Step title="Enter authentication and storage details">
    Provide the following:

    * **Application (Client) ID**
    * **Directory (Tenant) ID**
    * **Client Secret**
    * **Storage Account Name**
    * **Container Name**, **Subscription ID**, **Directory Path**, **Export Name**
  </Step>

  <Step title="Save the integration">
    Click **Save** to complete setup.
  </Step>
</Steps>

<Info>
  It may take several hours for initial data to appear.\
  Billing data for the current and previous month may take up to 24–48 hours to fully propagate.
</Info>
