> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/microsoft-azure-cloud-onboarding/how-to-onboard-microsoft-azure.md).

# How to onboard Microsoft Azure

Follow the Azure onboarding wizard, and Cortex creates a custom authentication template to be executed in Azure.

{% hint style="info" %}
**License type:** This feature is included with a Cortex XDR license that has the Cloud Posture Security or Cloud Runtime Security add-on.
{% endhint %}

After completing the prerequisites, follow these instructions to onboard your Microsoft Azure environment to Cortex XDR.

## Access the Azure onboarding wizard in Cortex XDR

1. In Cortex XDR, select **Settings → Data Sources & Integrations**.
2. On the **Data Sources & Integrations** page, click + Add New.
3. On the **Add Data Sources or Integrations** page, search for Microsoft Azure, then hover over it and click **Add**.

## Select the Microsoft Azure environment

* In the Microsoft Azure onboarding wizard, select the type of Microsoft Azure environment:
  * **Government:** Microsoft Azure Government environments for compatibility with FedRAMP-certified tenants.
  * **Commercial:** (Default) Standard cloud deployment typically used for private and public sector organizations that do not require isolated government-specific infrastructure.

## Select the scope

1. Select the scope for this cloud instance:
   * **Tenant:** (Default) A specific instance of Azure Active Directory, which can contain several subscriptions.
   * **Management Group:** A collection of Microsoft Azure subscriptions.
   * **Subscription:** A collection of Microsoft Azure resources associated with a specific Microsoft Azure tenant.
2. When you select Tenant, you have the option to select Onboard Microsoft Entra ID only. For more details on this option, see [Onboard Microsoft Entra ID only](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/microsoft-azure-cloud-onboarding/onboard-microsoft-azure.md#onboard-microsoft-entra-id-only).

## Choose the scan mode

This option is not available when you are onboarding Microsoft Entra ID only.

* Specify the scanning infrastructure for your cloud instance by selecting one of the following scan modes:
  * **Cloud Scan:** (Recommended) Security scanning is performed in the Cortex XDR cloud environment.
  * **Scan with Outpost:** Security scanning is performed on infrastructure deployed to a cloud account owned by you. If you select this option, choose the outpost account to use for this instance or create a new outpost. For more information on outposts, see [Outposts](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/outpost-onboarding.md).

    <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><h4>Note</h4><p>Scanning with an outpost may require additional Azure permissions and may incur additional CSP costs.</p></div>

## Check the service principal in your Azure tenant

When you enter your Azure tenant ID, Cortex XDR checks whether the Cortex service principal already exists in your tenant. Cortex XDR uses the service principal to discover your Azure resources and to perform actions for the security capabilities that you enable.

1. Enter your Azure tenant ID in the **Tenant ID** field.

   Cortex XDR displays one of the following results:

   * **Cortex service principal verified** (green checkmark): The Cortex service principal already exists in your tenant. Continue with the onboarding wizard.
   * The tenant ID format is valid, but Cortex XDR couldn't connect because the required configuration is missing: The Cortex service principal doesn't exist in your tenant yet. Cortex XDR displays the steps and the Azure CLI command to create it, and a **Verify** button.
2. If the Cortex service principal doesn't exist, do one of the following:
   * **IaC deployment method:** Continue with the onboarding wizard. You can skip the manual steps that the wizard displays. When you execute the authentication template, it checks for the service principal and creates it if it doesn't exist. The user who executes the template must have the **Cloud Application Administrator** Entra ID role or higher.
   * **Manual deployment method, or if a different team manages Entra ID in your organization:** Create the service principal before you continue:

     1. Make sure that the user who creates the service principal has the **Cloud Application Administrator** Entra ID role or higher in the tenant that you onboard.
     2. Open Azure Cloud Shell in the tenant that you onboard, or open a local terminal with the Azure CLI installed and sign in to the tenant.
     3. Copy the command that the wizard displays and run it. The command includes the Cortex application ID:

        ```bash
        az ad sp create --id <cortex-application-id>
        ```
     4. In the onboarding wizard, click **Verify** to confirm that the service principal exists.

     If your organization doesn't use the Azure CLI, create the service principal for the Cortex application ID in the Azure portal or with the tool that your organization uses to manage Entra ID, and then click **Verify**.

{% hint style="info" %}
**Note:** The manual deployment method requires the Cortex service principal to exist in your tenant. If you select **Manual** as the deployment method, create the service principal and click **Verify** before you save the configuration.
{% endhint %}

{% hint style="info" %}
**Note:** If the service principal doesn't exist and the user who executes the template doesn't have permission to create it, the deployment fails with an error. Ask a user with the Cloud Application Administrator Entra ID role or higher to create the service principal, and then execute the template again.
{% endhint %}

{% hint style="info" %}
**Note:** Cortex XDR checks the service principal against Azure each time you select a tenant ID. If a tenant that was verified before no longer shows a green checkmark, the Cortex service principal may have been removed from the tenant. Run the Azure CLI command again to re-create the service principal, and then click **Verify**.
{% endhint %}

## Configure advanced settings (optional)

* Click **Show advanced settings** to define the following advanced settings:
  * **Instance Name:** Enter a unique instance name or leave it empty to be automatically populated. The automatic naming convention is `Azure-<tenantID>` or `Azure-<subscriptionID>`. Cortex XDR does not prevent you from reusing instance names, but it is best practice to use a unique name for every cloud instance.
  * **Deployment Method:** Select whether you want to onboard with a Cortex-generated IaC template or to perform a manual deployment:
    * **Infrastructure as Code:** (Recommended) Automatically provisions all required cloud resources and permissions using an IaC template.
    * **Manual:** Select this option if your organization requires manual provisioning to meet internal security and compliance policies. The manual deployment method requires the Cortex service principal to exist in your tenant before you save the configuration. For details, see [Check the service principal in your Azure tenant](#check-the-service-principal-in-your-azure-tenant). If you choose to onboard manually, follow the [manual onboarding instructions](https://cortex-docs.paloaltonetworks.com/microsoft-azure-manual-onboarding/readme.md).
  * **Environment Scanning:** Turns active scanning for this environment on or off. Environment scanning is available for all cloud service providers and all scope types. When you onboard an environment with environment scanning turned off, Cortex XDR creates the cloud instance and you can deploy the template to grant permissions, but Cortex XDR doesn't run permission checks, subscription discovery, asset discovery, or security capability scans for the instance. Turning off environment scanning also turns off **Agentless Disk Scanning** and **Data Security Scanning**. The cloud instance shows a **Connected** status, and its security capabilities show a **Disabled** status. Use this option to grant permissions first and start scanning later, for example during a phased rollout.

    * **Discovery scope:** Use these settings to fine-tune your Microsoft Azure scope. For more details, see [Apply region or account filters](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding.md#step-5-apply-region-or-account-filters-optional). Scope modifications are not available when you are onboarding Microsoft Entra ID only.
      * **Modify Scope by Management Group/Subscription:** If you selected a tenant or management group as the scope, you can modify the scope by including or excluding specific management groups or subscriptions.
      * **Modify Scope by Regions:** You can modify the scope by including or excluding specific regions. If you selected a Government environment, only Microsoft Azure Government regions are displayed.
    * **Agentless Disk Scanning:** Turns agentless disk scanning on or off for this cloud instance. You can modify the scope by Management Group/Subscription or by tags.
    * **Data Security Scanning:** Turns data security scanning on or off for this cloud instance. You can modify the scope by Management Group/Subscription or by regions.

    <div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p><strong>Important:</strong> After you turn on environment scanning, either during onboarding or later by editing the cloud instance, you can't turn it off again.</p></div>

    <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note:</strong> The scanning toggles control whether Cortex XDR scans. To scan, the capability must also be provisioned under <strong>Capability Provisioning</strong>.</p></div>
  * **Capability Provisioning:** Choose which security capabilities you want to benefit from. Some security capabilities are enabled by default and can be modified. Adding security capabilities typically requires additional cloud provider permissions. For detailed information on the permissions required, see [Microsoft Azure provider permissions](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/microsoft-azure-cloud-onboarding/microsoft-azure-provider-permissions.md). When you are onboarding Microsoft Entra ID only, only XSIAM analytics is supported as an additional security capability.
    * **Data security posture management:** An agentless data security scanner that discovers, classifies, protects, and governs sensitive data. DSPM is not currently available in Microsoft Azure Government environments.
    * **Registry scanning:** A container registry scanner that scans registry images for vulnerabilities, malware, and secrets. For more details, see [Configure registry scanning for cloud accounts](broken://spaces/cyIgISZgANJYkmLlnwdK/pages/9iLVmUqY9CQVqDXJSEvG).
    * **Serverless functions scanning:** Implement serverless scanning to detect and remediate vulnerabilities within serverless functions during the development lifecycle. Seamless integration into CI/CD pipelines enables automated security scans for a continuously secure pre-production environment.

      * **Allow connection to private serverless functions:** Lets Cortex XDR scan Azure Functions that have public network access turned off (`publicNetworkAccess` set to `Disabled`), such as functions that use virtual network (VNet) integration or private endpoints. Without this setting, Cortex XDR discovers these functions but can't reach their code. With it, Cortex XDR temporarily connects to the function's storage account through a private endpoint, without exposing the function to the internet. The setting is available when **Serverless functions scanning** is on, and works with both **Cloud Scan** and **Scan with Outpost**. It's on by default when you onboard a new instance. For an existing instance, it's off until you turn it on by editing the instance. The setting doesn't change your VNet integration, private endpoints, or Azure network rules.

      <div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p><strong>Important:</strong> Turning on <strong>Allow connection to private serverless functions</strong> requires additional Azure permissions. Download and apply the Terraform or ARM template to grant them. Until you apply the template, Cortex XDR doesn't scan private serverless functions. This also applies when you turn on the setting for an existing instance.</p></div>
    * **Automation:** Use automation to pre-configure a list of integrations and associated commands to automate security issue responses. Commands can be utilized individually or as part of custom playbooks for issue remediation.
      * **Log Level:** (Optional - for Automation only) Configure the automation integration logging level. Possible values are:
        * Off (Default)
        * Debug
        * Verbose
    * **Agentless disk scanning:** (Recommended) Implement agentless disk scanning to remotely detect and remediate vulnerabilities during the development lifecycle.
    * **Secret Security Posture and Correlation:** Assesses the security posture of secrets stored in Azure Key Vault, detects misconfigurations, and correlates secrets across cloud resources, source code, and runtime environments. This capability is off by default. When you enable it, Cortex XDR discovers Azure Key Vault resources and deploys the per-subscription Azure policy. For details, see [Automated deployment per subscription with Azure policy](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/microsoft-azure-cloud-onboarding/onboard-microsoft-azure.md#automated-deployment-per-subscription-with-azure-policy).
  * **Cloud Tags:** Define tags and tag values to be added to any new resource created by Cortex XDR in Microsoft Azure. Note: The `managed_by = paloaltonetworks` tag is automatically added to all resources. This tag is mandatory. You cannot edit or remove this tag.
* **Log Collection Configuration:** To maximize security coverage, include the collection of audit logs using Event Hub. Select the collection method:
  * **Automated collection:** Cortex XDR provisions the resource group, Event Hub namespace, Event Hub, consumer group, storage account, user-assigned managed identity (UAMI), federated identity credential, diagnostic settings, and role assignment resources in your Azure environment to collect audit logs.
    * **Tenant/management group scope:** A single diagnostic setting is created at the management group scope. Azure natively propagates Activity Logs from all child subscriptions through this management group-level setting and no per-subscription diagnostic setting is created. An Azure policy definition is also deployed to create the Cortex resource group in each child subscription.
    * **Cost considerations:** Event Hub pricing is based on throughput units and ingress/egress. High-volume environments with many subscriptions can generate significant event throughput. We recommend you review your [Azure Event Hubs pricing](https://azure.microsoft.com/en-us/pricing/details/event-hubs/) and expected event volume before enabling.
  * **Custom** (user defined): Select this option to use an existing Event Hub for storing your audit logs.

    * When you deploy the authentication template in ARM, you will enter the following details: Event Hub name, Event Hub namespace, Event Hub resource group name.
    * Cortex XDR creates the user-assigned managed identity (UAMI), federated identity credential, role assignments, and consumer group.
    * After you deploy the stack in ARM, you must ensure that your existing Event Hub has the appropriate diagnostic settings configured to stream Azure Activity Logs.

    #### Important

    It is critical to ensure that your namespace and Event Hub belong to the specific Azure subscription being onboarded. Cross-subscription or centralized logging is not currently supported.
* **Upload unknown files to WildFire:** Use this option to upload unknown files scanned during registry image scans to WildFire for detonation analysis.\
  This option expands malware detection by allowing WildFire to analyze new samples found in your registry images. When a detonation result returns a malicious verdict, the system re-evaluates the relevant registry image and creates a malware finding.

<figure><img src="https://2127116976-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcyIgISZgANJYkmLlnwdK%2Fuploads%2Fgit-blob-1235be81ceac3dda152fa40f4aa72dd1a82e8ccf%2Fimage%20(40).png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}

#### Notes

* The file types sent for WildFire analysis depend on the platform type. WildFire accepts files up to 300 MB in size.

* This setting applies only to registry image scans and is enabled by default for new Azure instances. For existing instances, this setting is disabled by default to preserve the current behavior. You can enable it at any time by editing the instance configuration.

* Your cloud provider may charge standard outbound data transfer (egress) fees when scanning with an [Outpost](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/outpost-onboarding.md).
  {% endhint %}

* **Static IP Access:** (Optional) Use this option when your Azure Functions keep public network access on but allow inbound access only from specific IP addresses. These access restrictions block Cortex XDR, so Cortex XDR discovers the functions but can't download their code for serverless scanning. Turn on **Static IP Access** to retrieve a static IP address for a region, and then add the IP address to the allow list of your Azure Functions. Static IP Access works with both **Cloud Scan** and **Scan with Outpost**. Static IP Access is separate from **Allow connection to private serverless functions**. Use Static IP Access for functions that restrict access to specific IP addresses. Use **Allow connection to private serverless functions** for functions that have public network access turned off.

  <div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p><strong>Important:</strong> Provisioning a static IP address may incur additional Azure charges for setup and maintenance.</p></div>

  1. Turn on **Static IP Access**.
  2. Select a **Region**. Cortex XDR retrieves the static IP address for the selected region.
  3. Copy the IP address and add it to the access restrictions of your Azure Functions. Cortex XDR downloads the function code through the Advanced Tools (SCM) site, so if the SCM site has its own access restrictions, add the IP address there too.

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note:</strong> Cortex XDR assigns the static IP address per region. There is no fixed, published list of IP addresses. If you change the scan mode, Cortex XDR turns off <strong>Static IP Access</strong> and clears the region and IP address. If you change the outpost, Cortex XDR clears the region and IP address. In both cases, select the region again.</p></div>

## Save the configuration and download the template

1. Click **Save**. Cortex XDR generates a Terraform or ARM authentication template based on the settings you configured in the Microsoft Azure onboarding wizard. Cortex XDR creates an instance in the pending state. For details on pending instances, see [Pending cloud instances](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/pending-cloud-instances.md).

   If you turned off **Environment Scanning**, Cortex XDR doesn't scan the cloud instance until you turn on scanning. For more information, see [Edit your onboarded CSP configuration](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/edit-your-onboarded-csp-configuration.md#start-scanning-an-environment-that-you-onboarded-without-scanning).
2. Download the authentication template:

   * For onboarding Azure tenants and management groups, click one of the following:
     * **Download Terraform** to download a Terraform file and proceed to [Finalize onboarding by applying the Terraform template's configuration](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/microsoft-azure-cloud-onboarding/finalize-microsoft-azure-onboarding-by-executing-the-authentication-template.md).

       To onboard all subscriptions within a management group or tenant, our authentication template uses Azure Resource Management (ARM) templates internally. The ARM templates are encoded with base64 and located inside the `template_params.tfvars` file as the `policy_template` variable.
     * **Azure Resource Manager** to download a `tar.gz` file and proceed to [Finalize onboarding of tenants and management groups by deploying the Microsoft Azure Resource Manager (ARM) template](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/microsoft-azure-cloud-onboarding/finalize-microsoft-azure-onboarding-by-executing-the-authentication-template.md).
   * For onboarding Azure subscriptions, click one of the following:
     * Download Terraform to download a Terraform file and proceed to [Finalize onboarding by applying the Terraform template's configuration](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/microsoft-azure-cloud-onboarding/finalize-microsoft-azure-onboarding-by-executing-the-authentication-template.md).
     * Azure Resource Manager to download a JSON file and proceed to [Finalize onboarding of subscriptions by deploying the Microsoft Azure Resource Manager (ARM) template](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/microsoft-azure-cloud-onboarding/finalize-microsoft-azure-onboarding-by-executing-the-authentication-template.md).

   The authentication template is reusable and can be executed as many times as you want to create new cloud instances with the settings you defined in the Microsoft Azure onboarding wizard. The Terraform authentication template is valid for seven days from when it was created.
3. Click **Close**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/microsoft-azure-cloud-onboarding/how-to-onboard-microsoft-azure.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
