We recommend using Azure Native.
azure.appservice.ActiveSlot
Explore with Pulumi AI
Promotes an App Service Slot to Production within an App Service.
!> NOTE: This resource has been deprecated in version 5.0 of the provider and will be removed in version 6.0. Please use azure.appservice.WebAppActiveSlot
resource instead.
Note: When using Slots - the
app_settings
,connection_string
andsite_config
blocks on theazure.appservice.AppService
resource will be overwritten when promoting a Slot using theazure.appservice.ActiveSlot
resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import * as random from "@pulumi/random";
const server = new random.RandomId("server", {});
const example = new azure.core.ResourceGroup("example", {});
const examplePlan = new azure.appservice.Plan("example", {});
const exampleAppService = new azure.appservice.AppService("example", {});
const exampleSlot = new azure.appservice.Slot("example", {});
const exampleActiveSlot = new azure.appservice.ActiveSlot("example", {
resourceGroupName: example.name,
appServiceName: exampleAppService.name,
appServiceSlotName: exampleSlot.name,
});
import pulumi
import pulumi_azure as azure
import pulumi_random as random
server = random.RandomId("server")
example = azure.core.ResourceGroup("example")
example_plan = azure.appservice.Plan("example")
example_app_service = azure.appservice.AppService("example")
example_slot = azure.appservice.Slot("example")
example_active_slot = azure.appservice.ActiveSlot("example",
resource_group_name=example.name,
app_service_name=example_app_service.name,
app_service_slot_name=example_slot.name)
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-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := random.NewRandomId(ctx, "server", nil)
if err != nil {
return err
}
example, err := core.NewResourceGroup(ctx, "example", nil)
if err != nil {
return err
}
_, err = appservice.NewPlan(ctx, "example", nil)
if err != nil {
return err
}
exampleAppService, err := appservice.NewAppService(ctx, "example", nil)
if err != nil {
return err
}
exampleSlot, err := appservice.NewSlot(ctx, "example", nil)
if err != nil {
return err
}
_, err = appservice.NewActiveSlot(ctx, "example", &appservice.ActiveSlotArgs{
ResourceGroupName: example.Name,
AppServiceName: exampleAppService.Name,
AppServiceSlotName: exampleSlot.Name,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var server = new Random.RandomId("server");
var example = new Azure.Core.ResourceGroup("example");
var examplePlan = new Azure.AppService.Plan("example");
var exampleAppService = new Azure.AppService.AppService("example");
var exampleSlot = new Azure.AppService.Slot("example");
var exampleActiveSlot = new Azure.AppService.ActiveSlot("example", new()
{
ResourceGroupName = example.Name,
AppServiceName = exampleAppService.Name,
AppServiceSlotName = exampleSlot.Name,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.RandomId;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.appservice.Plan;
import com.pulumi.azure.appservice.AppService;
import com.pulumi.azure.appservice.Slot;
import com.pulumi.azure.appservice.ActiveSlot;
import com.pulumi.azure.appservice.ActiveSlotArgs;
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 server = new RandomId("server");
var example = new ResourceGroup("example");
var examplePlan = new Plan("examplePlan");
var exampleAppService = new AppService("exampleAppService");
var exampleSlot = new Slot("exampleSlot");
var exampleActiveSlot = new ActiveSlot("exampleActiveSlot", ActiveSlotArgs.builder()
.resourceGroupName(example.name())
.appServiceName(exampleAppService.name())
.appServiceSlotName(exampleSlot.name())
.build());
}
}
resources:
server:
type: random:RandomId
example:
type: azure:core:ResourceGroup
examplePlan:
type: azure:appservice:Plan
name: example
exampleAppService:
type: azure:appservice:AppService
name: example
exampleSlot:
type: azure:appservice:Slot
name: example
exampleActiveSlot:
type: azure:appservice:ActiveSlot
name: example
properties:
resourceGroupName: ${example.name}
appServiceName: ${exampleAppService.name}
appServiceSlotName: ${exampleSlot.name}
Create ActiveSlot Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ActiveSlot(name: string, args: ActiveSlotArgs, opts?: CustomResourceOptions);
@overload
def ActiveSlot(resource_name: str,
args: ActiveSlotArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ActiveSlot(resource_name: str,
opts: Optional[ResourceOptions] = None,
app_service_name: Optional[str] = None,
app_service_slot_name: Optional[str] = None,
resource_group_name: Optional[str] = None)
func NewActiveSlot(ctx *Context, name string, args ActiveSlotArgs, opts ...ResourceOption) (*ActiveSlot, error)
public ActiveSlot(string name, ActiveSlotArgs args, CustomResourceOptions? opts = null)
public ActiveSlot(String name, ActiveSlotArgs args)
public ActiveSlot(String name, ActiveSlotArgs args, CustomResourceOptions options)
type: azure:appservice:ActiveSlot
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 ActiveSlotArgs
- 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 ActiveSlotArgs
- 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 ActiveSlotArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ActiveSlotArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ActiveSlotArgs
- 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 activeSlotResource = new Azure.AppService.ActiveSlot("activeSlotResource", new()
{
AppServiceName = "string",
AppServiceSlotName = "string",
ResourceGroupName = "string",
});
example, err := appservice.NewActiveSlot(ctx, "activeSlotResource", &appservice.ActiveSlotArgs{
AppServiceName: pulumi.String("string"),
AppServiceSlotName: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
})
var activeSlotResource = new ActiveSlot("activeSlotResource", ActiveSlotArgs.builder()
.appServiceName("string")
.appServiceSlotName("string")
.resourceGroupName("string")
.build());
active_slot_resource = azure.appservice.ActiveSlot("activeSlotResource",
app_service_name="string",
app_service_slot_name="string",
resource_group_name="string")
const activeSlotResource = new azure.appservice.ActiveSlot("activeSlotResource", {
appServiceName: "string",
appServiceSlotName: "string",
resourceGroupName: "string",
});
type: azure:appservice:ActiveSlot
properties:
appServiceName: string
appServiceSlotName: string
resourceGroupName: string
ActiveSlot 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 ActiveSlot resource accepts the following input properties:
- App
Service stringName - The name of the App Service within which the Slot exists. Changing this forces a new resource to be created.
- App
Service stringSlot Name - The name of the App Service Slot which should be promoted to the Production Slot within the App Service.
- Resource
Group stringName - The name of the resource group in which the App Service exists. Changing this forces a new resource to be created.
- App
Service stringName - The name of the App Service within which the Slot exists. Changing this forces a new resource to be created.
- App
Service stringSlot Name - The name of the App Service Slot which should be promoted to the Production Slot within the App Service.
- Resource
Group stringName - The name of the resource group in which the App Service exists. Changing this forces a new resource to be created.
- app
Service StringName - The name of the App Service within which the Slot exists. Changing this forces a new resource to be created.
- app
Service StringSlot Name - The name of the App Service Slot which should be promoted to the Production Slot within the App Service.
- resource
Group StringName - The name of the resource group in which the App Service exists. Changing this forces a new resource to be created.
- app
Service stringName - The name of the App Service within which the Slot exists. Changing this forces a new resource to be created.
- app
Service stringSlot Name - The name of the App Service Slot which should be promoted to the Production Slot within the App Service.
- resource
Group stringName - The name of the resource group in which the App Service exists. Changing this forces a new resource to be created.
- app_
service_ strname - The name of the App Service within which the Slot exists. Changing this forces a new resource to be created.
- app_
service_ strslot_ name - The name of the App Service Slot which should be promoted to the Production Slot within the App Service.
- resource_
group_ strname - The name of the resource group in which the App Service exists. Changing this forces a new resource to be created.
- app
Service StringName - The name of the App Service within which the Slot exists. Changing this forces a new resource to be created.
- app
Service StringSlot Name - The name of the App Service Slot which should be promoted to the Production Slot within the App Service.
- resource
Group StringName - The name of the resource group in which the App Service exists. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the ActiveSlot 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 ActiveSlot Resource
Get an existing ActiveSlot 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?: ActiveSlotState, opts?: CustomResourceOptions): ActiveSlot
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
app_service_name: Optional[str] = None,
app_service_slot_name: Optional[str] = None,
resource_group_name: Optional[str] = None) -> ActiveSlot
func GetActiveSlot(ctx *Context, name string, id IDInput, state *ActiveSlotState, opts ...ResourceOption) (*ActiveSlot, error)
public static ActiveSlot Get(string name, Input<string> id, ActiveSlotState? state, CustomResourceOptions? opts = null)
public static ActiveSlot get(String name, Output<String> id, ActiveSlotState 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.
- App
Service stringName - The name of the App Service within which the Slot exists. Changing this forces a new resource to be created.
- App
Service stringSlot Name - The name of the App Service Slot which should be promoted to the Production Slot within the App Service.
- Resource
Group stringName - The name of the resource group in which the App Service exists. Changing this forces a new resource to be created.
- App
Service stringName - The name of the App Service within which the Slot exists. Changing this forces a new resource to be created.
- App
Service stringSlot Name - The name of the App Service Slot which should be promoted to the Production Slot within the App Service.
- Resource
Group stringName - The name of the resource group in which the App Service exists. Changing this forces a new resource to be created.
- app
Service StringName - The name of the App Service within which the Slot exists. Changing this forces a new resource to be created.
- app
Service StringSlot Name - The name of the App Service Slot which should be promoted to the Production Slot within the App Service.
- resource
Group StringName - The name of the resource group in which the App Service exists. Changing this forces a new resource to be created.
- app
Service stringName - The name of the App Service within which the Slot exists. Changing this forces a new resource to be created.
- app
Service stringSlot Name - The name of the App Service Slot which should be promoted to the Production Slot within the App Service.
- resource
Group stringName - The name of the resource group in which the App Service exists. Changing this forces a new resource to be created.
- app_
service_ strname - The name of the App Service within which the Slot exists. Changing this forces a new resource to be created.
- app_
service_ strslot_ name - The name of the App Service Slot which should be promoted to the Production Slot within the App Service.
- resource_
group_ strname - The name of the resource group in which the App Service exists. Changing this forces a new resource to be created.
- app
Service StringName - The name of the App Service within which the Slot exists. Changing this forces a new resource to be created.
- app
Service StringSlot Name - The name of the App Service Slot which should be promoted to the Production Slot within the App Service.
- resource
Group StringName - The name of the resource group in which the App Service exists. Changing this forces a new resource to be created.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.