We recommend using Azure Native.
azure.appservice.SlotCustomHostnameBinding
Explore with Pulumi AI
Manages a Hostname Binding within an App Service Slot.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
    name: "some-resource-group",
    location: "West Europe",
});
const examplePlan = new azure.appservice.Plan("example", {
    name: "some-app-service-plan",
    location: example.location,
    resourceGroupName: example.name,
    sku: {
        tier: "Standard",
        size: "S1",
    },
});
const exampleAppService = new azure.appservice.AppService("example", {
    name: "some-app-service",
    location: example.location,
    resourceGroupName: example.name,
    appServicePlanId: examplePlan.id,
});
const exampleSlot = new azure.appservice.Slot("example", {
    name: "staging",
    location: example.location,
    resourceGroupName: example.name,
    appServiceName: exampleAppService.name,
    appServicePlanId: examplePlan.id,
});
const exampleSlotCustomHostnameBinding = new azure.appservice.SlotCustomHostnameBinding("example", {
    appServiceSlotId: exampleSlot.id,
    hostname: "www.mywebsite.com",
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
    name="some-resource-group",
    location="West Europe")
example_plan = azure.appservice.Plan("example",
    name="some-app-service-plan",
    location=example.location,
    resource_group_name=example.name,
    sku={
        "tier": "Standard",
        "size": "S1",
    })
example_app_service = azure.appservice.AppService("example",
    name="some-app-service",
    location=example.location,
    resource_group_name=example.name,
    app_service_plan_id=example_plan.id)
example_slot = azure.appservice.Slot("example",
    name="staging",
    location=example.location,
    resource_group_name=example.name,
    app_service_name=example_app_service.name,
    app_service_plan_id=example_plan.id)
example_slot_custom_hostname_binding = azure.appservice.SlotCustomHostnameBinding("example",
    app_service_slot_id=example_slot.id,
    hostname="www.mywebsite.com")
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/appservice"
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
			Name:     pulumi.String("some-resource-group"),
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		examplePlan, err := appservice.NewPlan(ctx, "example", &appservice.PlanArgs{
			Name:              pulumi.String("some-app-service-plan"),
			Location:          example.Location,
			ResourceGroupName: example.Name,
			Sku: &appservice.PlanSkuArgs{
				Tier: pulumi.String("Standard"),
				Size: pulumi.String("S1"),
			},
		})
		if err != nil {
			return err
		}
		exampleAppService, err := appservice.NewAppService(ctx, "example", &appservice.AppServiceArgs{
			Name:              pulumi.String("some-app-service"),
			Location:          example.Location,
			ResourceGroupName: example.Name,
			AppServicePlanId:  examplePlan.ID(),
		})
		if err != nil {
			return err
		}
		exampleSlot, err := appservice.NewSlot(ctx, "example", &appservice.SlotArgs{
			Name:              pulumi.String("staging"),
			Location:          example.Location,
			ResourceGroupName: example.Name,
			AppServiceName:    exampleAppService.Name,
			AppServicePlanId:  examplePlan.ID(),
		})
		if err != nil {
			return err
		}
		_, err = appservice.NewSlotCustomHostnameBinding(ctx, "example", &appservice.SlotCustomHostnameBindingArgs{
			AppServiceSlotId: exampleSlot.ID(),
			Hostname:         pulumi.String("www.mywebsite.com"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = new Azure.Core.ResourceGroup("example", new()
    {
        Name = "some-resource-group",
        Location = "West Europe",
    });
    var examplePlan = new Azure.AppService.Plan("example", new()
    {
        Name = "some-app-service-plan",
        Location = example.Location,
        ResourceGroupName = example.Name,
        Sku = new Azure.AppService.Inputs.PlanSkuArgs
        {
            Tier = "Standard",
            Size = "S1",
        },
    });
    var exampleAppService = new Azure.AppService.AppService("example", new()
    {
        Name = "some-app-service",
        Location = example.Location,
        ResourceGroupName = example.Name,
        AppServicePlanId = examplePlan.Id,
    });
    var exampleSlot = new Azure.AppService.Slot("example", new()
    {
        Name = "staging",
        Location = example.Location,
        ResourceGroupName = example.Name,
        AppServiceName = exampleAppService.Name,
        AppServicePlanId = examplePlan.Id,
    });
    var exampleSlotCustomHostnameBinding = new Azure.AppService.SlotCustomHostnameBinding("example", new()
    {
        AppServiceSlotId = exampleSlot.Id,
        Hostname = "www.mywebsite.com",
    });
});
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.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.Slot;
import com.pulumi.azure.appservice.SlotArgs;
import com.pulumi.azure.appservice.SlotCustomHostnameBinding;
import com.pulumi.azure.appservice.SlotCustomHostnameBindingArgs;
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
            .name("some-resource-group")
            .location("West Europe")
            .build());
        var examplePlan = new Plan("examplePlan", PlanArgs.builder()
            .name("some-app-service-plan")
            .location(example.location())
            .resourceGroupName(example.name())
            .sku(PlanSkuArgs.builder()
                .tier("Standard")
                .size("S1")
                .build())
            .build());
        var exampleAppService = new AppService("exampleAppService", AppServiceArgs.builder()
            .name("some-app-service")
            .location(example.location())
            .resourceGroupName(example.name())
            .appServicePlanId(examplePlan.id())
            .build());
        var exampleSlot = new Slot("exampleSlot", SlotArgs.builder()
            .name("staging")
            .location(example.location())
            .resourceGroupName(example.name())
            .appServiceName(exampleAppService.name())
            .appServicePlanId(examplePlan.id())
            .build());
        var exampleSlotCustomHostnameBinding = new SlotCustomHostnameBinding("exampleSlotCustomHostnameBinding", SlotCustomHostnameBindingArgs.builder()
            .appServiceSlotId(exampleSlot.id())
            .hostname("www.mywebsite.com")
            .build());
    }
}
resources:
  example:
    type: azure:core:ResourceGroup
    properties:
      name: some-resource-group
      location: West Europe
  examplePlan:
    type: azure:appservice:Plan
    name: example
    properties:
      name: some-app-service-plan
      location: ${example.location}
      resourceGroupName: ${example.name}
      sku:
        tier: Standard
        size: S1
  exampleAppService:
    type: azure:appservice:AppService
    name: example
    properties:
      name: some-app-service
      location: ${example.location}
      resourceGroupName: ${example.name}
      appServicePlanId: ${examplePlan.id}
  exampleSlot:
    type: azure:appservice:Slot
    name: example
    properties:
      name: staging
      location: ${example.location}
      resourceGroupName: ${example.name}
      appServiceName: ${exampleAppService.name}
      appServicePlanId: ${examplePlan.id}
  exampleSlotCustomHostnameBinding:
    type: azure:appservice:SlotCustomHostnameBinding
    name: example
    properties:
      appServiceSlotId: ${exampleSlot.id}
      hostname: www.mywebsite.com
Create SlotCustomHostnameBinding Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SlotCustomHostnameBinding(name: string, args: SlotCustomHostnameBindingArgs, opts?: CustomResourceOptions);@overload
def SlotCustomHostnameBinding(resource_name: str,
                              args: SlotCustomHostnameBindingArgs,
                              opts: Optional[ResourceOptions] = None)
@overload
def SlotCustomHostnameBinding(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              app_service_slot_id: Optional[str] = None,
                              hostname: Optional[str] = None,
                              ssl_state: Optional[str] = None,
                              thumbprint: Optional[str] = None)func NewSlotCustomHostnameBinding(ctx *Context, name string, args SlotCustomHostnameBindingArgs, opts ...ResourceOption) (*SlotCustomHostnameBinding, error)public SlotCustomHostnameBinding(string name, SlotCustomHostnameBindingArgs args, CustomResourceOptions? opts = null)
public SlotCustomHostnameBinding(String name, SlotCustomHostnameBindingArgs args)
public SlotCustomHostnameBinding(String name, SlotCustomHostnameBindingArgs args, CustomResourceOptions options)
type: azure:appservice:SlotCustomHostnameBinding
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 SlotCustomHostnameBindingArgs
- 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 SlotCustomHostnameBindingArgs
- 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 SlotCustomHostnameBindingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SlotCustomHostnameBindingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SlotCustomHostnameBindingArgs
- 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 slotCustomHostnameBindingResource = new Azure.AppService.SlotCustomHostnameBinding("slotCustomHostnameBindingResource", new()
{
    AppServiceSlotId = "string",
    Hostname = "string",
    SslState = "string",
    Thumbprint = "string",
});
example, err := appservice.NewSlotCustomHostnameBinding(ctx, "slotCustomHostnameBindingResource", &appservice.SlotCustomHostnameBindingArgs{
	AppServiceSlotId: pulumi.String("string"),
	Hostname:         pulumi.String("string"),
	SslState:         pulumi.String("string"),
	Thumbprint:       pulumi.String("string"),
})
var slotCustomHostnameBindingResource = new SlotCustomHostnameBinding("slotCustomHostnameBindingResource", SlotCustomHostnameBindingArgs.builder()
    .appServiceSlotId("string")
    .hostname("string")
    .sslState("string")
    .thumbprint("string")
    .build());
slot_custom_hostname_binding_resource = azure.appservice.SlotCustomHostnameBinding("slotCustomHostnameBindingResource",
    app_service_slot_id="string",
    hostname="string",
    ssl_state="string",
    thumbprint="string")
const slotCustomHostnameBindingResource = new azure.appservice.SlotCustomHostnameBinding("slotCustomHostnameBindingResource", {
    appServiceSlotId: "string",
    hostname: "string",
    sslState: "string",
    thumbprint: "string",
});
type: azure:appservice:SlotCustomHostnameBinding
properties:
    appServiceSlotId: string
    hostname: string
    sslState: string
    thumbprint: string
SlotCustomHostnameBinding 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 SlotCustomHostnameBinding resource accepts the following input properties:
- AppService stringSlot Id 
- The ID of the App Service Slot. Changing this forces a new resource to be created.
- Hostname string
- Specifies the Custom Hostname to use for the App Service, example - www.example.com. Changing this forces a new resource to be created.- NOTE: A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding. 
- SslState string
- The SSL type. Possible values are IpBasedEnabledandSniEnabled. Changing this forces a new resource to be created.
- Thumbprint string
- The SSL certificate thumbprint. Changing this forces a new resource to be created. - NOTE: - thumbprintmust be specified when- ssl_stateis set.
- AppService stringSlot Id 
- The ID of the App Service Slot. Changing this forces a new resource to be created.
- Hostname string
- Specifies the Custom Hostname to use for the App Service, example - www.example.com. Changing this forces a new resource to be created.- NOTE: A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding. 
- SslState string
- The SSL type. Possible values are IpBasedEnabledandSniEnabled. Changing this forces a new resource to be created.
- Thumbprint string
- The SSL certificate thumbprint. Changing this forces a new resource to be created. - NOTE: - thumbprintmust be specified when- ssl_stateis set.
- appService StringSlot Id 
- The ID of the App Service Slot. Changing this forces a new resource to be created.
- hostname String
- Specifies the Custom Hostname to use for the App Service, example - www.example.com. Changing this forces a new resource to be created.- NOTE: A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding. 
- sslState String
- The SSL type. Possible values are IpBasedEnabledandSniEnabled. Changing this forces a new resource to be created.
- thumbprint String
- The SSL certificate thumbprint. Changing this forces a new resource to be created. - NOTE: - thumbprintmust be specified when- ssl_stateis set.
- appService stringSlot Id 
- The ID of the App Service Slot. Changing this forces a new resource to be created.
- hostname string
- Specifies the Custom Hostname to use for the App Service, example - www.example.com. Changing this forces a new resource to be created.- NOTE: A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding. 
- sslState string
- The SSL type. Possible values are IpBasedEnabledandSniEnabled. Changing this forces a new resource to be created.
- thumbprint string
- The SSL certificate thumbprint. Changing this forces a new resource to be created. - NOTE: - thumbprintmust be specified when- ssl_stateis set.
- app_service_ strslot_ id 
- The ID of the App Service Slot. Changing this forces a new resource to be created.
- hostname str
- Specifies the Custom Hostname to use for the App Service, example - www.example.com. Changing this forces a new resource to be created.- NOTE: A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding. 
- ssl_state str
- The SSL type. Possible values are IpBasedEnabledandSniEnabled. Changing this forces a new resource to be created.
- thumbprint str
- The SSL certificate thumbprint. Changing this forces a new resource to be created. - NOTE: - thumbprintmust be specified when- ssl_stateis set.
- appService StringSlot Id 
- The ID of the App Service Slot. Changing this forces a new resource to be created.
- hostname String
- Specifies the Custom Hostname to use for the App Service, example - www.example.com. Changing this forces a new resource to be created.- NOTE: A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding. 
- sslState String
- The SSL type. Possible values are IpBasedEnabledandSniEnabled. Changing this forces a new resource to be created.
- thumbprint String
- The SSL certificate thumbprint. Changing this forces a new resource to be created. - NOTE: - thumbprintmust be specified when- ssl_stateis set.
Outputs
All input properties are implicitly available as output properties. Additionally, the SlotCustomHostnameBinding resource produces the following output properties:
- id str
- The provider-assigned unique ID for this managed resource.
- virtual_ip str
- The virtual IP address assigned to the hostname if IP based SSL is enabled.
Look up Existing SlotCustomHostnameBinding Resource
Get an existing SlotCustomHostnameBinding 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?: SlotCustomHostnameBindingState, opts?: CustomResourceOptions): SlotCustomHostnameBinding@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        app_service_slot_id: Optional[str] = None,
        hostname: Optional[str] = None,
        ssl_state: Optional[str] = None,
        thumbprint: Optional[str] = None,
        virtual_ip: Optional[str] = None) -> SlotCustomHostnameBindingfunc GetSlotCustomHostnameBinding(ctx *Context, name string, id IDInput, state *SlotCustomHostnameBindingState, opts ...ResourceOption) (*SlotCustomHostnameBinding, error)public static SlotCustomHostnameBinding Get(string name, Input<string> id, SlotCustomHostnameBindingState? state, CustomResourceOptions? opts = null)public static SlotCustomHostnameBinding get(String name, Output<String> id, SlotCustomHostnameBindingState state, CustomResourceOptions options)resources:  _:    type: azure:appservice:SlotCustomHostnameBinding    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.
- AppService stringSlot Id 
- The ID of the App Service Slot. Changing this forces a new resource to be created.
- Hostname string
- Specifies the Custom Hostname to use for the App Service, example - www.example.com. Changing this forces a new resource to be created.- NOTE: A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding. 
- SslState string
- The SSL type. Possible values are IpBasedEnabledandSniEnabled. Changing this forces a new resource to be created.
- Thumbprint string
- The SSL certificate thumbprint. Changing this forces a new resource to be created. - NOTE: - thumbprintmust be specified when- ssl_stateis set.
- VirtualIp string
- The virtual IP address assigned to the hostname if IP based SSL is enabled.
- AppService stringSlot Id 
- The ID of the App Service Slot. Changing this forces a new resource to be created.
- Hostname string
- Specifies the Custom Hostname to use for the App Service, example - www.example.com. Changing this forces a new resource to be created.- NOTE: A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding. 
- SslState string
- The SSL type. Possible values are IpBasedEnabledandSniEnabled. Changing this forces a new resource to be created.
- Thumbprint string
- The SSL certificate thumbprint. Changing this forces a new resource to be created. - NOTE: - thumbprintmust be specified when- ssl_stateis set.
- VirtualIp string
- The virtual IP address assigned to the hostname if IP based SSL is enabled.
- appService StringSlot Id 
- The ID of the App Service Slot. Changing this forces a new resource to be created.
- hostname String
- Specifies the Custom Hostname to use for the App Service, example - www.example.com. Changing this forces a new resource to be created.- NOTE: A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding. 
- sslState String
- The SSL type. Possible values are IpBasedEnabledandSniEnabled. Changing this forces a new resource to be created.
- thumbprint String
- The SSL certificate thumbprint. Changing this forces a new resource to be created. - NOTE: - thumbprintmust be specified when- ssl_stateis set.
- virtualIp String
- The virtual IP address assigned to the hostname if IP based SSL is enabled.
- appService stringSlot Id 
- The ID of the App Service Slot. Changing this forces a new resource to be created.
- hostname string
- Specifies the Custom Hostname to use for the App Service, example - www.example.com. Changing this forces a new resource to be created.- NOTE: A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding. 
- sslState string
- The SSL type. Possible values are IpBasedEnabledandSniEnabled. Changing this forces a new resource to be created.
- thumbprint string
- The SSL certificate thumbprint. Changing this forces a new resource to be created. - NOTE: - thumbprintmust be specified when- ssl_stateis set.
- virtualIp string
- The virtual IP address assigned to the hostname if IP based SSL is enabled.
- app_service_ strslot_ id 
- The ID of the App Service Slot. Changing this forces a new resource to be created.
- hostname str
- Specifies the Custom Hostname to use for the App Service, example - www.example.com. Changing this forces a new resource to be created.- NOTE: A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding. 
- ssl_state str
- The SSL type. Possible values are IpBasedEnabledandSniEnabled. Changing this forces a new resource to be created.
- thumbprint str
- The SSL certificate thumbprint. Changing this forces a new resource to be created. - NOTE: - thumbprintmust be specified when- ssl_stateis set.
- virtual_ip str
- The virtual IP address assigned to the hostname if IP based SSL is enabled.
- appService StringSlot Id 
- The ID of the App Service Slot. Changing this forces a new resource to be created.
- hostname String
- Specifies the Custom Hostname to use for the App Service, example - www.example.com. Changing this forces a new resource to be created.- NOTE: A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding. 
- sslState String
- The SSL type. Possible values are IpBasedEnabledandSniEnabled. Changing this forces a new resource to be created.
- thumbprint String
- The SSL certificate thumbprint. Changing this forces a new resource to be created. - NOTE: - thumbprintmust be specified when- ssl_stateis set.
- virtualIp String
- The virtual IP address assigned to the hostname if IP based SSL is enabled.
Import
App Service Custom Hostname Bindings can be imported using the resource id, e.g.
$ pulumi import azure:appservice/slotCustomHostnameBinding:SlotCustomHostnameBinding mywebsite /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/sites/instance1/slots/staging/hostNameBindings/mywebsite.com
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 azurermTerraform Provider.