Posture Control (DSPM)
Deploying the Tree Discovery Template
After adding the tenant details, deploy the tree discovery template.
This template:
- Includes policies and permissions to create the service principal, resource discovery role with required permissions, and managed identities.
- Assigns the service principal with permission to access resources in the Microsoft Entra tenant.
- Generates the application ID and client secret that are required for the service principal to connect to the Microsoft Entra tenant.
To deploy the tree discovery template:
- 1. Download and modify the template.
In the Connect to the Tenant section, click Tree Discovery to download the template as a ZIP file. Extract the file to your local system and create a new folder to store the extracted files. The ZIP file contains two Terraform files (
backend.tf
andazure_tf_basic.tf
).Update the following details in the
backend.tf
file:- resource_group_name: Enter the resource group name.
- storage_account_name: Enter the storage account name.
- container_name: Enter the container name where the Terraform state files must be stored.
- 2. Initialize the template.
Use any of the following methods:
- Cloud Shell
- Sign in to the Azure portal, and click Cloud Shell.
In the Welcome to Azure Cloud Shell window, select Bash or PowerShell, as required.
In the Getting started window:
- Select Mount storage account.
- Select the storage account subscription from the list.
- Click Apply.
In the Mount storage account window, select Select existing storage account and click Next.
In the Select storage account window:
- Subscription: Select the subscription where the storage account is created.
- Resource group: Select the resource group from the list.
- Storage account name: Select the storage account.
- File share: Click Create a file share and enter a name for the new file.
- Click Select.
- Use any of the following:
- Azure PowerShell
Run the following commands to prepare the PowerShell environment:
To switch to the clouddrive folder:
cd clouddrive
To create a DSPM folder within the clouddrive folder and switch to the newly created DSPM folder:
md dspm_onboarding cd dspm_onboarding
To create the logs and tree discovery folders:
md logs md tree discovery
To verify if all the folders are created:
ls
To switch to the newly created tree discovery folder:
cd tree discovery
Zip the modified template and upload the folder:
- Click Manage files and select Upload.
- Browse for the template and click Open.
- Run the following commands:
To extract the ZIP folder:
expand -archive -path <folder name.zip>
To switch to the folder within the ZIP folder:
cd ./<folder name>/dspm-azure/
- Bash
- Run the following commands to prepare the Bash environment:
To switch to the clouddrive folder:
cd clouddrive
To create a DSPM folder within the clouddrive folder and switch to the newly created DSPM folder:
mkdir dspm_onboarding cd dspm_onboarding
To create the logs and tree discovery folders:
mkdir logs mkdir tree discovery
To verify if all the folders are created:
ls
To switch to the newly created folder:
cd tree discovery
- Zip the modified template and upload the folder:
- Click Manage files and select Upload.
- Browse for the template and click Open.
- Run the following commands:
To extract the ZIP folder:
unzip <folder name.zip>
To switch to the folder within the ZIP folder:
cd ./<folder name>/dspm-azure/
- Run the following commands to prepare the Bash environment:
- Azure PowerShell
- Command Prompt
- Open the Command Prompt or any other CLI app in your local system.
- Switch to the directory containing the downloaded Terraform file.
Connect to the Microsoft Entra tenant by running the following command:
az login --tenant <tenant ID>
You are directed to a web browser to authorize the Microsoft Entra tenant. Select your account to confirm the authorization.
The command output returns the subscriptions available.
- Cloud Shell
- 3. Deploy the template.
To set the subscription where the storage containers containing the Terraform state files are stored:
az account set --subscription <subscription ID>
(Optional) To verify if the subscription is accurately set:
az account show
To initialize the working directory and apply Terraform configuration:
terraform init
To verify the changes in the Terraform configuration:
terraform plan
To run the Terraform script:
terraform apply
Under Do you want to perform these actions?, enter
yes
and pressEnter
.The command output returns the client ID and client secret that DSPM requires to connect to the Microsoft Entra tenant.
- 4. Grant API permissions in the Azure portal.
After the template is deployed, a service principal or application is created in the Microsoft Entra tenant. You need to grant API permissions to the service principal to access resources within the tenant.
- Sign in to the Azure portal and go to Microsoft Entra ID.
In the left-side navigation, go to Manage > App registrations.
Select the Owned applications tab.
- In the table, search for and select the service principal.
In the left-side navigation, select API permissions.
Click Grant admin consent for <tenant name>.
In the Grand admin consent confirmation window, click Yes.
- 5. Validate the template in the DSPM Admin Portal.
- In the DSPM Admin Portal, under Connect to the Tenant:
- Application ID: Enter the client ID.
- Client Secret: Enter the client secret.
Click Validate.
DSPM validates the template deployment by verifying the application ID, client secret, and the custom roles created. If the validation is successful, you are directed to the Orchestrator & Monitoring Scope section.
If there is any issue while deploying the template, an error is displayed. Rerun the template. To learn more, see Resolving Configuration Issues for Microsoft Azure.
- In the DSPM Admin Portal, under Connect to the Tenant: