azure.appservice.VirtualNetworkSwiftConnection

Manages an App Service Virtual Network Association for Regional VNet Integration.

This resource can be used for both App Services and Function Apps.

Note: The following resources support associating the vNet for Regional vNet Integration directly on the resource and via the azure.appservice.VirtualNetworkSwiftConnection resource. You can’t use both simultaneously.

  • azure.appservice.LinuxFunctionApp
  • azure.appservice.LinuxFunctionAppSlot
  • azure.appservice.LinuxWebApp
  • azure.appservice.LinuxWebAppSlot
  • azure.logicapps.Standard
  • azure.appservice.WindowsFunctionApp
  • azure.appservice.WindowsFunctionAppSlot
  • azure.appservice.WindowsWebApp
  • azure.appservice.WindowsWebAppSlot

This resource requires the Microsoft.Network/virtualNetworks/subnets/write permission scope on the subnet.

The resource specific vNet integration requires the Microsoft.Network/virtualNetworks/subnets/join/action permission scope.

There is a hard limit of one VNet integration per App Service Plan. Multiple apps in the same App Service plan can use the same VNet.

Example Usage

With App Service)

using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
    {
        Location = "West Europe",
    });

    var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new()
    {
        AddressSpaces = new[]
        {
            "10.0.0.0/16",
        },
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
    });

    var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        VirtualNetworkName = exampleVirtualNetwork.Name,
        AddressPrefixes = new[]
        {
            "10.0.1.0/24",
        },
        Delegations = new[]
        {
            new Azure.Network.Inputs.SubnetDelegationArgs
            {
                Name = "example-delegation",
                ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs
                {
                    Name = "Microsoft.Web/serverFarms",
                    Actions = new[]
                    {
                        "Microsoft.Network/virtualNetworks/subnets/action",
                    },
                },
            },
        },
    });

    var examplePlan = new Azure.AppService.Plan("examplePlan", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        Sku = new Azure.AppService.Inputs.PlanSkuArgs
        {
            Tier = "Standard",
            Size = "S1",
        },
    });

    var exampleAppService = new Azure.AppService.AppService("exampleAppService", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        AppServicePlanId = examplePlan.Id,
    });

    var exampleVirtualNetworkSwiftConnection = new Azure.AppService.VirtualNetworkSwiftConnection("exampleVirtualNetworkSwiftConnection", new()
    {
        AppServiceId = exampleAppService.Id,
        SubnetId = exampleSubnet.Id,
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{
			AddressSpaces: pulumi.StringArray{
				pulumi.String("10.0.0.0/16"),
			},
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
		})
		if err != nil {
			return err
		}
		exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{
			ResourceGroupName:  exampleResourceGroup.Name,
			VirtualNetworkName: exampleVirtualNetwork.Name,
			AddressPrefixes: pulumi.StringArray{
				pulumi.String("10.0.1.0/24"),
			},
			Delegations: network.SubnetDelegationArray{
				&network.SubnetDelegationArgs{
					Name: pulumi.String("example-delegation"),
					ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{
						Name: pulumi.String("Microsoft.Web/serverFarms"),
						Actions: pulumi.StringArray{
							pulumi.String("Microsoft.Network/virtualNetworks/subnets/action"),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			Sku: &appservice.PlanSkuArgs{
				Tier: pulumi.String("Standard"),
				Size: pulumi.String("S1"),
			},
		})
		if err != nil {
			return err
		}
		exampleAppService, err := appservice.NewAppService(ctx, "exampleAppService", &appservice.AppServiceArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			AppServicePlanId:  examplePlan.ID(),
		})
		if err != nil {
			return err
		}
		_, err = appservice.NewVirtualNetworkSwiftConnection(ctx, "exampleVirtualNetworkSwiftConnection", &appservice.VirtualNetworkSwiftConnectionArgs{
			AppServiceId: exampleAppService.ID(),
			SubnetId:     exampleSubnet.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.network.inputs.SubnetDelegationArgs;
import com.pulumi.azure.network.inputs.SubnetDelegationServiceDelegationArgs;
import com.pulumi.azure.appservice.Plan;
import com.pulumi.azure.appservice.PlanArgs;
import com.pulumi.azure.appservice.inputs.PlanSkuArgs;
import com.pulumi.azure.appservice.AppService;
import com.pulumi.azure.appservice.AppServiceArgs;
import com.pulumi.azure.appservice.VirtualNetworkSwiftConnection;
import com.pulumi.azure.appservice.VirtualNetworkSwiftConnectionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

        var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()        
            .addressSpaces("10.0.0.0/16")
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .build());

        var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .virtualNetworkName(exampleVirtualNetwork.name())
            .addressPrefixes("10.0.1.0/24")
            .delegations(SubnetDelegationArgs.builder()
                .name("example-delegation")
                .serviceDelegation(SubnetDelegationServiceDelegationArgs.builder()
                    .name("Microsoft.Web/serverFarms")
                    .actions("Microsoft.Network/virtualNetworks/subnets/action")
                    .build())
                .build())
            .build());

        var examplePlan = new Plan("examplePlan", PlanArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .sku(PlanSkuArgs.builder()
                .tier("Standard")
                .size("S1")
                .build())
            .build());

        var exampleAppService = new AppService("exampleAppService", AppServiceArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .appServicePlanId(examplePlan.id())
            .build());

        var exampleVirtualNetworkSwiftConnection = new VirtualNetworkSwiftConnection("exampleVirtualNetworkSwiftConnection", VirtualNetworkSwiftConnectionArgs.builder()        
            .appServiceId(exampleAppService.id())
            .subnetId(exampleSubnet.id())
            .build());

    }
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
    address_spaces=["10.0.0.0/16"],
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name)
example_subnet = azure.network.Subnet("exampleSubnet",
    resource_group_name=example_resource_group.name,
    virtual_network_name=example_virtual_network.name,
    address_prefixes=["10.0.1.0/24"],
    delegations=[azure.network.SubnetDelegationArgs(
        name="example-delegation",
        service_delegation=azure.network.SubnetDelegationServiceDelegationArgs(
            name="Microsoft.Web/serverFarms",
            actions=["Microsoft.Network/virtualNetworks/subnets/action"],
        ),
    )])
example_plan = azure.appservice.Plan("examplePlan",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    sku=azure.appservice.PlanSkuArgs(
        tier="Standard",
        size="S1",
    ))
example_app_service = azure.appservice.AppService("exampleAppService",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    app_service_plan_id=example_plan.id)
example_virtual_network_swift_connection = azure.appservice.VirtualNetworkSwiftConnection("exampleVirtualNetworkSwiftConnection",
    app_service_id=example_app_service.id,
    subnet_id=example_subnet.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
    addressSpaces: ["10.0.0.0/16"],
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
});
const exampleSubnet = new azure.network.Subnet("exampleSubnet", {
    resourceGroupName: exampleResourceGroup.name,
    virtualNetworkName: exampleVirtualNetwork.name,
    addressPrefixes: ["10.0.1.0/24"],
    delegations: [{
        name: "example-delegation",
        serviceDelegation: {
            name: "Microsoft.Web/serverFarms",
            actions: ["Microsoft.Network/virtualNetworks/subnets/action"],
        },
    }],
});
const examplePlan = new azure.appservice.Plan("examplePlan", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    sku: {
        tier: "Standard",
        size: "S1",
    },
});
const exampleAppService = new azure.appservice.AppService("exampleAppService", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    appServicePlanId: examplePlan.id,
});
const exampleVirtualNetworkSwiftConnection = new azure.appservice.VirtualNetworkSwiftConnection("exampleVirtualNetworkSwiftConnection", {
    appServiceId: exampleAppService.id,
    subnetId: exampleSubnet.id,
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleVirtualNetwork:
    type: azure:network:VirtualNetwork
    properties:
      addressSpaces:
        - 10.0.0.0/16
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
  exampleSubnet:
    type: azure:network:Subnet
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      virtualNetworkName: ${exampleVirtualNetwork.name}
      addressPrefixes:
        - 10.0.1.0/24
      delegations:
        - name: example-delegation
          serviceDelegation:
            name: Microsoft.Web/serverFarms
            actions:
              - Microsoft.Network/virtualNetworks/subnets/action
  examplePlan:
    type: azure:appservice:Plan
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      sku:
        tier: Standard
        size: S1
  exampleAppService:
    type: azure:appservice:AppService
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      appServicePlanId: ${examplePlan.id}
  exampleVirtualNetworkSwiftConnection:
    type: azure:appservice:VirtualNetworkSwiftConnection
    properties:
      appServiceId: ${exampleAppService.id}
      subnetId: ${exampleSubnet.id}

With Function App)

using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
    {
        Location = "West Europe",
    });

    var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new()
    {
        AddressSpaces = new[]
        {
            "10.0.0.0/16",
        },
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
    });

    var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        VirtualNetworkName = exampleVirtualNetwork.Name,
        AddressPrefixes = new[]
        {
            "10.0.1.0/24",
        },
        Delegations = new[]
        {
            new Azure.Network.Inputs.SubnetDelegationArgs
            {
                Name = "example-delegation",
                ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs
                {
                    Name = "Microsoft.Web/serverFarms",
                    Actions = new[]
                    {
                        "Microsoft.Network/virtualNetworks/subnets/action",
                    },
                },
            },
        },
    });

    var examplePlan = new Azure.AppService.Plan("examplePlan", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        Sku = new Azure.AppService.Inputs.PlanSkuArgs
        {
            Tier = "Standard",
            Size = "S1",
        },
    });

    var exampleAccount = new Azure.Storage.Account("exampleAccount", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        Location = exampleResourceGroup.Location,
        AccountTier = "Standard",
        AccountReplicationType = "LRS",
    });

    var exampleFunctionApp = new Azure.AppService.FunctionApp("exampleFunctionApp", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        AppServicePlanId = examplePlan.Id,
        StorageAccountName = exampleAccount.Name,
        StorageAccountAccessKey = exampleAccount.PrimaryAccessKey,
    });

    var exampleVirtualNetworkSwiftConnection = new Azure.AppService.VirtualNetworkSwiftConnection("exampleVirtualNetworkSwiftConnection", new()
    {
        AppServiceId = exampleFunctionApp.Id,
        SubnetId = exampleSubnet.Id,
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{
			AddressSpaces: pulumi.StringArray{
				pulumi.String("10.0.0.0/16"),
			},
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
		})
		if err != nil {
			return err
		}
		exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{
			ResourceGroupName:  exampleResourceGroup.Name,
			VirtualNetworkName: exampleVirtualNetwork.Name,
			AddressPrefixes: pulumi.StringArray{
				pulumi.String("10.0.1.0/24"),
			},
			Delegations: network.SubnetDelegationArray{
				&network.SubnetDelegationArgs{
					Name: pulumi.String("example-delegation"),
					ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{
						Name: pulumi.String("Microsoft.Web/serverFarms"),
						Actions: pulumi.StringArray{
							pulumi.String("Microsoft.Network/virtualNetworks/subnets/action"),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			Sku: &appservice.PlanSkuArgs{
				Tier: pulumi.String("Standard"),
				Size: pulumi.String("S1"),
			},
		})
		if err != nil {
			return err
		}
		exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{
			ResourceGroupName:      exampleResourceGroup.Name,
			Location:               exampleResourceGroup.Location,
			AccountTier:            pulumi.String("Standard"),
			AccountReplicationType: pulumi.String("LRS"),
		})
		if err != nil {
			return err
		}
		exampleFunctionApp, err := appservice.NewFunctionApp(ctx, "exampleFunctionApp", &appservice.FunctionAppArgs{
			Location:                exampleResourceGroup.Location,
			ResourceGroupName:       exampleResourceGroup.Name,
			AppServicePlanId:        examplePlan.ID(),
			StorageAccountName:      exampleAccount.Name,
			StorageAccountAccessKey: exampleAccount.PrimaryAccessKey,
		})
		if err != nil {
			return err
		}
		_, err = appservice.NewVirtualNetworkSwiftConnection(ctx, "exampleVirtualNetworkSwiftConnection", &appservice.VirtualNetworkSwiftConnectionArgs{
			AppServiceId: exampleFunctionApp.ID(),
			SubnetId:     exampleSubnet.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.network.inputs.SubnetDelegationArgs;
import com.pulumi.azure.network.inputs.SubnetDelegationServiceDelegationArgs;
import com.pulumi.azure.appservice.Plan;
import com.pulumi.azure.appservice.PlanArgs;
import com.pulumi.azure.appservice.inputs.PlanSkuArgs;
import com.pulumi.azure.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.appservice.FunctionApp;
import com.pulumi.azure.appservice.FunctionAppArgs;
import com.pulumi.azure.appservice.VirtualNetworkSwiftConnection;
import com.pulumi.azure.appservice.VirtualNetworkSwiftConnectionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

        var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()        
            .addressSpaces("10.0.0.0/16")
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .build());

        var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .virtualNetworkName(exampleVirtualNetwork.name())
            .addressPrefixes("10.0.1.0/24")
            .delegations(SubnetDelegationArgs.builder()
                .name("example-delegation")
                .serviceDelegation(SubnetDelegationServiceDelegationArgs.builder()
                    .name("Microsoft.Web/serverFarms")
                    .actions("Microsoft.Network/virtualNetworks/subnets/action")
                    .build())
                .build())
            .build());

        var examplePlan = new Plan("examplePlan", PlanArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .sku(PlanSkuArgs.builder()
                .tier("Standard")
                .size("S1")
                .build())
            .build());

        var exampleAccount = new Account("exampleAccount", AccountArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .location(exampleResourceGroup.location())
            .accountTier("Standard")
            .accountReplicationType("LRS")
            .build());

        var exampleFunctionApp = new FunctionApp("exampleFunctionApp", FunctionAppArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .appServicePlanId(examplePlan.id())
            .storageAccountName(exampleAccount.name())
            .storageAccountAccessKey(exampleAccount.primaryAccessKey())
            .build());

        var exampleVirtualNetworkSwiftConnection = new VirtualNetworkSwiftConnection("exampleVirtualNetworkSwiftConnection", VirtualNetworkSwiftConnectionArgs.builder()        
            .appServiceId(exampleFunctionApp.id())
            .subnetId(exampleSubnet.id())
            .build());

    }
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
    address_spaces=["10.0.0.0/16"],
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name)
example_subnet = azure.network.Subnet("exampleSubnet",
    resource_group_name=example_resource_group.name,
    virtual_network_name=example_virtual_network.name,
    address_prefixes=["10.0.1.0/24"],
    delegations=[azure.network.SubnetDelegationArgs(
        name="example-delegation",
        service_delegation=azure.network.SubnetDelegationServiceDelegationArgs(
            name="Microsoft.Web/serverFarms",
            actions=["Microsoft.Network/virtualNetworks/subnets/action"],
        ),
    )])
example_plan = azure.appservice.Plan("examplePlan",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    sku=azure.appservice.PlanSkuArgs(
        tier="Standard",
        size="S1",
    ))
example_account = azure.storage.Account("exampleAccount",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location,
    account_tier="Standard",
    account_replication_type="LRS")
example_function_app = azure.appservice.FunctionApp("exampleFunctionApp",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    app_service_plan_id=example_plan.id,
    storage_account_name=example_account.name,
    storage_account_access_key=example_account.primary_access_key)
example_virtual_network_swift_connection = azure.appservice.VirtualNetworkSwiftConnection("exampleVirtualNetworkSwiftConnection",
    app_service_id=example_function_app.id,
    subnet_id=example_subnet.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
    addressSpaces: ["10.0.0.0/16"],
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
});
const exampleSubnet = new azure.network.Subnet("exampleSubnet", {
    resourceGroupName: exampleResourceGroup.name,
    virtualNetworkName: exampleVirtualNetwork.name,
    addressPrefixes: ["10.0.1.0/24"],
    delegations: [{
        name: "example-delegation",
        serviceDelegation: {
            name: "Microsoft.Web/serverFarms",
            actions: ["Microsoft.Network/virtualNetworks/subnets/action"],
        },
    }],
});
const examplePlan = new azure.appservice.Plan("examplePlan", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    sku: {
        tier: "Standard",
        size: "S1",
    },
});
const exampleAccount = new azure.storage.Account("exampleAccount", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
    accountTier: "Standard",
    accountReplicationType: "LRS",
});
const exampleFunctionApp = new azure.appservice.FunctionApp("exampleFunctionApp", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    appServicePlanId: examplePlan.id,
    storageAccountName: exampleAccount.name,
    storageAccountAccessKey: exampleAccount.primaryAccessKey,
});
const exampleVirtualNetworkSwiftConnection = new azure.appservice.VirtualNetworkSwiftConnection("exampleVirtualNetworkSwiftConnection", {
    appServiceId: exampleFunctionApp.id,
    subnetId: exampleSubnet.id,
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleVirtualNetwork:
    type: azure:network:VirtualNetwork
    properties:
      addressSpaces:
        - 10.0.0.0/16
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
  exampleSubnet:
    type: azure:network:Subnet
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      virtualNetworkName: ${exampleVirtualNetwork.name}
      addressPrefixes:
        - 10.0.1.0/24
      delegations:
        - name: example-delegation
          serviceDelegation:
            name: Microsoft.Web/serverFarms
            actions:
              - Microsoft.Network/virtualNetworks/subnets/action
  examplePlan:
    type: azure:appservice:Plan
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      sku:
        tier: Standard
        size: S1
  exampleAccount:
    type: azure:storage:Account
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      location: ${exampleResourceGroup.location}
      accountTier: Standard
      accountReplicationType: LRS
  exampleFunctionApp:
    type: azure:appservice:FunctionApp
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      appServicePlanId: ${examplePlan.id}
      storageAccountName: ${exampleAccount.name}
      storageAccountAccessKey: ${exampleAccount.primaryAccessKey}
  exampleVirtualNetworkSwiftConnection:
    type: azure:appservice:VirtualNetworkSwiftConnection
    properties:
      appServiceId: ${exampleFunctionApp.id}
      subnetId: ${exampleSubnet.id}

Create VirtualNetworkSwiftConnection Resource

new VirtualNetworkSwiftConnection(name: string, args: VirtualNetworkSwiftConnectionArgs, opts?: CustomResourceOptions);
@overload
def VirtualNetworkSwiftConnection(resource_name: str,
                                  opts: Optional[ResourceOptions] = None,
                                  app_service_id: Optional[str] = None,
                                  subnet_id: Optional[str] = None)
@overload
def VirtualNetworkSwiftConnection(resource_name: str,
                                  args: VirtualNetworkSwiftConnectionArgs,
                                  opts: Optional[ResourceOptions] = None)
func NewVirtualNetworkSwiftConnection(ctx *Context, name string, args VirtualNetworkSwiftConnectionArgs, opts ...ResourceOption) (*VirtualNetworkSwiftConnection, error)
public VirtualNetworkSwiftConnection(string name, VirtualNetworkSwiftConnectionArgs args, CustomResourceOptions? opts = null)
public VirtualNetworkSwiftConnection(String name, VirtualNetworkSwiftConnectionArgs args)
public VirtualNetworkSwiftConnection(String name, VirtualNetworkSwiftConnectionArgs args, CustomResourceOptions options)
type: azure:appservice:VirtualNetworkSwiftConnection
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args VirtualNetworkSwiftConnectionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args VirtualNetworkSwiftConnectionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args VirtualNetworkSwiftConnectionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args VirtualNetworkSwiftConnectionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args VirtualNetworkSwiftConnectionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

VirtualNetworkSwiftConnection Resource Properties

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

Inputs

The VirtualNetworkSwiftConnection resource accepts the following input properties:

AppServiceId string

The ID of the App Service or Function App to associate to the VNet. Changing this forces a new resource to be created.

SubnetId string

The ID of the subnet the app service will be associated to (the subnet must have a service_delegation configured for Microsoft.Web/serverFarms).

AppServiceId string

The ID of the App Service or Function App to associate to the VNet. Changing this forces a new resource to be created.

SubnetId string

The ID of the subnet the app service will be associated to (the subnet must have a service_delegation configured for Microsoft.Web/serverFarms).

appServiceId String

The ID of the App Service or Function App to associate to the VNet. Changing this forces a new resource to be created.

subnetId String

The ID of the subnet the app service will be associated to (the subnet must have a service_delegation configured for Microsoft.Web/serverFarms).

appServiceId string

The ID of the App Service or Function App to associate to the VNet. Changing this forces a new resource to be created.

subnetId string

The ID of the subnet the app service will be associated to (the subnet must have a service_delegation configured for Microsoft.Web/serverFarms).

app_service_id str

The ID of the App Service or Function App to associate to the VNet. Changing this forces a new resource to be created.

subnet_id str

The ID of the subnet the app service will be associated to (the subnet must have a service_delegation configured for Microsoft.Web/serverFarms).

appServiceId String

The ID of the App Service or Function App to associate to the VNet. Changing this forces a new resource to be created.

subnetId String

The ID of the subnet the app service will be associated to (the subnet must have a service_delegation configured for Microsoft.Web/serverFarms).

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing VirtualNetworkSwiftConnection Resource

Get an existing VirtualNetworkSwiftConnection 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?: VirtualNetworkSwiftConnectionState, opts?: CustomResourceOptions): VirtualNetworkSwiftConnection
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        app_service_id: Optional[str] = None,
        subnet_id: Optional[str] = None) -> VirtualNetworkSwiftConnection
func GetVirtualNetworkSwiftConnection(ctx *Context, name string, id IDInput, state *VirtualNetworkSwiftConnectionState, opts ...ResourceOption) (*VirtualNetworkSwiftConnection, error)
public static VirtualNetworkSwiftConnection Get(string name, Input<string> id, VirtualNetworkSwiftConnectionState? state, CustomResourceOptions? opts = null)
public static VirtualNetworkSwiftConnection get(String name, Output<String> id, VirtualNetworkSwiftConnectionState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
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:
AppServiceId string

The ID of the App Service or Function App to associate to the VNet. Changing this forces a new resource to be created.

SubnetId string

The ID of the subnet the app service will be associated to (the subnet must have a service_delegation configured for Microsoft.Web/serverFarms).

AppServiceId string

The ID of the App Service or Function App to associate to the VNet. Changing this forces a new resource to be created.

SubnetId string

The ID of the subnet the app service will be associated to (the subnet must have a service_delegation configured for Microsoft.Web/serverFarms).

appServiceId String

The ID of the App Service or Function App to associate to the VNet. Changing this forces a new resource to be created.

subnetId String

The ID of the subnet the app service will be associated to (the subnet must have a service_delegation configured for Microsoft.Web/serverFarms).

appServiceId string

The ID of the App Service or Function App to associate to the VNet. Changing this forces a new resource to be created.

subnetId string

The ID of the subnet the app service will be associated to (the subnet must have a service_delegation configured for Microsoft.Web/serverFarms).

app_service_id str

The ID of the App Service or Function App to associate to the VNet. Changing this forces a new resource to be created.

subnet_id str

The ID of the subnet the app service will be associated to (the subnet must have a service_delegation configured for Microsoft.Web/serverFarms).

appServiceId String

The ID of the App Service or Function App to associate to the VNet. Changing this forces a new resource to be created.

subnetId String

The ID of the subnet the app service will be associated to (the subnet must have a service_delegation configured for Microsoft.Web/serverFarms).

Import

App Service Virtual Network Associations can be imported using the resource id, e.g.

 $ pulumi import azure:appservice/virtualNetworkSwiftConnection:VirtualNetworkSwiftConnection myassociation /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/sites/instance1/config/virtualNetwork

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.