Introduction
Say you're running Power Automate flows, and part of a flow needs to read a secret. That secret is stored in an Azure Key Vault with public network access disabled, reachable only through a private endpoint. By default, Power Platform calls Azure services from Microsoft-managed infrastructure, so it can't reach that private endpoint.
To solve this, you can set up virtual network support (subnet injection) for the Power Platform environment. The environment then uses a delegated subnet in your VNet, dedicated to that environment, for its outbound calls. The region you pick also decides how many VNets you need, which can be crucial if you're tied to a single Azure region in a geography that has two.
Architecture
Prerequisites
- Managed environment
- Roles: Network Contributor (or equivalent) in Azure, Power Platform administrator in Entra
- Resource providers registered:
Microsoft.Network,Microsoft.PowerPlatform - PowerShell module:
Microsoft.PowerPlatform.EnterprisePolicies - DNS: the private DNS zone for the target service (here
privatelink.vaultcore.azure.net) must be resolvable from the VNet
Caveat: region pairs decide how many VNets you need
Each Power Platform region maps to one or more Azure regions. If it maps to two, like Norway with Norway East and Norway West, the enterprise policy needs a delegated subnet in a VNet in each of them, because the environment can run in, and fail over to, either one. Sweden maps only to Sweden Central, so a single VNet is enough.
If your platform is tied to one Azure region, a two-region geography means building and maintaining a VNet in a region you otherwise don't use. In that case, a single-region geography like Sweden can be the simpler choice.
Step 1: Delegate the subnet
Create a subnet delegated to Microsoft.PowerPlatform/enterprisePolicies and size it carefully. Microsoft recommends a block larger than /24 if you plan to inject several managed environments into the subnet. This demo uses a /26 for a single environment.
Step 2: Create the enterprise policy
An enterprise policy is deployed using the PowerShell module listed in the prerequisites. The policy is an Azure resource that represents the environment's network configuration (enable Show hidden types in the portal to see it). The scripts below cover both single-region and two-region geographies.
# Single-region geography (e.g. Sweden)
New-SubnetInjectionEnterprisePolicy `
-SubscriptionId "00000000-0000-0000-0000-000000000000" `
-TenantId "00000000-0000-0000-0000-000000000000" `
-ResourceGroupName "rg-powerplatform-demo" `
-PolicyName "ep-powerplatform-demo-sweden" `
-PolicyLocation "sweden" `
-VirtualNetworkId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-powerplatform-demo/providers/Microsoft.Network/virtualNetworks/vnet-powerplatform-demo-sweden" `
-SubnetName "powerplatform-subnet"
# Two-region geography (e.g. Norway: one VNet in Norway East, one in Norway West)
New-SubnetInjectionEnterprisePolicy `
-SubscriptionId "00000000-0000-0000-0000-000000000000" `
-TenantId "00000000-0000-0000-0000-000000000000" `
-ResourceGroupName "rg-powerplatform-demo" `
-PolicyName "ep-powerplatform-demo-norway" `
-PolicyLocation "norway" `
-VirtualNetworkId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-powerplatform-demo/providers/Microsoft.Network/virtualNetworks/vnet-powerplatform-demo-norwayeast" `
-SubnetName "powerplatform-subnet" `
-VirtualNetworkId2 "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-powerplatform-demo/providers/Microsoft.Network/virtualNetworks/vnet-powerplatform-demo-norwaywest" `
-SubnetName2 "powerplatform-subnet"
Step 3: Link the policy to the environment
We now have a delegated subnet and an enterprise policy that represents our Power Platform environment. Last up is subnet injection.
Enable-SubnetInjection `
-EnvironmentId "00000000-0000-0000-0000-000000000000" `
-PolicyArmId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-powerplatform-demo/providers/Microsoft.PowerPlatform/enterprisePolicies/ep-powerplatform-demo-sweden"
Step 4: Reach the private endpoint
Make sure traffic is allowed outbound from the delegated subnet to the Key Vault's private endpoint on port 443.
The final validation is inside the Power Automate flow: if the Get secret action can list the secrets in the Key Vault, you're through.
Summary
This is a simplified setup, but the same principles apply in production. What changes in a regulated environment is who runs the commands, and from where.
With these steps in place, your Power Platform team can reach Azure resources behind private endpoints, without opening them up to public access.
References
Comments
Join the discussionNo comments yet. Be the first to comment.