This guide walks you through creating a Microsoft Entra application, assigning Azure RBAC roles,
and gathering the values needed to create an Azure Network Security integration with Synqly.
Azure Network Security integrates Network Watcher flow logs and DNS query logs from DNS resolver
policies and Azure Firewall with Synqly.

Flow logs are read from Azure Blob Storage. Flow logs sent only to Log Analytics (traffic
analytics) are not supported.

DNS query logs are read from a storage account or a Log Analytics workspace. DNS logs sent only to
an event hub or a partner solution can't be read.

Prefer virtual network (VNet) flow logs for new setups. Network security group (NSG) flow logs are
still readable when already configured, but Azure blocked creating new NSG flow logs as of June 30,
2025, and plans to retire them on September 30, 2027; migrate to VNet flow logs when possible. See
[Migrate from NSG flow logs to VNet flow logs](https://learn.microsoft.com/en-us/azure/network-watcher/nsg-flow-logs-migrate).

## Prerequisites

Before you begin, ensure that you have:

- Access to the [Microsoft Entra admin center](https://entra.microsoft.com/) with the Application
Developer role (or other permissions that allow creating an app registration)
- Access to an Azure subscription with logging turned on for the traffic you want to monitor:
  - **Flow logs**: Network Watcher VNet or NSG flow logs writing to an Azure Storage account
  - **DNS logs**: a diagnostic setting on a DNS resolver policy or Azure Firewall that collects
its DNS log category and sends it to a storage account or Log Analytics workspace
- Permission to assign Azure RBAC roles to a service principal


## Required Permissions

| Role | Assign it on | Purpose |
|  --- | --- | --- |
| Reader | The subscription | Discover Network Watcher flow logs, DNS resolver policies and Azure Firewalls, and read their diagnostic settings |
| Storage Blob Data Reader | Each storage account that receives flow logs or DNS logs | List and download log blobs |
| Log Analytics Reader | Each Log Analytics workspace that receives DNS logs | Query DNS logs in the workspace. Not needed if your DNS logs go only to storage |


Reader on a storage account alone is not enough to download blobs. Storage Blob Data Reader is
required on the storage account or its container.

## Choose which logs to read

Two optional settings decide which logs the integration reads. Most integrations leave both empty.
The integration then reads every flow log and all DNS query logging in the subscription.

If a resource doesn't appear in the portal, check the directory shown in the top right. Select the
gear icon, then **Directories + subscriptions**, and switch to the directory that owns your
subscription.

Flow Log Resource IDs
This setting is a filter. It does not add logs. It limits the integration to the flow logs you
list. Leave it empty to read every flow log in the subscription.

Each entry is the full resource ID of a flow log:

`/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Network/networkWatchers/{networkWatcher}/flowLogs/{name}`

A flow log name alone is not accepted, because the same name can exist under different Network
Watchers. The portal does not show this ID in one place. Use any of the options below to get it.

#### Option 1: List every flow log ID with Cloud Shell

1. In the [Azure portal](https://portal.azure.com), select the **Cloud Shell** icon (`>_`) in the
top bar, and choose **Bash**.
2. If you have more than one subscription, select the one you set in the integration (see
[Find your subscription ID](#4-find-your-subscription-id)):
az account set --subscription {subscriptionId}
3. Run:
az resource list --resource-type Microsoft.Network/networkWatchers/flowLogs --query "[].id" --output tsv


Each line is a flow log's resource ID, ready to enter.

#### Option 2: Build the ID from the portal

1. In the Azure portal, search for **Network Watcher** and open it.
2. In the left navigation, under **Logs**, choose **Flow logs**. This page lists every VNet and
NSG flow log in the subscriptions selected in its filters.
3. For each flow log you want, note its **Resource group**.
4. Choose the flow log's **Name** to open its settings. The title at the top of the panel is
`{networkWatcher}/{name}`, for example `NetworkWatcher_eastus/prod-vnet-flow-log`.
5. Fill in the ID above with your **Subscription ID** (see
[Find your subscription ID](#4-find-your-subscription-id)), the **Resource group** from step 3,
and the Network Watcher and flow log names from step 4. For example:
`/subscriptions/1111-2222/resourceGroups/NetworkWatcherRG/providers/Microsoft.Network/networkWatchers/NetworkWatcher_eastus/flowLogs/prod-vnet-flow-log`


#### Option 3: Copy IDs from the integration

If you've already created the integration with this field empty, run
**Query Traffic Log Configurations**. Each result's `metadata.uid` is a flow log ID, ready to
enter. Leave out results whose `unmapped.queryable` is `false`: those flow logs are turned off or
have no storage account, so they can't be read.

#### Check your entries

Each entry must be in the subscription you set in the integration. An entry that does not match a
flow log makes flow log queries fail with an error.

DNS Log Configuration IDs
This setting is a filter. It does not add logs. It limits the integration to the DNS logging you
list. Leave it empty to read all DNS logging in the subscription.

#### How DNS log configuration IDs work

Azure has no single resource for DNS logging. DNS query logs come from a **diagnostic setting** on
a DNS resolver policy or an Azure Firewall, so a DNS log configuration ID is not shown anywhere in
the portal. You build it from two values, joined by `|`:

`{resourceId}|{category}`

- **resourceId**: the resource ID of the DNS resolver policy or Azure Firewall
- **category**: the DNS log category the resource's diagnostic setting collects


| Resource | Category shown in the portal | Category to enter |
|  --- | --- | --- |
| DNS resolver policy (also called a DNS security policy) | DNS Response | `DnsResponse` |
| Azure Firewall | Azure Firewall DNS query | `AZFWDnsQuery` |
| Azure Firewall | Azure Firewall DNS proxy (legacy) | `AzureFirewallDnsProxy` |


An ID names a resource and a category, not a diagnostic setting. Don't use a diagnostic setting's
name in the ID. If a resource has several diagnostic settings that collect the same category, it
still has one ID for that category. Enter it once.

#### Step 1: Find the resource ID

1. In the [Azure portal](https://portal.azure.com), open the resource:
  - For a DNS resolver policy, search for **DNS Resolver Policies** and choose the policy.
  - For an Azure Firewall, search for **Firewalls** and choose the firewall. Don't use
**Firewall Policies**: DNS logging is set on the firewall itself.
2. On the **Overview** page, select **JSON View** at the top right.
3. Copy the **Resource ID**, for example
`/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Network/dnsResolverPolicies/{name}`.


#### Step 2: Check that a diagnostic setting collects readable DNS logs

1. On the same resource, in the left navigation, go to **Monitoring** > **Diagnostic settings**.
If the list is empty, the resource isn't logging DNS queries. Choose
**+ Add diagnostic setting** and set it up as described in the next step.
2. Choose **Edit setting** on each diagnostic setting. A setting collects readable DNS logs when
**both** of these are true:
  - **The DNS category is checked.** Under **Logs**, the category from the table above is
checked, either under **Categories**, or through **allLogs** under **Category groups**.
  - **It sends to a readable destination.** Under **Destination details**,
**Send to Log Analytics workspace** or **Archive to a storage account** is checked.
3. You need **one** setting that meets both conditions. Other settings on the resource don't
matter.


| What you see | Result |
|  --- | --- |
| A setting collects the category and sends it to a workspace or storage account | The ID works. Continue to Step 3 |
| The category is collected, but only sent to an event hub or a partner solution | The ID is accepted, but no events can be read. Also send the logs to a workspace or storage account |
| No setting collects the category | The ID matches nothing and is skipped. Turn on the category in a diagnostic setting |


Make sure the integration's app has the role for the destination, as listed in
[Required Permissions](#required-permissions): **Log Analytics Reader** on the workspace, or
**Storage Blob Data Reader** on the storage account.

#### Step 3: Combine them

Join the resource ID from Step 1 and the category to enter from the table, with `|` and no
spaces. For example:

`/subscriptions/1111-2222/resourceGroups/network-rg/providers/Microsoft.Network/dnsResolverPolicies/prod-dns-policy|DnsResponse`

`/subscriptions/1111-2222/resourceGroups/network-rg/providers/Microsoft.Network/azureFirewalls/hub-fw|AZFWDnsQuery`

A firewall that collects both DNS categories logs every DNS query twice, once in each format.
Enter `AZFWDnsQuery`. Enter `AzureFirewallDnsProxy` only to read logs from before
`AZFWDnsQuery` was turned on.

#### List every resource ID with Cloud Shell

To list the resource IDs of every DNS resolver policy and Azure Firewall in the subscription,
select the **Cloud Shell** icon (`>_`) in the portal's top bar, choose **Bash**, and run:

az resource list --resource-type Microsoft.Network/dnsResolverPolicies --query "[].id" --output tsv
az resource list --resource-type Microsoft.Network/azureFirewalls --query "[].id" --output tsv

This gives the resource IDs only. Use Step 2 to check each resource's diagnostic settings, then
add the category as in Step 3.

#### Copy IDs from the integration

If you've already created the integration with this field empty, run
**Query DNS Log Configurations**. Each result's `metadata.uid` is a DNS log configuration ID,
ready to enter. Leave out results whose `unmapped.queryable` is `false`: their logs go only to an
event hub or a partner solution, so they can't be read.

#### Check your entries

Each entry must name a DNS resolver policy or Azure Firewall in the subscription you set in the
integration, with a category that resource can emit. An entry whose resource is not found, or
whose category is not collected by any of the resource's diagnostic settings, is skipped, and the
other entries are still read.

## Create an Entra Application and Service Principal

### 1. Create an application and service principal

1. Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com/) with an account that
can create app registrations.
2. Go to **Entra ID** → **App registrations**, then select **New registration**.
3. Enter a **Name** for the application.
4. For **Supported account types**, choose **Accounts in this organizational directory only**
(single tenant) unless you need a multi-tenant app. If you are unsure, choose the single-tenant
option. For more information, see
[Tenancy in Microsoft Entra ID](https://learn.microsoft.com/en-us/entra/identity-platform/single-and-multi-tenant-apps).
5. Select **Register**.
6. On the **Overview** page, copy the **Application (client) ID** and **Directory (tenant) ID** and
store them in a safe location.


For more details, see
[Register an application with the Microsoft identity platform](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app).

### 2. Create an application client secret

1. In the app registration, go to **Certificates & secrets** → **Client secrets**.
2. Select **New client secret**, enter a description and expiration, then select **Add**.
3. Copy the secret **Value** immediately and store it with the client ID and tenant ID. You will
not be able to view the value again after you leave the page.


### 3. Assign Azure RBAC roles

Assign the roles from [Required Permissions](#required-permissions) to the application's service
principal. For each role:

1. In the [Azure portal](https://portal.azure.com), open the scope listed for the role: the
subscription, a storage account or a Log Analytics workspace.
2. Go to **Access control (IAM)** → **+ Add** → **Add role assignment**.
3. Search for the role, select it, and click **Next**.
4. Click **+ Select members**, add the application from step 1, and click **Select**.
5. Click **Review + assign**.


For more details, see
[Assign Azure roles using the Azure portal](https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal).

### 4. Find your subscription ID

In the Azure portal, search for **Subscriptions** and copy the **Subscription ID** of the
subscription that contains your flow logs and DNS logging.

## Configure the Integration

Create your integration by supplying the following values.

| Integration Parameter | Description |
|  --- | --- |
| Client ID | The Application (client) ID from the Entra app registration Overview page |
| Client Secret | The client secret Value from Certificates & secrets |
| Tenant ID | The Directory (tenant) ID from the Entra app registration Overview page |
| Subscription ID | The Azure subscription that contains your flow logs and DNS logging |
| Azure Cloud *(optional)* | Microsoft cloud to use: `public` (default), `government` or `dod`. `government` and `dod` both use Azure Government |
| Flow Log Resource IDs *(optional)* | Full flow log resource IDs ending in `.../flowLogs/{name}`. Leave empty to read every flow log in the subscription. See [Choose which logs to read](#choose-which-logs-to-read). |
| DNS Log Configuration IDs *(optional)* | DNS log configuration IDs as `{resourceId}|{category}`, for example `.../dnsResolverPolicies/{name}|DnsResponse`. Leave empty to read all DNS logging in the subscription. See [Choose which logs to read](#choose-which-logs-to-read). |