1. Packages
  2. Packages
  3. Azure Classic
  4. API Docs
  5. appservice
  6. SlotVirtualNetworkSwiftConnection

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
azure logo

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Manages an App Service Slot’s Virtual Network Association (this is for the Regional VNet Integration which is still in preview).

    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 = "West Europe",
            });
            var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new Azure.Network.VirtualNetworkArgs
            {
                AddressSpaces = 
                {
                    "10.0.0.0/16",
                },
                Location = exampleResourceGroup.Location,
                ResourceGroupName = exampleResourceGroup.Name,
            });
            var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new Azure.Network.SubnetArgs
            {
                ResourceGroupName = exampleResourceGroup.Name,
                VirtualNetworkName = exampleVirtualNetwork.Name,
                AddressPrefixes = 
                {
                    "10.0.1.0/24",
                },
                Delegations = 
                {
                    new Azure.Network.Inputs.SubnetDelegationArgs
                    {
                        Name = "example-delegation",
                        ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs
                        {
                            Name = "Microsoft.Web/serverFarms",
                            Actions = 
                            {
                                "Microsoft.Network/virtualNetworks/subnets/action",
                            },
                        },
                    },
                },
            });
            var examplePlan = new Azure.AppService.Plan("examplePlan", new Azure.AppService.PlanArgs
            {
                Location = exampleResourceGroup.Location,
                ResourceGroupName = exampleResourceGroup.Name,
                Sku = new Azure.AppService.Inputs.PlanSkuArgs
                {
                    Tier = "Standard",
                    Size = "S1",
                },
            });
            var exampleAppService = new Azure.AppService.AppService("exampleAppService", new Azure.AppService.AppServiceArgs
            {
                Location = exampleResourceGroup.Location,
                ResourceGroupName = exampleResourceGroup.Name,
                AppServicePlanId = examplePlan.Id,
            });
            var example_staging = new Azure.AppService.Slot("example-staging", new Azure.AppService.SlotArgs
            {
                AppServiceName = exampleAppService.Name,
                Location = exampleResourceGroup.Location,
                ResourceGroupName = exampleResourceGroup.Name,
                AppServicePlanId = examplePlan.Id,
            });
            var exampleSlotVirtualNetworkSwiftConnection = new Azure.AppService.SlotVirtualNetworkSwiftConnection("exampleSlotVirtualNetworkSwiftConnection", new Azure.AppService.SlotVirtualNetworkSwiftConnectionArgs
            {
                SlotName = example_staging.Name,
                AppServiceId = exampleAppService.Id,
                SubnetId = exampleSubnet.Id,
            });
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/appservice"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v4/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.NewSlot(ctx, "example-staging", &appservice.SlotArgs{
    			AppServiceName:    exampleAppService.Name,
    			Location:          exampleResourceGroup.Location,
    			ResourceGroupName: exampleResourceGroup.Name,
    			AppServicePlanId:  examplePlan.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = appservice.NewSlotVirtualNetworkSwiftConnection(ctx, "exampleSlotVirtualNetworkSwiftConnection", &appservice.SlotVirtualNetworkSwiftConnectionArgs{
    			SlotName:     example_staging.Name,
    			AppServiceId: exampleAppService.ID(),
    			SubnetId:     exampleSubnet.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    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 example_staging = new azure.appservice.Slot("example-staging", {
        appServiceName: exampleAppService.name,
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
        appServicePlanId: examplePlan.id,
    });
    const exampleSlotVirtualNetworkSwiftConnection = new azure.appservice.SlotVirtualNetworkSwiftConnection("exampleSlotVirtualNetworkSwiftConnection", {
        slotName: example_staging.name,
        appServiceId: exampleAppService.id,
        subnetId: exampleSubnet.id,
    });
    
    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_staging = azure.appservice.Slot("example-staging",
        app_service_name=example_app_service.name,
        location=example_resource_group.location,
        resource_group_name=example_resource_group.name,
        app_service_plan_id=example_plan.id)
    example_slot_virtual_network_swift_connection = azure.appservice.SlotVirtualNetworkSwiftConnection("exampleSlotVirtualNetworkSwiftConnection",
        slot_name=example_staging.name,
        app_service_id=example_app_service.id,
        subnet_id=example_subnet.id)
    

    Example coming soon!

    Create SlotVirtualNetworkSwiftConnection Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

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

    Parameters

    name string
    The unique name of the resource.
    args SlotVirtualNetworkSwiftConnectionArgs
    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 SlotVirtualNetworkSwiftConnectionArgs
    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 SlotVirtualNetworkSwiftConnectionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SlotVirtualNetworkSwiftConnectionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SlotVirtualNetworkSwiftConnectionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var slotVirtualNetworkSwiftConnectionResource = new Azure.AppService.SlotVirtualNetworkSwiftConnection("slotVirtualNetworkSwiftConnectionResource", new()
    {
        AppServiceId = "string",
        SlotName = "string",
        SubnetId = "string",
    });
    
    example, err := appservice.NewSlotVirtualNetworkSwiftConnection(ctx, "slotVirtualNetworkSwiftConnectionResource", &appservice.SlotVirtualNetworkSwiftConnectionArgs{
    	AppServiceId: pulumi.String("string"),
    	SlotName:     pulumi.String("string"),
    	SubnetId:     pulumi.String("string"),
    })
    
    var slotVirtualNetworkSwiftConnectionResource = new SlotVirtualNetworkSwiftConnection("slotVirtualNetworkSwiftConnectionResource", SlotVirtualNetworkSwiftConnectionArgs.builder()
        .appServiceId("string")
        .slotName("string")
        .subnetId("string")
        .build());
    
    slot_virtual_network_swift_connection_resource = azure.appservice.SlotVirtualNetworkSwiftConnection("slotVirtualNetworkSwiftConnectionResource",
        app_service_id="string",
        slot_name="string",
        subnet_id="string")
    
    const slotVirtualNetworkSwiftConnectionResource = new azure.appservice.SlotVirtualNetworkSwiftConnection("slotVirtualNetworkSwiftConnectionResource", {
        appServiceId: "string",
        slotName: "string",
        subnetId: "string",
    });
    
    type: azure:appservice:SlotVirtualNetworkSwiftConnection
    properties:
        appServiceId: string
        slotName: string
        subnetId: string
    

    SlotVirtualNetworkSwiftConnection Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The SlotVirtualNetworkSwiftConnection 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.
    SlotName string
    The name of the App Service Slot or Function App Slot. 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.
    SlotName string
    The name of the App Service Slot or Function App Slot. 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.
    slotName String
    The name of the App Service Slot or Function App Slot. 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.
    slotName string
    The name of the App Service Slot or Function App Slot. 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.
    slot_name str
    The name of the App Service Slot or Function App Slot. 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.
    slotName String
    The name of the App Service Slot or Function App Slot. 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 SlotVirtualNetworkSwiftConnection 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 SlotVirtualNetworkSwiftConnection Resource

    Get an existing SlotVirtualNetworkSwiftConnection 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?: SlotVirtualNetworkSwiftConnectionState, opts?: CustomResourceOptions): SlotVirtualNetworkSwiftConnection
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            app_service_id: Optional[str] = None,
            slot_name: Optional[str] = None,
            subnet_id: Optional[str] = None) -> SlotVirtualNetworkSwiftConnection
    func GetSlotVirtualNetworkSwiftConnection(ctx *Context, name string, id IDInput, state *SlotVirtualNetworkSwiftConnectionState, opts ...ResourceOption) (*SlotVirtualNetworkSwiftConnection, error)
    public static SlotVirtualNetworkSwiftConnection Get(string name, Input<string> id, SlotVirtualNetworkSwiftConnectionState? state, CustomResourceOptions? opts = null)
    public static SlotVirtualNetworkSwiftConnection get(String name, Output<String> id, SlotVirtualNetworkSwiftConnectionState state, CustomResourceOptions options)
    resources:  _:    type: azure:appservice:SlotVirtualNetworkSwiftConnection    get:      id: ${id}
    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.
    SlotName string
    The name of the App Service Slot or Function App Slot. 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.
    SlotName string
    The name of the App Service Slot or Function App Slot. 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.
    slotName String
    The name of the App Service Slot or Function App Slot. 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.
    slotName string
    The name of the App Service Slot or Function App Slot. 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.
    slot_name str
    The name of the App Service Slot or Function App Slot. 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.
    slotName String
    The name of the App Service Slot or Function App Slot. 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 Slot Virtual Network Associations can be imported using the resource id, e.g.

     $ pulumi import azure:appservice/slotVirtualNetworkSwiftConnection:SlotVirtualNetworkSwiftConnection myassociation /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/sites/instance1/slots/staging/config/virtualNetwork
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Viewing docs for Azure v4.42.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.