@Shawn Sullivan It turns out this is indeed supported at this time but not particularly well-documented. I reverse engineered some of the requirements from the REST traffic on the portal. In particular:
- The private connection resource ID is the parent app service (or production slot, if you prefer) resource ID rather than the deployment slot resource ID.
- The group ID parameter is formatted such as
sites-<deploymentSlotName>
. If you have a deployment slot namedtest
, the group ID value should besites-test
to tie the private endpoint to that slot.
Here's a sample in PowerShell below to demonstrate.
$subscriptionId = "00000000-0000-0000-0000-000000000000"
$vnetRgName = "myrg"
$vnetName = "myrg-vnet"
$subnetName = "myrg-vnet-dmzsn"
$fxRgName = "myrg"
$fxName = "myrg-fx"
$slotName = "stage"
$endpointRgName = "myrg"
$endpointName = "myrg-fx-stage-pe"
$connectionName = "myrg-fx-stage-pe-conn"
az network private-endpoint create --name $endpointName --resource-group $endpointRgName --subnet /subscriptions/$subscriptionId/resourceGroups/$vnetRgName/providers/Microsoft.Network/virtualNetworks/$vnetName/subnets/$subnetName --private-connection-resource-id /subscriptions/$subscriptionId/resourceGroups/$fxRgName/providers/Microsoft.Web/sites/$fxName --group-id sites-$slotName --connection-name $connectionName
This command would look something like:
az network private-endpoint create --name myrg-fx-stage-pe --resource-group myrg --subnet /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myrg/providers/Microsoft.Network/virtualNetworks/myrg-vnet/subnets/myrg-vnet-dmzsn --private-connection-resource-id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myrg/providers/Microsoft.Web/sites/myrg-fx --group-id sites-stage --connection-name myrg-fx-stage-pe-conn