--- title: "Create a cloud action for Microsoft Azure | Lansweeper Platform" slug: "create-a-cloud-action-microsoft-azure" description: "Create a Microsoft Azure cloud action to automatically discover assets and services and keep your Lansweeper inventory in sync with your Azure resources." tags: ["Lansweeper Platform", "Discovery and scanning", "Cloud Discovery"] status: "update" updated: 2026-11-19T21:17:00Z published: 2026-11-19T21:17:00Z canonical: "docs.lansweeper.com/create-a-cloud-action-microsoft-azure" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lansweeper.com/llms.txt > Use this file to discover all available pages before exploring further. # Create a cloud action - Microsoft Azure Create a Microsoft Azure cloud action to automatically discover assets and services from your Azure environment. This ensures your Lansweeper inventory stays up to date with resources such as virtual machines, storage accounts, and other workloads hosted in Azure. ## Prerequisites - You have completed the steps in [Prepare Microsoft Cloud for Cloud Discovery](/v1/docs/prepare-microsoft-azure-for-cloud-discovery) - Your **Azure Tenant ID**, **Application ID**, and **Key Vault URI** are available. ## Choose which subscriptions to scan Before you create the action, decide how Lansweeper selects the Azure subscriptions to scan: - **Manually select subscriptions**: The default mode. Lansweeper scans only the subscriptions you select from the list. New subscriptions aren't scanned until you add them to the action. - **Automatically discover all subscriptions**: Lansweeper scans every subscription your credentials can read, except the ones you exclude with rules. New subscriptions are scanned the next time the action runs, without editing the action. You can switch modes later by editing the action. ## Create a Microsoft Azure cloud action 1. In your Lansweeper Site, go to **Discovery > Actions**. 2. Select **Create action**. 3. Select **Cloud** as the action type. 4. In the pop-up, select **Cloud provider - Microsoft Azure** as the cloud source. 5. Select **Create**. 6. Enter a name and description for the action. 7. Enter your **Tenant ID**, **Application ID**, and **Key Vault URI**. 8. Select **List subscriptions**. 9. Choose how Lansweeper selects the subscriptions to scan: - **Manually select subscriptions**: Select the subscriptions from the list. - **Automatically discover all subscriptions**: Optionally, [exclude subscriptions with rules](/docs/create-a-cloud-action-microsoft-azure#exclude-subscriptions-from-automatic-discovery). 10. Under Asset types, select the asset types to include in the action. 11. Optionally, select **Add a resource group filter** to include or exclude specific resource groups. 12. Optionally, select **Add tag filter** to include or exclude specific tags. 13. Select **Create trigger**. 14. Select **Instant** to run at a scheduled time on select days. Enter the name, time, and days you prefer. 15. Select **Create**. 16. Select **Create action**. ## Exclude subscriptions from automatic discovery When you use **Automatically discover all subscriptions**, you can add up to 5 rules to leave specific subscriptions out. 1. Select **Add exclusion rule**. 2. Under **Match on**, select **Subscription name** or **Subscription ID**. 3. Under **Regex pattern**, enter a regular expression, for example `^sandbox-`. Patterns are case-sensitive and match anywhere in the name or ID unless you anchor them with `^` or `$`. 4. Check the **Preview** list. Excluded subscriptions are grayed out and tagged with the rule that matches them, for example **Rule 1**. To remove a rule, select the trash can icon in its row. ## What to expect after the action runs After the trigger runs for the first time, Lansweeper discovers the resources in the Azure subscriptions the action scans and adds them to your asset inventory. Each discovered resource, such as a virtual machine, storage account, or database, becomes an asset with its own asset page showing details, relationships, and tags. To see the scanned data for a resource, open the asset and go to the **Cloud Properties** section of its asset page. Discovery runs on the schedule you set in the trigger, so the data refreshes with each successful run. ## Troubleshoot the Azure cloud action Where to see scan problems If a discovered asset is missing data, open the asset and check the **Scan issues** tab. Permission or scanning problems for that asset appear there. If the action doesn't return the results you expect, check the following: - **Connection validation fails.** Confirm your **Tenant ID**, **Application ID**, and **Key Vault URI** are correct, and that federated credentials and the key vault are configured as described in [Prepare Microsoft Cloud for Cloud Discovery](/v1/docs/prepare-microsoft-azure-for-cloud-discovery). - **No assets are discovered.** Confirm the app registration has the **Reader** role on each subscription you want to scan. In manual mode, check that you selected those subscriptions in the action. In automatic mode, check that no exclusion rule matches them. - **Some resource properties are missing.** A few resource types need more than the Reader role. Add the required permissions with an Azure custom role, then check the asset's **Scan issues** tab. - **Key vault access errors.** Confirm the key vault contains the `LansweeperSiteID` secret and that inbound access allows the Lansweeper IP ranges for your region.