This document describes the Azure permissions required to run the IPAM tool, how to create the necessary custom role, and how to configure authentication.
- Required Permissions
- Custom Role Definition
- Creating the Custom Role
- Service Principal Setup
- Managed Identity Setup
- Multi-Subscription Access
The IPAM tool requires read-only access to the following Azure resources:
| Resource Type | Permission | Purpose |
|---|---|---|
| Public IP Addresses | Microsoft.Network/publicIPAddresses/read |
List all public IPs |
| Virtual Networks | Microsoft.Network/virtualNetworks/read |
List VNets and address spaces |
| Subnets | Microsoft.Network/virtualNetworks/subnets/read |
List subnet configurations |
| Network Interfaces | Microsoft.Network/networkInterfaces/read |
Get private IP assignments |
| Load Balancers | Microsoft.Network/loadBalancers/read |
List LB IP configurations |
| Application Gateways | Microsoft.Network/applicationGateways/read |
List AppGw IP configurations |
| Private Endpoints | Microsoft.Network/privateEndpoints/read |
List private endpoint IPs |
| Private Link Services | Microsoft.Network/privateLinkServices/read |
List private link IPs |
| NAT Gateways | Microsoft.Network/natGateways/read |
List NAT gateway associations |
| Firewalls | Microsoft.Network/firewallPolicies/read |
List firewall configurations |
| Bastion Hosts | Microsoft.Network/bastionHosts/read |
List bastion IP configurations |
| Virtual Machines | Microsoft.Compute/virtualMachines/read |
Get VM names for IP associations |
| Subscriptions | Microsoft.Resources/subscriptions/read |
List accessible subscriptions |
| Resource Groups | Microsoft.Resources/subscriptions/resourceGroups/read |
List resource groups |
| Activity Logs | Microsoft.Insights/eventtypes/values/read |
Fetch network change events |
| Resource Graph | Microsoft.ResourceGraph/resources/read |
Cross-subscription queries |
The following custom role provides the minimum required permissions:
{
"Name": "IPAM Reader",
"Description": "Read-only access for Azure IP Address Management tool",
"Actions": [
"Microsoft.Network/publicIPAddresses/read",
"Microsoft.Network/virtualNetworks/read",
"Microsoft.Network/virtualNetworks/subnets/read",
"Microsoft.Network/networkInterfaces/read",
"Microsoft.Network/loadBalancers/read",
"Microsoft.Network/applicationGateways/read",
"Microsoft.Network/privateLinkServices/read",
"Microsoft.Network/privateEndpoints/read",
"Microsoft.Network/natGateways/read",
"Microsoft.Network/firewallPolicies/read",
"Microsoft.Network/bastionHosts/read",
"Microsoft.Compute/virtualMachines/read",
"Microsoft.Resources/subscriptions/read",
"Microsoft.Resources/subscriptions/resourceGroups/read",
"Microsoft.Insights/eventtypes/values/read",
"Microsoft.ResourceGraph/resources/read"
],
"NotActions": [],
"DataActions": [],
"NotDataActions": [],
"AssignableScopes": [
"/providers/Microsoft.Management/managementGroups/<YOUR_TENANT_ID>"
]
}Note: Replace
<YOUR_TENANT_ID>with your Azure AD tenant ID. You can also scope to specific subscriptions instead of the entire tenant.
# Get your tenant ID
TENANT_ID=$(az account show --query tenantId -o tsv)
# Create the role definition file
cat > ipam-reader-role.json << EOF
{
"Name": "IPAM Reader",
"Description": "Read-only access for Azure IP Address Management tool",
"Actions": [
"Microsoft.Network/publicIPAddresses/read",
"Microsoft.Network/virtualNetworks/read",
"Microsoft.Network/virtualNetworks/subnets/read",
"Microsoft.Network/networkInterfaces/read",
"Microsoft.Network/loadBalancers/read",
"Microsoft.Network/applicationGateways/read",
"Microsoft.Network/privateLinkServices/read",
"Microsoft.Network/privateEndpoints/read",
"Microsoft.Network/natGateways/read",
"Microsoft.Network/firewallPolicies/read",
"Microsoft.Network/bastionHosts/read",
"Microsoft.Compute/virtualMachines/read",
"Microsoft.Resources/subscriptions/read",
"Microsoft.Resources/subscriptions/resourceGroups/read",
"Microsoft.Insights/eventtypes/values/read",
"Microsoft.ResourceGraph/resources/read"
],
"NotActions": [],
"DataActions": [],
"NotDataActions": [],
"AssignableScopes": [
"/providers/Microsoft.Management/managementGroups/$TENANT_ID"
]
}
EOF
# Create the role
az role definition create --role-definition @ipam-reader-role.json- Go to Azure Portal → Subscriptions (or Management Groups)
- Select Access control (IAM) → Roles → + Create
- Fill in:
- Name: IPAM Reader
- Description: Read-only access for Azure IP Address Management tool
- In Permissions tab, add the actions listed above
- In Assignable scopes, select your management group or subscription
- Click Create
See the deployment folders for Infrastructure as Code examples:
For non-interactive authentication (APIs, automation):
# Create the service principal
az ad sp create-for-rbac --name "ipam-app" --skip-assignment
# Output:
# {
# "appId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
# "displayName": "ipam-app",
# "password": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
# "tenant": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
# }# Get your tenant ID for management group scope
TENANT_ID=$(az account show --query tenantId -o tsv)
# Assign role at management group scope (all subscriptions)
az role assignment create \
--assignee "<APP_ID>" \
--role "IPAM Reader" \
--scope "/providers/Microsoft.Management/managementGroups/$TENANT_ID"
# Or assign at subscription scope
az role assignment create \
--assignee "<APP_ID>" \
--role "IPAM Reader" \
--scope "/subscriptions/<SUBSCRIPTION_ID>"Set these environment variables in your deployment:
AZURE_TENANT_ID=<tenant>
AZURE_CLIENT_ID=<appId>
AZURE_CLIENT_SECRET=<password>For Azure-hosted deployments (recommended for production):
For Azure Functions / App Service:
az webapp identity assign --resource-group <RG> --name <APP_NAME>
# or
az functionapp identity assign --resource-group <RG> --name <APP_NAME>For Container Apps:
az containerapp identity assign --resource-group <RG> --name <APP_NAME> --system-assignedFor AKS: Use workload identity or pod identity.
# Get the managed identity principal ID
PRINCIPAL_ID=$(az webapp identity show --resource-group <RG> --name <APP_NAME> --query principalId -o tsv)
# Assign the IPAM Reader role
az role assignment create \
--assignee $PRINCIPAL_ID \
--role "IPAM Reader" \
--scope "/providers/Microsoft.Management/managementGroups/<TENANT_ID>"No code changes needed! The Azure SDK's DefaultAzureCredential automatically uses managed identity when running in Azure.
Assign the role at the root management group (tenant level) to access all subscriptions:
az role assignment create \
--assignee "<PRINCIPAL_ID>" \
--role "IPAM Reader" \
--scope "/providers/Microsoft.Management/managementGroups/<TENANT_ID>"Assign the role to each subscription individually:
for SUB_ID in sub1-id sub2-id sub3-id; do
az role assignment create \
--assignee "<PRINCIPAL_ID>" \
--role "IPAM Reader" \
--scope "/subscriptions/$SUB_ID"
doneCreate a management group containing only the subscriptions you want to monitor:
# Create management group
az account management-group create --name "IPAM-Scope" --display-name "IPAM Monitored Subscriptions"
# Add subscriptions
az account management-group subscription add --name "IPAM-Scope" --subscription "<SUB_ID>"
# Assign role at this scope
az role assignment create \
--assignee "<PRINCIPAL_ID>" \
--role "IPAM Reader" \
--scope "/providers/Microsoft.Management/managementGroups/IPAM-Scope"The frontend uses MSAL.js for user authentication. You need an app registration:
az ad app create --display-name "Azure IPAM Dashboard" \
--sign-in-audience AzureADMyOrg \
--web-redirect-uris "http://localhost:3000" "https://your-production-url.com"In Azure Portal → App Registrations → Your App → API Permissions:
- Add permission → Microsoft APIs → Azure Service Management
- Select
user_impersonation(Delegated) - Click Grant admin consent
Set in your .env file:
VITE_AZURE_CLIENT_ID=<app-registration-client-id>
VITE_AZURE_TENANT_ID=<your-tenant-id>-
Verify role assignment exists:
az role assignment list --assignee "<PRINCIPAL_ID>" --all -
Check role propagation (can take 5-10 minutes)
-
Verify scope is correct (management group vs subscription)
- The identity may not have access to all subscriptions
- Check the
AssignableScopesof the custom role
- Activity Log access requires
Microsoft.Insights/eventtypes/values/read - Logs are retained for 90 days by default
- Use Managed Identity in production instead of service principal secrets
- Scope minimally - only grant access to necessary subscriptions
- Rotate secrets regularly if using service principals
- Enable audit logging for role assignments
- Use Conditional Access policies for the app registration
- Review access periodically using Access Reviews