AppFlexConsumption

class AppFlexConsumption : KotlinCustomResource

Manages a Function App Running on a Flex Consumption Plan.

Example Usage

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 exampleAccount = new azure.storage.Account("example", {
name: "examplelinuxfunctionappsa",
resourceGroupName: example.name,
location: example.location,
accountTier: "Standard",
accountReplicationType: "LRS",
});
const exampleContainer = new azure.storage.Container("example", {
name: "example-flexcontainer",
storageAccountId: exampleAccount.id,
containerAccessType: "private",
});
const exampleServicePlan = new azure.appservice.ServicePlan("example", {
name: "example-app-service-plan",
resourceGroupName: example.name,
location: example.location,
skuName: "FC1",
osType: "Linux",
});
const exampleAppFlexConsumption = new azure.appservice.AppFlexConsumption("example", {
name: "example-linux-function-app",
resourceGroupName: example.name,
location: example.location,
servicePlanId: exampleServicePlan.id,
storageContainerType: "blobContainer",
storageContainerEndpoint: pulumi.interpolate`${exampleAccount.primaryBlobEndpoint}${exampleContainer.name}`,
storageAuthenticationType: "StorageAccountConnectionString",
storageAccessKey: exampleAccount.primaryAccessKey,
runtimeName: "node",
runtimeVersion: "20",
maximumInstanceCount: 50,
instanceMemoryInMb: 2048,
siteConfig: {},
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_account = azure.storage.Account("example",
name="examplelinuxfunctionappsa",
resource_group_name=example.name,
location=example.location,
account_tier="Standard",
account_replication_type="LRS")
example_container = azure.storage.Container("example",
name="example-flexcontainer",
storage_account_id=example_account.id,
container_access_type="private")
example_service_plan = azure.appservice.ServicePlan("example",
name="example-app-service-plan",
resource_group_name=example.name,
location=example.location,
sku_name="FC1",
os_type="Linux")
example_app_flex_consumption = azure.appservice.AppFlexConsumption("example",
name="example-linux-function-app",
resource_group_name=example.name,
location=example.location,
service_plan_id=example_service_plan.id,
storage_container_type="blobContainer",
storage_container_endpoint=pulumi.Output.all(
primary_blob_endpoint=example_account.primary_blob_endpoint,
name=example_container.name
).apply(lambda resolved_outputs: f"{resolved_outputs['primary_blob_endpoint']}{resolved_outputs['name']}")
,
storage_authentication_type="StorageAccountConnectionString",
storage_access_key=example_account.primary_access_key,
runtime_name="node",
runtime_version="20",
maximum_instance_count=50,
instance_memory_in_mb=2048,
site_config={})
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 exampleAccount = new Azure.Storage.Account("example", new()
{
Name = "examplelinuxfunctionappsa",
ResourceGroupName = example.Name,
Location = example.Location,
AccountTier = "Standard",
AccountReplicationType = "LRS",
});
var exampleContainer = new Azure.Storage.Container("example", new()
{
Name = "example-flexcontainer",
StorageAccountId = exampleAccount.Id,
ContainerAccessType = "private",
});
var exampleServicePlan = new Azure.AppService.ServicePlan("example", new()
{
Name = "example-app-service-plan",
ResourceGroupName = example.Name,
Location = example.Location,
SkuName = "FC1",
OsType = "Linux",
});
var exampleAppFlexConsumption = new Azure.AppService.AppFlexConsumption("example", new()
{
Name = "example-linux-function-app",
ResourceGroupName = example.Name,
Location = example.Location,
ServicePlanId = exampleServicePlan.Id,
StorageContainerType = "blobContainer",
StorageContainerEndpoint = Output.Tuple(exampleAccount.PrimaryBlobEndpoint, exampleContainer.Name).Apply(values =>
{
var primaryBlobEndpoint = values.Item1;
var name = values.Item2;
return $"{primaryBlobEndpoint}{name}";
}),
StorageAuthenticationType = "StorageAccountConnectionString",
StorageAccessKey = exampleAccount.PrimaryAccessKey,
RuntimeName = "node",
RuntimeVersion = "20",
MaximumInstanceCount = 50,
InstanceMemoryInMb = 2048,
SiteConfig = null,
});
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/appservice"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/storage"
"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
}
exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
Name: pulumi.String("examplelinuxfunctionappsa"),
ResourceGroupName: example.Name,
Location: example.Location,
AccountTier: pulumi.String("Standard"),
AccountReplicationType: pulumi.String("LRS"),
})
if err != nil {
return err
}
exampleContainer, err := storage.NewContainer(ctx, "example", &storage.ContainerArgs{
Name: pulumi.String("example-flexcontainer"),
StorageAccountId: exampleAccount.ID(),
ContainerAccessType: pulumi.String("private"),
})
if err != nil {
return err
}
exampleServicePlan, err := appservice.NewServicePlan(ctx, "example", &appservice.ServicePlanArgs{
Name: pulumi.String("example-app-service-plan"),
ResourceGroupName: example.Name,
Location: example.Location,
SkuName: pulumi.String("FC1"),
OsType: pulumi.String("Linux"),
})
if err != nil {
return err
}
_, err = appservice.NewAppFlexConsumption(ctx, "example", &appservice.AppFlexConsumptionArgs{
Name: pulumi.String("example-linux-function-app"),
ResourceGroupName: example.Name,
Location: example.Location,
ServicePlanId: exampleServicePlan.ID(),
StorageContainerType: pulumi.String("blobContainer"),
StorageContainerEndpoint: pulumi.All(exampleAccount.PrimaryBlobEndpoint, exampleContainer.Name).ApplyT(func(_args []interface{}) (string, error) {
primaryBlobEndpoint := _args[0].(string)
name := _args[1].(string)
return fmt.Sprintf("%v%v", primaryBlobEndpoint, name), nil
}).(pulumi.StringOutput),
StorageAuthenticationType: pulumi.String("StorageAccountConnectionString"),
StorageAccessKey: exampleAccount.PrimaryAccessKey,
RuntimeName: pulumi.String("node"),
RuntimeVersion: pulumi.String("20"),
MaximumInstanceCount: pulumi.Int(50),
InstanceMemoryInMb: pulumi.Int(2048),
SiteConfig: &appservice.AppFlexConsumptionSiteConfigArgs{},
})
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.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.storage.Container;
import com.pulumi.azure.storage.ContainerArgs;
import com.pulumi.azure.appservice.ServicePlan;
import com.pulumi.azure.appservice.ServicePlanArgs;
import com.pulumi.azure.appservice.AppFlexConsumption;
import com.pulumi.azure.appservice.AppFlexConsumptionArgs;
import com.pulumi.azure.appservice.inputs.AppFlexConsumptionSiteConfigArgs;
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 exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.name("examplelinuxfunctionappsa")
.resourceGroupName(example.name())
.location(example.location())
.accountTier("Standard")
.accountReplicationType("LRS")
.build());
var exampleContainer = new Container("exampleContainer", ContainerArgs.builder()
.name("example-flexcontainer")
.storageAccountId(exampleAccount.id())
.containerAccessType("private")
.build());
var exampleServicePlan = new ServicePlan("exampleServicePlan", ServicePlanArgs.builder()
.name("example-app-service-plan")
.resourceGroupName(example.name())
.location(example.location())
.skuName("FC1")
.osType("Linux")
.build());
var exampleAppFlexConsumption = new AppFlexConsumption("exampleAppFlexConsumption", AppFlexConsumptionArgs.builder()
.name("example-linux-function-app")
.resourceGroupName(example.name())
.location(example.location())
.servicePlanId(exampleServicePlan.id())
.storageContainerType("blobContainer")
.storageContainerEndpoint(Output.tuple(exampleAccount.primaryBlobEndpoint(), exampleContainer.name()).applyValue(values -> {
var primaryBlobEndpoint = values.t1;
var name = values.t2;
return String.format("%s%s", primaryBlobEndpoint,name);
}))
.storageAuthenticationType("StorageAccountConnectionString")
.storageAccessKey(exampleAccount.primaryAccessKey())
.runtimeName("node")
.runtimeVersion("20")
.maximumInstanceCount(50)
.instanceMemoryInMb(2048)
.siteConfig(AppFlexConsumptionSiteConfigArgs.builder()
.build())
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleAccount:
type: azure:storage:Account
name: example
properties:
name: examplelinuxfunctionappsa
resourceGroupName: ${example.name}
location: ${example.location}
accountTier: Standard
accountReplicationType: LRS
exampleContainer:
type: azure:storage:Container
name: example
properties:
name: example-flexcontainer
storageAccountId: ${exampleAccount.id}
containerAccessType: private
exampleServicePlan:
type: azure:appservice:ServicePlan
name: example
properties:
name: example-app-service-plan
resourceGroupName: ${example.name}
location: ${example.location}
skuName: FC1
osType: Linux
exampleAppFlexConsumption:
type: azure:appservice:AppFlexConsumption
name: example
properties:
name: example-linux-function-app
resourceGroupName: ${example.name}
location: ${example.location}
servicePlanId: ${exampleServicePlan.id}
storageContainerType: blobContainer
storageContainerEndpoint: ${exampleAccount.primaryBlobEndpoint}${exampleContainer.name}
storageAuthenticationType: StorageAccountConnectionString
storageAccessKey: ${exampleAccount.primaryAccessKey}
runtimeName: node
runtimeVersion: '20'
maximumInstanceCount: 50
instanceMemoryInMb: 2048
siteConfig: {}

API Providers

This resource uses the following Azure API Providers:

  • Microsoft.Web: 2023-12-01, 2023-01-01

Import

The Function Apps can be imported using the resource id, e.g.

$ pulumi import azure:appservice/appFlexConsumption:AppFlexConsumption example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/sites/site1

Properties

Link copied to clipboard

One or more always_ready blocks as defined below.

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

A map of key-value pairs for [App

Link copied to clipboard

A auth_settings block as defined below.

Link copied to clipboard

An auth_settings_v2 block as defined below.

Link copied to clipboard

Should the function app use Client Certificates.

Link copied to clipboard

Paths to exclude when using client certificates, separated by ;

Link copied to clipboard

The mode of the Function App's client certificates requirement for incoming requests. Possible values are Required, Optional, and OptionalInteractiveUser. Defaults to Optional.

Link copied to clipboard

One or more connection_string blocks as defined below.

Link copied to clipboard

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

Link copied to clipboard
val defaultHostname: Output<String>

The default hostname of the Linux Function App.

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

Is the Function App enabled? Defaults to true.

Link copied to clipboard

The ID of the App Service Environment used by Function App.

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

A identity block as defined below.

Link copied to clipboard
val instanceMemoryInMb: Output<Int>?

The memory size of the instances on which your app runs. The currently supported values are 2048 or 4096.

Link copied to clipboard
val kind: Output<String>

The Kind value for this Linux Function App.

Link copied to clipboard
val location: Output<String>

The Azure Region where the Function App should exist. Changing this forces a new Function App to be created.

Link copied to clipboard

The number of workers this function app can scale out to.

Link copied to clipboard
val name: Output<String>

The name which should be used for this Function App. Changing this forces a new Function App to be created. Limit the function name to 32 characters to avoid naming collisions. For more information about Function App naming rule and Host ID Collisions

Link copied to clipboard

A comma separated list of outbound IP addresses as a string. For example 52.23.25.3,52.143.43.12.

Link copied to clipboard

A list of outbound IP addresses. For example ["52&#46;23&#46;25&#46;3", "52&#46;143&#46;43&#46;12"]

Link copied to clipboard

A comma separated list of possible outbound IP addresses as a string. For example 52.23.25.3,52.143.43.12,52.143.43.17. This is a superset of outbound_ip_addresses.

Link copied to clipboard

A list of possible outbound IP addresses, not all of which are necessarily in use. This is a superset of outbound_ip_address_list. For example ["52&#46;23&#46;25&#46;3", "52&#46;143&#46;43&#46;12"].

Link copied to clipboard

Should public network access be enabled for the Function App. Defaults to true.

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 where the Function App should exist. Changing this forces a new Linux Function App to be created.

Link copied to clipboard
val runtimeName: Output<String>

The Runtime of the Linux Function App. Possible values are node, dotnet-isolated, powershell, python, java and custom.

Link copied to clipboard
val runtimeVersion: Output<String>

The Runtime version of the Linux Function App. The values are diff from different runtime version. The supported values are 8.0, 9.0 for dotnet-isolated, 20 for node, 3.10, 3.11 for python, 11, 17 for java, 7.4 for powershell.

Link copied to clipboard
val servicePlanId: Output<String>

The ID of the App Service Plan within which to create this Function App. Changing this forces a new Linux Function App 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.

Link copied to clipboard

A sticky_settings block as defined below.

Link copied to clipboard
val storageAccessKey: Output<String>?

The access key which will be used to access the backend storage account for the Function App.

Link copied to clipboard

The authentication type which will be used to access the backend storage account for the Function App. Possible values are StorageAccountConnectionString, SystemAssignedIdentity, and UserAssignedIdentity.

Link copied to clipboard

The backend storage container endpoint which will be used by this Function App.

Link copied to clipboard

The storage container type used for the Function App. The current supported type is blobContainer.

Link copied to clipboard

The user assigned Managed Identity to access the storage account. Conflicts with storage_access_key.

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

A mapping of tags which should be assigned to the Linux Function App.

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

Should the default WebDeploy Basic Authentication publishing credentials enabled. Defaults to true.

Link copied to clipboard
val zipDeployFile: Output<String>

The local path and filename of the Zip packaged application to deploy to this Linux Function App.