> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/a/azure-ai-foundry.md).

# Azure AI Foundry

Azure AI Foundry hosts AI models and deployments. OctoXLabs lists the model deployments of Azure AI services accounts and the endpoints of Azure Machine Learning workspaces as AI assets, with content filter and rate limit details.

## Use cases

* List every ai asset that Azure AI Foundry contributes to the inventory.

```
Adapters = azure-ai-foundry
```

* Check what one Azure AI Foundry connection collected.

```
Connections = YOUR_CONNECTION_NAME
```

## Before you begin

### Network

| Source              | Destination               | Port | Protocol |
| ------------------- | ------------------------- | ---- | -------- |
| OctoXLabs connector | login.microsoftonline.com | 443  | HTTPS    |
| OctoXLabs connector | management.azure.com      | 443  | HTTPS    |

### Required permissions

| Scope or role                                     | Permission | Needed for                                        |
| ------------------------------------------------- | ---------- | ------------------------------------------------- |
| Microsoft.CognitiveServices (resource path)       | Read       | Accounts, deployments and content filter policies |
| Microsoft.MachineLearningServices (resource path) | Read       | Workspaces and endpoints                          |

The service principal must be granted read access on these two resource providers in the subscription. The exact Azure role name is not given in the source.

## Create credentials in Azure AI Foundry

{% stepper %}
{% step %}

### Get the Tenant ID

In the Azure portal, switch to the right tenant. Under Azure services select **Azure Active Directory** and copy the **Tenant ID** from the **Basic information** section of the Overview.
{% endstep %}

{% step %}

### Get the Client ID

In Azure Active Directory choose **Enterprise applications** > **All applications**, select your application, open **Properties** and copy the **Application ID**.
{% endstep %}

{% step %}

### Create a client secret

In your app registration open **Certificates & secrets**. Under **Client secrets** click **New client secret**, add a description and an expiration, then copy the value. It is shown only once.
{% endstep %}

{% step %}

### Get the Subscription ID

In the Azure portal select **Subscriptions** and copy the **Subscription ID**.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter       | Required | Type    | Default                   | Description                                                                                                                         |
| --------------- | -------- | ------- | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Login URL       | No       | String  | login.microsoftonline.com | Shown in the form. The connector always uses `login.microsoftonline.com` for the token request, so a different value has no effect. |
| Tenant ID       | Yes      | String  | None                      | Azure tenant ID.                                                                                                                    |
| Client ID       | Yes      | String  | None                      | Application (client) ID.                                                                                                            |
| Client Secret   | Yes      | String  | None                      | Client secret value.                                                                                                                |
| Subscription ID | Yes      | String  | None                      | ID of the subscription to read.                                                                                                     |
| HTTPS Proxy     | No       | String  | None                      | Proxy URL, used as the HTTPS proxy value as entered.                                                                                |
| Timeout         | No       | Integer | 30                        | Time in seconds to wait for API responses.                                                                                          |
| Thread Count    | No       | Integer | 32                        | Parallel threads. Minimum 1, maximum 32.                                                                                            |
| Sleep Time      | No       | Integer | 0                         | Delay in seconds between thread batches.                                                                                            |

## Troubleshooting

| Error message                                                          | Cause                                                                  | Fix                                                                                                                                           |
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Status Code: `, followed by the URL, the method and the response body` | The API answered with a status other than the one the adapter expects. | Read the code and body. 401 or 403 usually points to wrong credentials or missing permissions. Check the address, port and Is Secure setting. |

## Change history

{% hint style="info" %}
Available starting from version 6.0.0.
{% endhint %}
