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

# Microsoft Azure

> Prepare a Microsoft Azure tenant so Arch can read its subscriptions, cloud resources and the findings Microsoft Defender for Cloud reports on them.

## Before you start

You need at least the Application Developer role in the Microsoft Entra tenant that owns your subscriptions, to
register an application. To assign the Reader role, you need the Owner, User Access Administrator or Role Based
Access Control Administrator role on the subscriptions or the management group you choose. Arch reads only the
Azure global cloud: a tenant in a sovereign cloud is refused, and so is a subscription delegated to you from
another organization's tenant.

## Setup steps

1. Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com), browse to Entra ID, then App
   registrations, and select New registration. See
   [Register an application](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app).
2. Enter a name for the app, choose Single tenant only under Supported account types, and select Register.
3. On the app's Overview page, copy the Application (client) ID and the Directory (tenant) ID.
4. Select Certificates & secrets, then Client secrets, then New client secret. Enter a description, choose an
   expiration, and select Add. See
   [Add and manage app credentials](https://learn.microsoft.com/en-us/entra/identity-platform/how-to-add-credentials).
5. Copy the secret's Value, not its Secret ID. Microsoft never shows the value again after you leave the page.
6. In the [Azure portal](https://portal.azure.com), search for Subscriptions and open a subscription Arch reads.
   To cover every subscription, now and later, search for Management groups and open the root management group
   instead. See
   [Assign Azure roles using the Azure portal](https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal).
7. Select Access control (IAM), then Add, then Add role assignment.
8. On the Role tab, select Reader, then select Next.
9. On the Members tab, choose User, group, or service principal, then select Select members. Search for the
   app's name, select it, select Select, then select Next.
10. Select Review + assign. Repeat steps 6 to 10 for each other subscription Arch reads. A role assigned on a
    management group applies to every subscription under it. See
    [Steps to assign an Azure role](https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-steps).
11. You now hold the Directory (tenant) ID, the Application (client) ID and the client secret's value to enter
    in Arch.

## Fields

| Field | What to enter |
| - | - |
| Tenant ID | The Directory (tenant) ID from the Overview page of the app registration. It is the tenant that owns your subscriptions. |
| Application (Client) ID | The Application (client) ID from the same Overview page. |
| Client Secret | The Value of the client secret you added under Certificates & secrets. Copy the value, not the secret ID. |

You do not enter an address. Arch always signs in to Microsoft's own sign-in and Azure Resource Manager
addresses.

## Permissions

| Permission | What Arch reads with it |
| - | - |
| Reader | The management groups, the subscriptions, their resources, their Defender plans and the vulnerabilities and misconfigurations Microsoft Defender for Cloud found. Reader views resources and cannot change them. |

Assign Reader on each subscription itself, or on a management group above it, not only on resource groups. To
add a subscription later, assign Reader on it as in Setup steps, then test the connection again in Arch. See
[Azure built-in roles: Reader](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles/general#reader).

## Configure

| Step | What to choose |
| - | - |
| Select Azure Subscriptions | The subscriptions Arch reads. Each one shows its name, its ID and the paid Defender plans it has. Subscriptions delegated from another tenant and subscriptions that are not active are listed as not selectable. |
| All current and future subscriptions | Choose it to read every subscription the app can read, including ones you add later. Choose single subscriptions instead to read only those. Arch reads only subscriptions where the app has Reader: assign Reader on the root management group (Setup steps, step 6) so that new subscriptions are covered. |

## Sign-in

Arch signs in as the app registration, exchanging the application ID and the client secret for an Azure Resource
Manager token from your tenant. When the sign-in works, the connection test goes on to list the subscriptions the
app can read, then reads one page each of resources, Defender for Cloud findings and Defender plans.

If the sign-in fails, check that the application ID and the client secret come from the same app registration
and that you copied the secret's value, not its ID. A client secret expires on the date you chose, at most two
years after you added it. If it expired or was deleted, add a new one under Certificates & secrets on the app
registration, in the Microsoft Entra admin center, and enter its value in Arch.

## Test answers

A passing test shows one line for each subscription the app can read, then one line each for Resources, Defender
for Cloud findings and Defender plans.

| Message | What it means and what to do |
| - | - |
| The tenant ID, client ID or client secret is not in the expected format. | A field is empty, or an ID is not a GUID. Enter the IDs from the app registration's Overview page and the secret's value. |
| Microsoft rejected the client secret. | The secret is wrong. Copy the secret's Value, not its Secret ID, or add a new client secret and enter its value. |
| The client secret has expired. | The secret passed its expiration date. Add a new client secret under Certificates & secrets and enter its value. |
| Microsoft found no application with this client ID in this tenant. | The application ID or tenant ID is wrong. Check both on the app registration's Overview page. |
| Microsoft found no tenant with this ID. | The tenant ID is wrong, or the tenant is in a sovereign cloud. Check the Directory (tenant) ID on the app registration's Overview page. |
| The application is disabled in this tenant. | Sign-in is turned off for the app. In the Microsoft Entra admin center, open Enterprise apps, select the app, open Properties, set Enabled for users to sign-in? to Yes, and select Save. See [Disable user sign-in for an application](https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/disable-user-sign-in-portal). |
| A Conditional Access policy blocked the application's sign-in. | A Conditional Access policy applies to the app. Exclude the app from that policy, then test the connection again. |
| Microsoft would not issue a token for this application. | Microsoft refused the sign-in for another reason. Check the tenant ID, client ID and client secret against the app registration, then test the connection again. |
| Azure Resource Manager rejected the token for this tenant. | The tenant ID is not the tenant that owns your subscriptions. Enter the Directory (tenant) ID of that tenant. |
| The application can sign in but cannot read any subscription. | The app has no Reader role on an active subscription of your own tenant. Assign Reader as in Setup steps, wait up to 10 minutes, then test the connection again. |
| The application can read your resources but not Microsoft Defender for Cloud's findings. | Reader is assigned only on resource groups. Assign Reader on the subscriptions themselves, wait up to 10 minutes, then test the connection again. |
| Microsoft answered the sign-in request in an unexpected shape. | The tenant ID may not name a Microsoft Entra tenant. Check it on the Overview page, then test the connection again. |
| The sign-in request was redirected to another address. | Arch does not send a client secret to an address it is redirected to. Test the connection again, and contact Arch support if it keeps happening. |
| Microsoft could not be reached. | Arch could not reach Microsoft. Test the connection again in a few minutes. |
| Microsoft Azure is busy or briefly unavailable. | Azure is limiting requests or failing on its side. Nothing is wrong with the credentials. Test the connection again in a few minutes. |
| Arch is running too many connection checks at once. | Nothing is wrong with the credentials. Test the connection again in a moment. |

## Limits

* Arch brings in the management groups and the subscriptions you select, with their virtual machines, disks,
  container clusters, web apps, functions, storage accounts, databases, key vaults, virtual networks, subnets,
  network interfaces, firewalls, load balancers and public IP addresses, and the vulnerabilities and
  misconfigurations Microsoft Defender for Cloud found on them, each linked to the resource it affects.
* Other resource types, subscriptions delegated from another tenant and subscriptions that are not active are
  not brought in. Vulnerabilities appear only for workloads a paid Defender plan scans.
* Arch reads the data once a day by default. You can choose every hour, every 3, 6 or 12 hours, or once a day.
* Each run reads every selected subscription again, so a resource removed in Azure leaves Arch after the next run.
* One Microsoft Entra tenant connects to Arch once. A second connection to the same tenant is refused.


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