Environment

Manages an App Service Environment.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
        {
            Location = "westeurope",
        });
        var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new Azure.Network.VirtualNetworkArgs
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            AddressSpaces = 
            {
                "10.0.0.0/16",
            },
        });
        var ase = new Azure.Network.Subnet("ase", new Azure.Network.SubnetArgs
        {
            ResourceGroupName = exampleResourceGroup.Name,
            VirtualNetworkName = exampleVirtualNetwork.Name,
            AddressPrefix = "10.0.1.0/24",
        });
        var gateway = new Azure.Network.Subnet("gateway", new Azure.Network.SubnetArgs
        {
            ResourceGroupName = exampleResourceGroup.Name,
            VirtualNetworkName = exampleVirtualNetwork.Name,
            AddressPrefix = "10.0.2.0/24",
        });
        var exampleEnvironment = new Azure.AppService.Environment("exampleEnvironment", new Azure.AppService.EnvironmentArgs
        {
            SubnetId = ase.Id,
            PricingTier = "I2",
            FrontEndScaleFactor = 10,
            InternalLoadBalancingMode = "Web, Publishing",
            UserWhitelistedIpRanges = 
            {
                "11.22.33.44/32",
                "55.66.77.0/24",
            },
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/appservice"
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/network"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
            Location: pulumi.String("westeurope"),
        })
        if err != nil {
            return err
        }
        exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{
            Location:          exampleResourceGroup.Location,
            ResourceGroupName: exampleResourceGroup.Name,
            AddressSpaces: pulumi.StringArray{
                pulumi.String("10.0.0.0/16"),
            },
        })
        if err != nil {
            return err
        }
        ase, err := network.NewSubnet(ctx, "ase", &network.SubnetArgs{
            ResourceGroupName:  exampleResourceGroup.Name,
            VirtualNetworkName: exampleVirtualNetwork.Name,
            AddressPrefix:      pulumi.String("10.0.1.0/24"),
        })
        if err != nil {
            return err
        }
        _, err = network.NewSubnet(ctx, "gateway", &network.SubnetArgs{
            ResourceGroupName:  exampleResourceGroup.Name,
            VirtualNetworkName: exampleVirtualNetwork.Name,
            AddressPrefix:      pulumi.String("10.0.2.0/24"),
        })
        if err != nil {
            return err
        }
        _, err = appservice.NewEnvironment(ctx, "exampleEnvironment", &appservice.EnvironmentArgs{
            SubnetId:                  ase.ID(),
            PricingTier:               pulumi.String("I2"),
            FrontEndScaleFactor:       pulumi.Int(10),
            InternalLoadBalancingMode: pulumi.String("Web, Publishing"),
            UserWhitelistedIpRanges: pulumi.StringArray{
                pulumi.String("11.22.33.44/32"),
                pulumi.String("55.66.77.0/24"),
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="westeurope")
example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    address_spaces=["10.0.0.0/16"])
ase = azure.network.Subnet("ase",
    resource_group_name=example_resource_group.name,
    virtual_network_name=example_virtual_network.name,
    address_prefix="10.0.1.0/24")
gateway = azure.network.Subnet("gateway",
    resource_group_name=example_resource_group.name,
    virtual_network_name=example_virtual_network.name,
    address_prefix="10.0.2.0/24")
example_environment = azure.appservice.Environment("exampleEnvironment",
    subnet_id=ase.id,
    pricing_tier="I2",
    front_end_scale_factor=10,
    internal_load_balancing_mode="Web, Publishing",
    user_whitelisted_ip_ranges=[
        "11.22.33.44/32",
        "55.66.77.0/24",
    ])
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "westeurope"});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    addressSpaces: ["10.0.0.0/16"],
});
const ase = new azure.network.Subnet("ase", {
    resourceGroupName: exampleResourceGroup.name,
    virtualNetworkName: exampleVirtualNetwork.name,
    addressPrefix: "10.0.1.0/24",
});
const gateway = new azure.network.Subnet("gateway", {
    resourceGroupName: exampleResourceGroup.name,
    virtualNetworkName: exampleVirtualNetwork.name,
    addressPrefix: "10.0.2.0/24",
});
const exampleEnvironment = new azure.appservice.Environment("exampleEnvironment", {
    subnetId: ase.id,
    pricingTier: "I2",
    frontEndScaleFactor: 10,
    internalLoadBalancingMode: "Web, Publishing",
    userWhitelistedIpRanges: [
        "11.22.33.44/32",
        "55.66.77.0/24",
    ],
});

Create a Environment Resource

def Environment(resource_name, opts=None, front_end_scale_factor=None, internal_load_balancing_mode=None, name=None, pricing_tier=None, resource_group_name=None, subnet_id=None, tags=None, user_whitelisted_ip_ranges=None, __props__=None);
func NewEnvironment(ctx *Context, name string, args EnvironmentArgs, opts ...ResourceOption) (*Environment, error)
public Environment(string name, EnvironmentArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args EnvironmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args EnvironmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args EnvironmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Environment Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Environment resource accepts the following input properties:

SubnetId string

The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.

FrontEndScaleFactor int

Scale factor for front end instances. Possible values are between 5 and 15. Defaults to 15.

InternalLoadBalancingMode string

Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are None, Web, Publishing and combined value "Web, Publishing". Defaults to None.

Name string

The name of the App Service Environment. Changing this forces a new resource to be created.

PricingTier string

Pricing tier for the front end instances. Possible values are I1, I2 and I3. Defaults to I1.

ResourceGroupName string

The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by subnet_id).

Tags Dictionary<string, string>

A mapping of tags to assign to the resource. Changing this forces a new resource to be created.

UserWhitelistedIpRanges List<string>

User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.

SubnetId string

The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.

FrontEndScaleFactor int

Scale factor for front end instances. Possible values are between 5 and 15. Defaults to 15.

InternalLoadBalancingMode string

Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are None, Web, Publishing and combined value "Web, Publishing". Defaults to None.

Name string

The name of the App Service Environment. Changing this forces a new resource to be created.

PricingTier string

Pricing tier for the front end instances. Possible values are I1, I2 and I3. Defaults to I1.

ResourceGroupName string

The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by subnet_id).

Tags map[string]string

A mapping of tags to assign to the resource. Changing this forces a new resource to be created.

UserWhitelistedIpRanges []string

User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.

subnetId string

The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.

frontEndScaleFactor number

Scale factor for front end instances. Possible values are between 5 and 15. Defaults to 15.

internalLoadBalancingMode string

Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are None, Web, Publishing and combined value "Web, Publishing". Defaults to None.

name string

The name of the App Service Environment. Changing this forces a new resource to be created.

pricingTier string

Pricing tier for the front end instances. Possible values are I1, I2 and I3. Defaults to I1.

resourceGroupName string

The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by subnet_id).

tags {[key: string]: string}

A mapping of tags to assign to the resource. Changing this forces a new resource to be created.

userWhitelistedIpRanges string[]

User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.

subnet_id str

The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.

front_end_scale_factor float

Scale factor for front end instances. Possible values are between 5 and 15. Defaults to 15.

internal_load_balancing_mode str

Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are None, Web, Publishing and combined value "Web, Publishing". Defaults to None.

name str

The name of the App Service Environment. Changing this forces a new resource to be created.

pricing_tier str

Pricing tier for the front end instances. Possible values are I1, I2 and I3. Defaults to I1.

resource_group_name str

The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by subnet_id).

tags Dict[str, str]

A mapping of tags to assign to the resource. Changing this forces a new resource to be created.

user_whitelisted_ip_ranges List[str]

User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.

Outputs

All input properties are implicitly available as output properties. Additionally, the Environment resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Location string

The location where the App Service Environment exists.

Id string
The provider-assigned unique ID for this managed resource.
Location string

The location where the App Service Environment exists.

id string
The provider-assigned unique ID for this managed resource.
location string

The location where the App Service Environment exists.

id str
The provider-assigned unique ID for this managed resource.
location str

The location where the App Service Environment exists.

Look up an Existing Environment Resource

Get an existing Environment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: EnvironmentState, opts?: CustomResourceOptions): Environment
static get(resource_name, id, opts=None, front_end_scale_factor=None, internal_load_balancing_mode=None, location=None, name=None, pricing_tier=None, resource_group_name=None, subnet_id=None, tags=None, user_whitelisted_ip_ranges=None, __props__=None);
func GetEnvironment(ctx *Context, name string, id IDInput, state *EnvironmentState, opts ...ResourceOption) (*Environment, error)
public static Environment Get(string name, Input<string> id, EnvironmentState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

FrontEndScaleFactor int

Scale factor for front end instances. Possible values are between 5 and 15. Defaults to 15.

InternalLoadBalancingMode string

Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are None, Web, Publishing and combined value "Web, Publishing". Defaults to None.

Location string

The location where the App Service Environment exists.

Name string

The name of the App Service Environment. Changing this forces a new resource to be created.

PricingTier string

Pricing tier for the front end instances. Possible values are I1, I2 and I3. Defaults to I1.

ResourceGroupName string

The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by subnet_id).

SubnetId string

The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.

Tags Dictionary<string, string>

A mapping of tags to assign to the resource. Changing this forces a new resource to be created.

UserWhitelistedIpRanges List<string>

User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.

FrontEndScaleFactor int

Scale factor for front end instances. Possible values are between 5 and 15. Defaults to 15.

InternalLoadBalancingMode string

Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are None, Web, Publishing and combined value "Web, Publishing". Defaults to None.

Location string

The location where the App Service Environment exists.

Name string

The name of the App Service Environment. Changing this forces a new resource to be created.

PricingTier string

Pricing tier for the front end instances. Possible values are I1, I2 and I3. Defaults to I1.

ResourceGroupName string

The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by subnet_id).

SubnetId string

The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.

Tags map[string]string

A mapping of tags to assign to the resource. Changing this forces a new resource to be created.

UserWhitelistedIpRanges []string

User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.

frontEndScaleFactor number

Scale factor for front end instances. Possible values are between 5 and 15. Defaults to 15.

internalLoadBalancingMode string

Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are None, Web, Publishing and combined value "Web, Publishing". Defaults to None.

location string

The location where the App Service Environment exists.

name string

The name of the App Service Environment. Changing this forces a new resource to be created.

pricingTier string

Pricing tier for the front end instances. Possible values are I1, I2 and I3. Defaults to I1.

resourceGroupName string

The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by subnet_id).

subnetId string

The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.

tags {[key: string]: string}

A mapping of tags to assign to the resource. Changing this forces a new resource to be created.

userWhitelistedIpRanges string[]

User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.

front_end_scale_factor float

Scale factor for front end instances. Possible values are between 5 and 15. Defaults to 15.

internal_load_balancing_mode str

Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are None, Web, Publishing and combined value "Web, Publishing". Defaults to None.

location str

The location where the App Service Environment exists.

name str

The name of the App Service Environment. Changing this forces a new resource to be created.

pricing_tier str

Pricing tier for the front end instances. Possible values are I1, I2 and I3. Defaults to I1.

resource_group_name str

The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by subnet_id).

subnet_id str

The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.

tags Dict[str, str]

A mapping of tags to assign to the resource. Changing this forces a new resource to be created.

user_whitelisted_ip_ranges List[str]

User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.