Slot

class Slot : KotlinCustomResource

Manages an App Service Slot (within an App Service). !>NOTE: This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use azure.appservice.LinuxWebAppSlot resources instead.

Note: When using Slots - the app_settings, connection_string and site_config blocks on the azure.appservice.AppService resource will be overwritten when promoting a Slot using the azure.appservice.ActiveSlot resource.

Example Usage

NET 4.X)

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.RandomId;
import com.pulumi.random.RandomIdArgs;
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.inputs.AppServiceSiteConfigArgs;
import com.pulumi.azure.appservice.inputs.AppServiceConnectionStringArgs;
import com.pulumi.azure.appservice.Slot;
import com.pulumi.azure.appservice.SlotArgs;
import com.pulumi.azure.appservice.inputs.SlotSiteConfigArgs;
import com.pulumi.azure.appservice.inputs.SlotConnectionStringArgs;
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", RandomIdArgs.builder()
.keepers(Map.of("azi_id", 1))
.byteLength(8)
.build());
var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.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())
.siteConfig(AppServiceSiteConfigArgs.builder()
.dotnetFrameworkVersion("v4.0")
.build())
.appSettings(Map.of("SOME_KEY", "some-value"))
.connectionStrings(AppServiceConnectionStringArgs.builder()
.name("Database")
.type("SQLServer")
.value("Server=some-server.mydomain.com;Integrated Security=SSPI")
.build())
.build());
var exampleSlot = new Slot("exampleSlot", SlotArgs.builder()
.appServiceName(exampleAppService.name())
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.appServicePlanId(examplePlan.id())
.siteConfig(SlotSiteConfigArgs.builder()
.dotnetFrameworkVersion("v4.0")
.build())
.appSettings(Map.of("SOME_KEY", "some-value"))
.connectionStrings(SlotConnectionStringArgs.builder()
.name("Database")
.type("SQLServer")
.value("Server=some-server.mydomain.com;Integrated Security=SSPI")
.build())
.build());
}
}

Java 1.8)

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.RandomId;
import com.pulumi.random.RandomIdArgs;
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.inputs.AppServiceSiteConfigArgs;
import com.pulumi.azure.appservice.Slot;
import com.pulumi.azure.appservice.SlotArgs;
import com.pulumi.azure.appservice.inputs.SlotSiteConfigArgs;
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", RandomIdArgs.builder()
.keepers(Map.of("azi_id", 1))
.byteLength(8)
.build());
var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.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())
.siteConfig(AppServiceSiteConfigArgs.builder()
.javaVersion("1.8")
.javaContainer("JETTY")
.javaContainerVersion("9.3")
.build())
.build());
var exampleSlot = new Slot("exampleSlot", SlotArgs.builder()
.appServiceName(exampleAppService.name())
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.appServicePlanId(examplePlan.id())
.siteConfig(SlotSiteConfigArgs.builder()
.javaVersion("1.8")
.javaContainer("JETTY")
.javaContainerVersion("9.3")
.build())
.build());
}
}

Import

App Service Slots can be imported using the resource id, e.g.

$ pulumi import azure:appservice/slot:Slot instance1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/sites/website1/slots/instance1

Properties

Link copied to clipboard
val appServiceName: Output<String>

The name of the App Service within which to create the App Service Slot. Changing this forces a new resource to be created.

Link copied to clipboard

The ID of the App Service Plan within which to create this App Service Slot. Changing this forces a new resource to be created.

Link copied to clipboard
val appSettings: Output<Map<String, String>>

A key-value pair of App Settings.

Link copied to clipboard

A auth_settings block as defined below.

Link copied to clipboard

Should the App Service Slot send session affinity cookies, which route client requests in the same session to the same instance?

Link copied to clipboard

An connection_string block as defined below.

Link copied to clipboard

The Default Hostname associated with the App Service Slot - such as mysite.azurewebsites.net

Link copied to clipboard
val enabled: Output<Boolean>?

Is the App Service Slot Enabled? Defaults to true.

Link copied to clipboard
val httpsOnly: Output<Boolean>?

Can the App Service Slot only be accessed via HTTPS? Defaults to false.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val identity: Output<SlotIdentity>?

An identity block as defined below.

Link copied to clipboard

The User Assigned Identity Id used for looking up KeyVault secrets. The identity must be assigned to the application. See Access vaults with a user-assigned identity for more information.

Link copied to clipboard
val location: Output<String>

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

Link copied to clipboard
val logs: Output<SlotLogs>

A logs block as defined below.

Link copied to clipboard
val name: Output<String>

Specifies the name of the App Service Slot component. Changing this forces a new resource to be created.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The name of the resource group in which to create the App Service Slot component. Changing this forces a new resource to be created.

Link copied to clipboard

A site_config object as defined below.

Link copied to clipboard

A site_credential block as defined below, which contains the site-level credentials used to publish to this App Service slot.

Link copied to clipboard

One or more storage_account blocks as defined below.

Link copied to clipboard
val tags: Output<Map<String, String>>?

A mapping of tags to assign to the resource.

Link copied to clipboard
val urn: Output<String>