AppService

class AppService : KotlinCustomResource

Manages an App Service (within an App Service Plan). !>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.LinuxWebApp and azure.appservice.WindowsWebApp 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

This example provisions a Windows App Service.

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const examplePlan = new azure.appservice.Plan("example", {
name: "example-appserviceplan",
location: example.location,
resourceGroupName: example.name,
sku: {
tier: "Standard",
size: "S1",
},
});
const exampleAppService = new azure.appservice.AppService("example", {
name: "example-app-service",
location: example.location,
resourceGroupName: example.name,
appServicePlanId: examplePlan.id,
siteConfig: {
dotnetFrameworkVersion: "v4.0",
scmType: "LocalGit",
},
appSettings: {
SOME_KEY: "some-value",
},
connectionStrings: [{
name: "Database",
type: "SQLServer",
value: "Server=some-server.mydomain.com;Integrated Security=SSPI",
}],
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_plan = azure.appservice.Plan("example",
name="example-appserviceplan",
location=example.location,
resource_group_name=example.name,
sku={
"tier": "Standard",
"size": "S1",
})
example_app_service = azure.appservice.AppService("example",
name="example-app-service",
location=example.location,
resource_group_name=example.name,
app_service_plan_id=example_plan.id,
site_config={
"dotnet_framework_version": "v4.0",
"scm_type": "LocalGit",
},
app_settings={
"SOME_KEY": "some-value",
},
connection_strings=[{
"name": "Database",
"type": "SQLServer",
"value": "Server=some-server.mydomain.com;Integrated Security=SSPI",
}])
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 = "example-resources",
Location = "West Europe",
});
var examplePlan = new Azure.AppService.Plan("example", new()
{
Name = "example-appserviceplan",
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 = "example-app-service",
Location = example.Location,
ResourceGroupName = example.Name,
AppServicePlanId = examplePlan.Id,
SiteConfig = new Azure.AppService.Inputs.AppServiceSiteConfigArgs
{
DotnetFrameworkVersion = "v4.0",
ScmType = "LocalGit",
},
AppSettings =
{
{ "SOME_KEY", "some-value" },
},
ConnectionStrings = new[]
{
new Azure.AppService.Inputs.AppServiceConnectionStringArgs
{
Name = "Database",
Type = "SQLServer",
Value = "Server=some-server.mydomain.com;Integrated Security=SSPI",
},
},
});
});
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("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
examplePlan, err := appservice.NewPlan(ctx, "example", &appservice.PlanArgs{
Name: pulumi.String("example-appserviceplan"),
Location: example.Location,
ResourceGroupName: example.Name,
Sku: &appservice.PlanSkuArgs{
Tier: pulumi.String("Standard"),
Size: pulumi.String("S1"),
},
})
if err != nil {
return err
}
_, err = appservice.NewAppService(ctx, "example", &appservice.AppServiceArgs{
Name: pulumi.String("example-app-service"),
Location: example.Location,
ResourceGroupName: example.Name,
AppServicePlanId: examplePlan.ID(),
SiteConfig: &appservice.AppServiceSiteConfigArgs{
DotnetFrameworkVersion: pulumi.String("v4.0"),
ScmType: pulumi.String("LocalGit"),
},
AppSettings: pulumi.StringMap{
"SOME_KEY": pulumi.String("some-value"),
},
ConnectionStrings: appservice.AppServiceConnectionStringArray{
&appservice.AppServiceConnectionStringArgs{
Name: pulumi.String("Database"),
Type: pulumi.String("SQLServer"),
Value: pulumi.String("Server=some-server.mydomain.com;Integrated Security=SSPI"),
},
},
})
if err != nil {
return err
}
return nil
})
}
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.inputs.AppServiceSiteConfigArgs;
import com.pulumi.azure.appservice.inputs.AppServiceConnectionStringArgs;
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("example-resources")
.location("West Europe")
.build());
var examplePlan = new Plan("examplePlan", PlanArgs.builder()
.name("example-appserviceplan")
.location(example.location())
.resourceGroupName(example.name())
.sku(PlanSkuArgs.builder()
.tier("Standard")
.size("S1")
.build())
.build());
var exampleAppService = new AppService("exampleAppService", AppServiceArgs.builder()
.name("example-app-service")
.location(example.location())
.resourceGroupName(example.name())
.appServicePlanId(examplePlan.id())
.siteConfig(AppServiceSiteConfigArgs.builder()
.dotnetFrameworkVersion("v4.0")
.scmType("LocalGit")
.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());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
examplePlan:
type: azure:appservice:Plan
name: example
properties:
name: example-appserviceplan
location: ${example.location}
resourceGroupName: ${example.name}
sku:
tier: Standard
size: S1
exampleAppService:
type: azure:appservice:AppService
name: example
properties:
name: example-app-service
location: ${example.location}
resourceGroupName: ${example.name}
appServicePlanId: ${examplePlan.id}
siteConfig:
dotnetFrameworkVersion: v4.0
scmType: LocalGit
appSettings:
SOME_KEY: some-value
connectionStrings:
- name: Database
type: SQLServer
value: Server=some-server.mydomain.com;Integrated Security=SSPI

Import

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

$ pulumi import azure:appservice/appService:AppService instance1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/sites/instance1

Properties

Link copied to clipboard

The ID of the App Service Plan within which to create this App Service.

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
val backup: Output<AppServiceBackup>?

A backup block as defined below.

Link copied to clipboard

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

Link copied to clipboard

Does the App Service require client certificates for incoming requests? Defaults to false.

Link copied to clipboard
val clientCertMode: Output<String>

Mode of client certificates for this App Service. Possible values are Required, Optional and OptionalInteractiveUser. If this parameter is set, client_cert_enabled must be set to true, otherwise this parameter is ignored.

Link copied to clipboard

One or more connection_string blocks as defined below.

Link copied to clipboard

An identifier used by App Service to perform domain ownership verification via DNS TXT record.

Link copied to clipboard

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

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

Is the App Service Enabled? Defaults to true.

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

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

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

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. For more information see - Access vaults with a user-assigned identity

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<AppServiceLogs>

A logs block as defined below.

Link copied to clipboard
val name: Output<String>

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

Link copied to clipboard

A comma separated list of outbound IP addresses - such as 52.23.25.3,52.143.43.12

Link copied to clipboard

A list of outbound IP addresses - such as ["52&#46;23&#46;25&#46;3", "52&#46;143&#46;43&#46;12"]

Link copied to clipboard

A comma separated list of outbound IP addresses - such as 52.23.25.3,52.143.43.12,52.143.43.17 - not all of which are necessarily in use. Superset of outbound_ip_addresses.

Link copied to clipboard

A list of outbound IP addresses - such as ["52&#46;23&#46;25&#46;3", "52&#46;143&#46;43&#46;12", "52&#46;143&#46;43&#46;17"] - not all of which are necessarily in use. Superset of outbound_ip_address_list.

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. Changing this forces a new resource to be created.

Link copied to clipboard

A site_config block 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.

Link copied to clipboard

A source_control block as defined below.

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>