Skip to content

azurermAppServiceActiveSlot

Promotes an App Service Slot to Production 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 azurermWebAppActiveSlot resource instead.

-> Note: When using Slots - the appSettings, connectionString and siteConfig blocks on the azurermAppService resource will be overwritten when promoting a Slot using the azurermAppServiceActiveSlot resource.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
import * as random from "./.gen/providers/random";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm, random.
For a more precise conversion please use the --provider flag in convert.*/
const azurermAppServiceExample = new azurerm.appService.AppService(
  this,
  "example",
  {}
);
const azurermAppServicePlanExample = new azurerm.appServicePlan.AppServicePlan(
  this,
  "example_1",
  {}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermAppServicePlanExample.overrideLogicalId("example");
const azurermAppServiceSlotExample = new azurerm.appServiceSlot.AppServiceSlot(
  this,
  "example_2",
  {}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermAppServiceSlotExample.overrideLogicalId("example");
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example_3",
  {}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermResourceGroupExample.overrideLogicalId("example");
new random.id.Id(this, "server", {});
const azurermAppServiceActiveSlotExample =
  new azurerm.appServiceActiveSlot.AppServiceActiveSlot(this, "example_5", {
    app_service_name: azurermAppServiceExample.name,
    app_service_slot_name: azurermAppServiceSlotExample.name,
    resource_group_name: azurermResourceGroupExample.name,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermAppServiceActiveSlotExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • resourceGroupName - (Required) The name of the resource group in which the App Service exists. Changing this forces a new resource to be created.

  • appServiceName - (Required) The name of the App Service within which the Slot exists. Changing this forces a new resource to be created.

  • appServiceSlotName - (Required) The name of the App Service Slot which should be promoted to the Production Slot within the App Service.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the App Service Active Slot.
  • update - (Defaults to 30 minutes) Used when updating the App Service Active Slot.
  • read - (Defaults to 5 minutes) Used when retrieving the App Service Active Slot.
  • delete - (Defaults to 30 minutes) Used when deleting the App Service Active Slot.