import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages a Function App. * * !> **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.LinuxFunctionApp` and `azure.appservice.WindowsFunctionApp` resources instead. * * > **Note:** To connect an Azure Function App and a subnet within the same region `azure.appservice.VirtualNetworkSwiftConnection` can be used. * For an example, check the `azure.appservice.VirtualNetworkSwiftConnection` documentation. * * ## Example Usage * * ### With App Service Plan) * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "azure-functions-test-rg", * location: "West Europe", * }); * const exampleAccount = new azure.storage.Account("example", { * name: "functionsapptestsa", * resourceGroupName: example.name, * location: example.location, * accountTier: "Standard", * accountReplicationType: "LRS", * }); * const examplePlan = new azure.appservice.Plan("example", { * name: "azure-functions-test-service-plan", * location: example.location, * resourceGroupName: example.name, * sku: { * tier: "Standard", * size: "S1", * }, * }); * const exampleFunctionApp = new azure.appservice.FunctionApp("example", { * name: "test-azure-functions", * location: example.location, * resourceGroupName: example.name, * appServicePlanId: examplePlan.id, * storageAccountName: exampleAccount.name, * storageAccountAccessKey: exampleAccount.primaryAccessKey, * }); * ``` * * ### In A Consumption Plan) * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "azure-functions-cptest-rg", * location: "West Europe", * }); * const exampleAccount = new azure.storage.Account("example", { * name: "functionsapptestsa", * resourceGroupName: example.name, * location: example.location, * accountTier: "Standard", * accountReplicationType: "LRS", * }); * const examplePlan = new azure.appservice.Plan("example", { * name: "azure-functions-test-service-plan", * location: example.location, * resourceGroupName: example.name, * kind: "FunctionApp", * sku: { * tier: "Dynamic", * size: "Y1", * }, * }); * const exampleFunctionApp = new azure.appservice.FunctionApp("example", { * name: "test-azure-functions", * location: example.location, * resourceGroupName: example.name, * appServicePlanId: examplePlan.id, * storageAccountName: exampleAccount.name, * storageAccountAccessKey: exampleAccount.primaryAccessKey, * }); * ``` * * ### Linux) * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "azure-functions-cptest-rg", * location: "West Europe", * }); * const exampleAccount = new azure.storage.Account("example", { * name: "functionsapptestsa", * resourceGroupName: example.name, * location: example.location, * accountTier: "Standard", * accountReplicationType: "LRS", * }); * const examplePlan = new azure.appservice.Plan("example", { * name: "azure-functions-test-service-plan", * location: example.location, * resourceGroupName: example.name, * kind: "Linux", * reserved: true, * sku: { * tier: "Dynamic", * size: "Y1", * }, * }); * const exampleFunctionApp = new azure.appservice.FunctionApp("example", { * name: "test-azure-functions", * location: example.location, * resourceGroupName: example.name, * appServicePlanId: examplePlan.id, * storageAccountName: exampleAccount.name, * storageAccountAccessKey: exampleAccount.primaryAccessKey, * osType: "linux", * version: "~3", * }); * ``` * * > **Note:** Version `~3` or `~4` is required for Linux Function Apps. * * ### Python In A Consumption Plan) * * > **Note:** The Python runtime is only supported on a Linux based hosting plan. See [the documentation for additional information](https://docs.microsoft.com/azure/azure-functions/functions-reference-python). * * ## Import * * Function Apps can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:appservice/functionApp:FunctionApp functionapp1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/sites/functionapp1 * ``` */ export declare class FunctionApp extends pulumi.CustomResource { /** * Get an existing FunctionApp resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: FunctionAppState, opts?: pulumi.CustomResourceOptions): FunctionApp; /** * Returns true if the given object is an instance of FunctionApp. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is FunctionApp; /** * The ID of the App Service Plan within which to create this Function App. */ readonly appServicePlanId: pulumi.Output; /** * A map of key-value pairs for [App Settings](https://docs.microsoft.com/azure/azure-functions/functions-app-settings) and custom values. * * > **NOTE:** The values for `AzureWebJobsStorage` and `FUNCTIONS_EXTENSION_VERSION` will be filled by other input arguments and shouldn't be configured separately. `AzureWebJobsStorage` is filled based on `storageAccountName` and `storageAccountAccessKey`. `FUNCTIONS_EXTENSION_VERSION` is filled based on `version`. */ readonly appSettings: pulumi.Output<{ [key: string]: string; }>; /** * A `authSettings` block as defined below. */ readonly authSettings: pulumi.Output; /** * The mode of the Function App's client certificates requirement for incoming requests. Possible values are `Required` and `Optional`. */ readonly clientCertMode: pulumi.Output; /** * An `connectionString` block as defined below. */ readonly connectionStrings: pulumi.Output; /** * An identifier used by App Service to perform domain ownership verification via DNS TXT record. */ readonly customDomainVerificationId: pulumi.Output; /** * The amount of memory in gigabyte-seconds that your application is allowed to consume per day. Setting this value only affects function apps under the consumption plan. */ readonly dailyMemoryTimeQuota: pulumi.Output; /** * The default hostname associated with the Function App - such as `mysite.azurewebsites.net` */ readonly defaultHostname: pulumi.Output; /** * Should the built-in logging of this Function App be enabled? Defaults to `true`. */ readonly enableBuiltinLogging: pulumi.Output; /** * Is the Function App enabled? Defaults to `true`. */ readonly enabled: pulumi.Output; /** * Can the Function App only be accessed via HTTPS? Defaults to `false`. */ readonly httpsOnly: pulumi.Output; /** * An `identity` block as defined below. */ readonly identity: pulumi.Output; /** * 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](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references#access-vaults-with-a-user-assigned-identity) for more information. */ readonly keyVaultReferenceIdentityId: pulumi.Output; /** * The Function App kind - such as `functionapp,linux,container` */ readonly kind: pulumi.Output; /** * Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. */ readonly location: pulumi.Output; /** * Specifies the name of the Function App. Changing this forces a new resource to be created. Limit the function name to 32 characters to avoid naming collisions. For more information about [Function App naming rule](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftweb). */ readonly name: pulumi.Output; /** * A string indicating the Operating System type for this function app. Possible values are `linux` and ``(empty string). Changing this forces a new resource to be created. Defaults to `""`. * * > **NOTE:** This value will be `linux` for Linux derivatives, or an empty string for Windows (default). When set to `linux` you must also set `azure.appservice.Plan` arguments as `kind = "Linux"` and `reserved = true` */ readonly osType: pulumi.Output; /** * A comma separated list of outbound IP addresses - such as `52.23.25.3,52.143.43.12` */ readonly outboundIpAddresses: pulumi.Output; /** * 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 `outboundIpAddresses`. */ readonly possibleOutboundIpAddresses: pulumi.Output; /** * The name of the resource group in which to create the Function App. Changing this forces a new resource to be created. */ readonly resourceGroupName: pulumi.Output; /** * A `siteConfig` object as defined below. */ readonly siteConfig: pulumi.Output; /** * A `siteCredential` block as defined below, which contains the site-level credentials used to publish to this App Service. */ readonly siteCredentials: pulumi.Output; /** * A `sourceControl` block, as defined below. */ readonly sourceControl: pulumi.Output; /** * The access key which will be used to access the backend storage account for the Function App. * * > **Note:** When integrating a `CI/CD pipeline` and expecting to run from a deployed package in `Azure` you must seed your `app settings` as part of the application code for function app to be successfully deployed. `Important Default key pairs`: (`"WEBSITE_RUN_FROM_PACKAGE" = ""`, `"FUNCTIONS_WORKER_RUNTIME" = "node"` (or python, etc), `"WEBSITE_NODE_DEFAULT_VERSION" = "10.14.1"`, `"APPINSIGHTS_INSTRUMENTATIONKEY" = ""`). * * > **Note:** When using an App Service Plan in the `Free` or `Shared` Tiers `use32BitWorkerProcess` must be set to `true`. */ readonly storageAccountAccessKey: pulumi.Output; /** * The backend storage account name which will be used by this Function App (such as the dashboard, logs). Changing this forces a new resource to be created. */ readonly storageAccountName: pulumi.Output; /** * A mapping of tags to assign to the resource. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The runtime version associated with the Function App. Defaults to `~1`. */ readonly version: pulumi.Output; /** * Create a FunctionApp resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: FunctionAppArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering FunctionApp resources. */ export interface FunctionAppState { /** * The ID of the App Service Plan within which to create this Function App. */ appServicePlanId?: pulumi.Input; /** * A map of key-value pairs for [App Settings](https://docs.microsoft.com/azure/azure-functions/functions-app-settings) and custom values. * * > **NOTE:** The values for `AzureWebJobsStorage` and `FUNCTIONS_EXTENSION_VERSION` will be filled by other input arguments and shouldn't be configured separately. `AzureWebJobsStorage` is filled based on `storageAccountName` and `storageAccountAccessKey`. `FUNCTIONS_EXTENSION_VERSION` is filled based on `version`. */ appSettings?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * A `authSettings` block as defined below. */ authSettings?: pulumi.Input; /** * The mode of the Function App's client certificates requirement for incoming requests. Possible values are `Required` and `Optional`. */ clientCertMode?: pulumi.Input; /** * An `connectionString` block as defined below. */ connectionStrings?: pulumi.Input[]>; /** * An identifier used by App Service to perform domain ownership verification via DNS TXT record. */ customDomainVerificationId?: pulumi.Input; /** * The amount of memory in gigabyte-seconds that your application is allowed to consume per day. Setting this value only affects function apps under the consumption plan. */ dailyMemoryTimeQuota?: pulumi.Input; /** * The default hostname associated with the Function App - such as `mysite.azurewebsites.net` */ defaultHostname?: pulumi.Input; /** * Should the built-in logging of this Function App be enabled? Defaults to `true`. */ enableBuiltinLogging?: pulumi.Input; /** * Is the Function App enabled? Defaults to `true`. */ enabled?: pulumi.Input; /** * Can the Function App only be accessed via HTTPS? Defaults to `false`. */ httpsOnly?: pulumi.Input; /** * An `identity` block as defined below. */ identity?: pulumi.Input; /** * 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](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references#access-vaults-with-a-user-assigned-identity) for more information. */ keyVaultReferenceIdentityId?: pulumi.Input; /** * The Function App kind - such as `functionapp,linux,container` */ kind?: pulumi.Input; /** * Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. */ location?: pulumi.Input; /** * Specifies the name of the Function App. Changing this forces a new resource to be created. Limit the function name to 32 characters to avoid naming collisions. For more information about [Function App naming rule](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftweb). */ name?: pulumi.Input; /** * A string indicating the Operating System type for this function app. Possible values are `linux` and ``(empty string). Changing this forces a new resource to be created. Defaults to `""`. * * > **NOTE:** This value will be `linux` for Linux derivatives, or an empty string for Windows (default). When set to `linux` you must also set `azure.appservice.Plan` arguments as `kind = "Linux"` and `reserved = true` */ osType?: pulumi.Input; /** * A comma separated list of outbound IP addresses - such as `52.23.25.3,52.143.43.12` */ outboundIpAddresses?: pulumi.Input; /** * 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 `outboundIpAddresses`. */ possibleOutboundIpAddresses?: pulumi.Input; /** * The name of the resource group in which to create the Function App. Changing this forces a new resource to be created. */ resourceGroupName?: pulumi.Input; /** * A `siteConfig` object as defined below. */ siteConfig?: pulumi.Input; /** * A `siteCredential` block as defined below, which contains the site-level credentials used to publish to this App Service. */ siteCredentials?: pulumi.Input[]>; /** * A `sourceControl` block, as defined below. */ sourceControl?: pulumi.Input; /** * The access key which will be used to access the backend storage account for the Function App. * * > **Note:** When integrating a `CI/CD pipeline` and expecting to run from a deployed package in `Azure` you must seed your `app settings` as part of the application code for function app to be successfully deployed. `Important Default key pairs`: (`"WEBSITE_RUN_FROM_PACKAGE" = ""`, `"FUNCTIONS_WORKER_RUNTIME" = "node"` (or python, etc), `"WEBSITE_NODE_DEFAULT_VERSION" = "10.14.1"`, `"APPINSIGHTS_INSTRUMENTATIONKEY" = ""`). * * > **Note:** When using an App Service Plan in the `Free` or `Shared` Tiers `use32BitWorkerProcess` must be set to `true`. */ storageAccountAccessKey?: pulumi.Input; /** * The backend storage account name which will be used by this Function App (such as the dashboard, logs). Changing this forces a new resource to be created. */ storageAccountName?: pulumi.Input; /** * A mapping of tags to assign to the resource. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The runtime version associated with the Function App. Defaults to `~1`. */ version?: pulumi.Input; } /** * The set of arguments for constructing a FunctionApp resource. */ export interface FunctionAppArgs { /** * The ID of the App Service Plan within which to create this Function App. */ appServicePlanId: pulumi.Input; /** * A map of key-value pairs for [App Settings](https://docs.microsoft.com/azure/azure-functions/functions-app-settings) and custom values. * * > **NOTE:** The values for `AzureWebJobsStorage` and `FUNCTIONS_EXTENSION_VERSION` will be filled by other input arguments and shouldn't be configured separately. `AzureWebJobsStorage` is filled based on `storageAccountName` and `storageAccountAccessKey`. `FUNCTIONS_EXTENSION_VERSION` is filled based on `version`. */ appSettings?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * A `authSettings` block as defined below. */ authSettings?: pulumi.Input; /** * The mode of the Function App's client certificates requirement for incoming requests. Possible values are `Required` and `Optional`. */ clientCertMode?: pulumi.Input; /** * An `connectionString` block as defined below. */ connectionStrings?: pulumi.Input[]>; /** * The amount of memory in gigabyte-seconds that your application is allowed to consume per day. Setting this value only affects function apps under the consumption plan. */ dailyMemoryTimeQuota?: pulumi.Input; /** * Should the built-in logging of this Function App be enabled? Defaults to `true`. */ enableBuiltinLogging?: pulumi.Input; /** * Is the Function App enabled? Defaults to `true`. */ enabled?: pulumi.Input; /** * Can the Function App only be accessed via HTTPS? Defaults to `false`. */ httpsOnly?: pulumi.Input; /** * An `identity` block as defined below. */ identity?: pulumi.Input; /** * 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](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references#access-vaults-with-a-user-assigned-identity) for more information. */ keyVaultReferenceIdentityId?: pulumi.Input; /** * Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. */ location?: pulumi.Input; /** * Specifies the name of the Function App. Changing this forces a new resource to be created. Limit the function name to 32 characters to avoid naming collisions. For more information about [Function App naming rule](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftweb). */ name?: pulumi.Input; /** * A string indicating the Operating System type for this function app. Possible values are `linux` and ``(empty string). Changing this forces a new resource to be created. Defaults to `""`. * * > **NOTE:** This value will be `linux` for Linux derivatives, or an empty string for Windows (default). When set to `linux` you must also set `azure.appservice.Plan` arguments as `kind = "Linux"` and `reserved = true` */ osType?: pulumi.Input; /** * The name of the resource group in which to create the Function App. Changing this forces a new resource to be created. */ resourceGroupName: pulumi.Input; /** * A `siteConfig` object as defined below. */ siteConfig?: pulumi.Input; /** * A `sourceControl` block, as defined below. */ sourceControl?: pulumi.Input; /** * The access key which will be used to access the backend storage account for the Function App. * * > **Note:** When integrating a `CI/CD pipeline` and expecting to run from a deployed package in `Azure` you must seed your `app settings` as part of the application code for function app to be successfully deployed. `Important Default key pairs`: (`"WEBSITE_RUN_FROM_PACKAGE" = ""`, `"FUNCTIONS_WORKER_RUNTIME" = "node"` (or python, etc), `"WEBSITE_NODE_DEFAULT_VERSION" = "10.14.1"`, `"APPINSIGHTS_INSTRUMENTATIONKEY" = ""`). * * > **Note:** When using an App Service Plan in the `Free` or `Shared` Tiers `use32BitWorkerProcess` must be set to `true`. */ storageAccountAccessKey: pulumi.Input; /** * The backend storage account name which will be used by this Function App (such as the dashboard, logs). Changing this forces a new resource to be created. */ storageAccountName: pulumi.Input; /** * A mapping of tags to assign to the resource. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The runtime version associated with the Function App. Defaults to `~1`. */ version?: pulumi.Input; }