Two App Services: front web app with VNet injection and back web app with a private endpoint
Deploy two App Services - Front web app with VNet injection and Back web app with a Private Endpoint.
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set azure-ts-webapp-privateendpoint-vnet-injectioncd pulumi-examples/azure-ts-webapp-privateendpoint-vnet-injectionThis deploys a secure front end - back end web app. The front end web app is plugged in a subnet with the feature regional VNet integration enabled. Settings are set to consume a DNS private zone. The backend web app is only exposed through a private endpoint.
It will create a VNet, two subnets, one where your Private Endpoint will exist, the second where you will inject the front web app, an App Service Plan in PremiumV2 tier (mandatory for Private Endpoint), a Private Endpoint, settings for DNS queries to the DNS Private Zone, and a private DNS zone with record for the Private Endpoint.
Prerequisites#
Deploying the example#
-
Create a new stack, which is an isolated deployment target for this example:
Terminal window pulumi stack init dev -
Set the Azure region to deploy into:
Terminal window pulumi config set azure-native:location westus2 -
Optionally, override the default CIDR ranges:
Terminal window pulumi config set virtualNetworkCIDR 10.200.0.0/16 # CIDR range for the VNetpulumi config set backendCIDR 10.200.1.0/24 # subnet CIDR range for the backendpulumi config set frontendCIDR 10.200.2.0/24 # subnet CIDR range for the frontend -
Install dependencies:
Terminal window npm install -
Deploy the stack:
Terminal window pulumi up
Cleaning up#
Once you’re finished experimenting, tear down your stack’s resources by destroying and removing it:
pulumi destroypulumi stack rm