Summary
I'm unable to create a Managed DevOps Pool (Microsoft.DevOpsInfrastructure/pools) in West Europe. Creation fails with "UnauthorizedAccessToVirtualNetwork" error despite having correct RBAC assignments on both the VNet and resource group. Both Azure Portal and Terraform (azapi provider) fail with identical errors, proving this is not a tooling issue.
Environment
- Region: West Europe
- API Version: 2024-10-19 (also tested 2025-09-20)
- Subnet: delegated to Microsoft.DevOpsInfrastructure/pools
RBAC Configuration (Verified Correct)
DevOpsInfrastructure service principal (Object ID: f7e562da-1010-4421-b809-72ee4fa196cf) has:
- Reader role on resource group
- Network Contributor role directly on VNet
Confirmed via:
az role assignment list --scope "/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.Network/virtualNetworks/VIRTUAL_NETWORK_NAME"
Permissions have been stable for 24+ hours.
Error details
Portal error:
{
"code": "ResourceDeploymentFailure",
"target": "/subscriptions/SUBSCRIPTION_NAME/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.DevOpsInfrastructure/pools/DEVCENTER_POOL_NAME",
"message": "The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'."
}
Terraform (azapi) error:
{
"status": "Failed",
"error": {
"code": "UnauthorizedAccessToVirtualNetwork",
"message": "DevOpsInfrastructure service principal does not have Read access to virtual network VIRTUAL_NETWORK_NAME in resource group RESOURCE_GROUP_NAME. Give Reader and Network Contributor access to DevOpsInfrastructure service principal and try again.",
"details": [{
"code": "UnauthorizedAccessToVirtualNetwork",
"message": "DevOpsInfrastructure service principal does not have Read access to virtual network VIRTUAL_NETWORK_NAME..."
}]
}
}
What I've Tried
✅ Verified RBAC assignments exist and are correct (both Azure Portal and CLI)
✅ Waited 24+ hours for RBAC propagation
✅ Added 90-second time_sleep in Terraform between RBAC creation and pool creation
✅ Verified subnet delegation to Microsoft.DevOpsInfrastructure/pools
✅ Confirmed NSG rules allow necessary traffic
✅ Tested with both API versions 2024-10-19 and 2025-09-20
✅ Attempted creation via both Terraform (azapi provider) and Azure Portal
✅ Verified same region for all resources (West Europe)
Analysis
Since both Portal and Terraform fail identically, this appears to be a backend validation bug in the Microsoft.DevOpsInfrastructure resource provider. The async provisioning operation is incorrectly reporting missing permissions despite them being properly configured.The permissions ARE assigned correctly, but the backend validation logic appears to have either:
- A cache sync issue between ARM and the provisioning backendA bug in the permission validation logic
- An issue querying role assignments during async operations
Request
Can Microsoft engineering investigate the backend validation logic for Microsoft.DevOpsInfrastructure/pools? The service principal permissions are correct, but the provisioning operation consistently fails with an incorrect authorization error.
resource "azapi_resource" "pool" {
type = "Microsoft.DevOpsInfrastructure/pools@2024-10-19"
name = "DEVCENTER_POOL_NAME"
location = "westeurope"
parent_id = "/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME"
body = {
properties = {
maximumConcurrency = 2
organizationProfile = {
kind = "AzureDevOps"
organizations = [{
url = "https://dev.azure.com/DEVOPS_ORGANIZATION_NAME"
}]
}
agentProfile = {
kind = "Stateless"
}
fabricProfile = {
kind = "Vmss"
sku = { name = "Standard_B2s" }
images = [{
wellKnownImageName = "ubuntu-22.04/latest"
}]
networkProfile = {
subnetId = "/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.Network/virtualNetworks/VIRTUAL_NETWORK_NAME/subnets/snet-runners"
}
}
devCenterProjectResourceId = "/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.DevCenter/projects/DEVCENTER_PROJECT_NAME"
}
}
depends_on = [azurerm_role_assignment.rbac]
}