DocsDiscoveryAzure Discovery

Azure Discovery

Discover and inventory your Microsoft Azure infrastructure including virtual machines, databases, networking, and platform services.


Overview

The Azure collector connects to one Microsoft Azure subscription with Entra ID (Azure AD) service principal credentials. It enumerates about 45 resource types — compute, containers, databases, storage, networking, web, messaging, monitoring and backup — and links them using Azure Resource Manager references. Throttled API calls are retried with exponential back-off; a resource type that cannot be read is reported and the job ends as partial instead of failing.

Connection Configuration

To configure an Azure discovery zone, you need four pieces of information from your Azure AD App Registration.

  • tenant_id (required): Your Azure Active Directory tenant ID (also called Directory ID). Found in Azure Portal > Azure Active Directory > Overview.
  • client_id (required): The Application (client) ID of the registered application. Found in Azure Portal > App Registrations > your app > Overview.
  • client_secret (required): A client secret generated for the app registration. Found in Azure Portal > App Registrations > your app > Certificates & Secrets.
  • subscription_id (required): The Azure subscription ID to scan. Found in Azure Portal > Subscriptions.

Note: One zone covers one subscription: create a zone per subscription. Optional connection_config keys, settable through the API: resource_groups and regions (limit the scan), include_stopped (default true; false skips stopped and deallocated VMs) and resource_types (subset of the supported types).

New discovery zone form

Discovered Resource Types

The Azure collector discovers a wide range of resource types across compute, data, networking, and platform services.

  • Compute: virtual machines (size, OS, power state, IP addresses, tags), VM scale sets, managed disks, snapshots, availability sets
  • Containers: AKS clusters, container registries
  • Databases: SQL servers and databases, Cosmos DB accounts, Azure Cache for Redis, Database for PostgreSQL and MySQL servers, Synapse workspaces
  • Storage and security: storage accounts, key vaults
  • Networking: virtual networks and subnets, network security groups, load balancers, application gateways, public IPs, DNS zones, private endpoints, VPN gateways, Azure Firewall, route tables, NAT gateways
  • Edge and traffic: Front Door, CDN profiles and endpoints, Traffic Manager profiles, API Management
  • Web and integration: App Services, App Service plans, Function Apps, Logic Apps, Data Factories
  • AI and messaging: Cognitive Services, SignalR, Service Bus and Event Hubs namespaces
  • Monitoring and backup: Application Insights, Log Analytics workspaces, action groups, Recovery Services vaults

Dependency Detection

The Azure collector creates these dependencies from Azure Resource Manager references:

  • Subnets are managed by their network security group
  • Load balancers, VPN gateways and Azure Firewalls use their public IPs; a firewall is managed by its firewall policy
  • Private endpoints sit in their subnet and connect to the linked service (private link connection)
  • Web Apps and Function Apps run on their App Service plan
  • AKS clusters contain the VM scale sets of their node pools
  • Front Door origins load-balance to the backends they point to (matched by hostname or IP: App Services, storage accounts, VMs, public IPs…); CDN profiles contain their endpoints

Note: Relationships the collector does not create (for example a VM to its virtual network) can still come from other sources, such as the connections reported by an agent installed on the VM.

Required Azure AD Configuration

AsPeekIt requires an Azure AD App Registration with the Reader role assigned at the subscription level. This grants read-only access to all resources in the subscription without the ability to modify anything.

  • 1. Go to Azure Portal > App Registrations > New Registration
  • 2. Name it (e.g., "AsPeekIt Discovery") and register it as a single-tenant application
  • 3. Note the Application (client) ID and Directory (tenant) ID
  • 4. Under Certificates & Secrets, create a new client secret and save the value
  • 5. Go to Subscriptions > your subscription > Access Control (IAM) > Add Role Assignment
  • 6. Assign the "Reader" role to the App Registration

Warning: Never assign Contributor, Owner, or any write role to the AsPeekIt service principal. The Reader role is sufficient for all discovery operations.

# Using Azure CLI to create the service principal with Reader role
az ad sp create-for-rbac \
  --name "AsPeekIt-Discovery" \
  --role "Reader" \
  --scopes "/subscriptions/<your-subscription-id>" \
  --years 2

Tips and Best Practices

Consider the following when setting up Azure discovery.

  • Set client secret expiration to a reasonable duration (1-2 years) and create a calendar reminder to rotate before expiry
  • For organizations with many subscriptions, use a single App Registration and assign Reader role on each subscription
  • Discovery interval of 60 minutes works well for most Azure environments
  • Use Azure resource tags consistently to make assets easier to filter and assign ownership in AsPeekIt