> 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/m/microsoft-dns.md).

# Microsoft DNS

Microsoft DNS here means Azure Private DNS. OctoXLabs lists the private DNS zones of one Azure subscription and adds them to the inventory.

## Use cases

* List the private DNS zones returned by the adapter.

```
Adapters = microsoft-dns
```

## Before you begin

### Network

| Source              | Destination                                                | Port | Protocol |
| ------------------- | ---------------------------------------------------------- | ---- | -------- |
| OctoXLabs connector | login.microsoftonline.com                                  | 443  | HTTPS    |
| OctoXLabs connector | management.azure.com (or the host in the Domain parameter) | 443  | HTTPS    |

### Required permissions

| Scope or role                           | Permission | Needed for                          |
| --------------------------------------- | ---------- | ----------------------------------- |
| Reader (Azure RBAC, subscription scope) | Read       | `Microsoft.Network/privateDnsZones` |

The required role is not stated in the frontend instructions. Reader on the subscription is the usual way to list resources, but this is not verified.

## Create credentials in Microsoft DNS

{% stepper %}
{% step %}

### Copy the tenant ID

In the Azure Portal, open Azure Active Directory > Properties and copy the Directory (tenant) ID.
{% endstep %}

{% step %}

### Register an application

Under App registrations, register an app and copy the Application (client) ID.
{% endstep %}

{% step %}

### Create a client secret

In the app, open Certificates & secrets > New client secret and copy the secret value. It is shown only once.
{% endstep %}

{% step %}

### Copy the subscription ID

Under Subscriptions, copy the ID of the subscription that holds the DNS resources.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                           | Required | Type   | Default              | Description                                |
| ----------------------------------- | -------- | ------ | -------------------- | ------------------------------------------ |
| Domain (`domain`)                   | No       | String | management.azure.com | API host.                                  |
| Tenant ID (`tenant_id`)             | Yes      | String |                      | Directory (tenant) ID.                     |
| Client ID (`client_id`)             | Yes      | String |                      | Application (client) ID.                   |
| Client Secret (`client_secret`)     | Yes      | String |                      | Client secret value.                       |
| Subscription ID (`subscription_id`) | Yes      | String |                      | Subscription that holds the DNS resources. |
| API Version (`api_version`)         | No       | String | 2018-09-01           | Azure Private DNS API version.             |

## Troubleshooting

| Error message | Cause | Fix                                    |
| ------------- | ----- | -------------------------------------- |
| Not verified  |       | No adapter-specific error text in code |

## Change history

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