import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages a Function App Function. * * ## Example Usage * * ### Basic HTTP Trigger * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "example-group", * location: "West Europe", * }); * const exampleAccount = new azure.storage.Account("example", { * name: "examplesa", * resourceGroupName: example.name, * location: example.location, * accountTier: "Standard", * accountReplicationType: "LRS", * }); * const exampleServicePlan = new azure.appservice.ServicePlan("example", { * name: "example-service-plan", * location: example.location, * resourceGroupName: example.name, * osType: "Linux", * skuName: "S1", * }); * const exampleLinuxFunctionApp = new azure.appservice.LinuxFunctionApp("example", { * name: "example-function-app", * location: example.location, * resourceGroupName: example.name, * servicePlanId: exampleServicePlan.id, * storageAccountName: exampleAccount.name, * storageAccountAccessKey: exampleAccount.primaryAccessKey, * siteConfig: { * applicationStack: { * pythonVersion: "3.9", * }, * }, * }); * const exampleFunctionAppFunction = new azure.appservice.FunctionAppFunction("example", { * name: "example-function-app-function", * functionAppId: exampleLinuxFunctionApp.id, * language: "Python", * testData: JSON.stringify({ * name: "Azure", * }), * configJson: JSON.stringify({ * bindings: [ * { * authLevel: "function", * direction: "in", * methods: [ * "get", * "post", * ], * name: "req", * type: "httpTrigger", * }, * { * direction: "out", * name: "$return", * type: "http", * }, * ], * }), * }); * ``` * * ### HTTP Trigger With Code Upload * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * import * as std from "@pulumi/std"; * * const example = new azure.core.ResourceGroup("example", { * name: "example-group", * location: "West Europe", * }); * const exampleAccount = new azure.storage.Account("example", { * name: "examplesa", * resourceGroupName: example.name, * location: example.location, * accountTier: "Standard", * accountReplicationType: "LRS", * }); * const exampleServicePlan = new azure.appservice.ServicePlan("example", { * name: "example-service-plan", * location: example.location, * resourceGroupName: example.name, * osType: "Windows", * skuName: "S1", * }); * const exampleWindowsFunctionApp = new azure.appservice.WindowsFunctionApp("example", { * name: "example-function-app", * location: example.location, * resourceGroupName: example.name, * servicePlanId: exampleServicePlan.id, * storageAccountName: exampleAccount.name, * storageAccountAccessKey: exampleAccount.primaryAccessKey, * siteConfig: { * applicationStack: { * dotnetVersion: "6", * }, * }, * }); * const exampleFunctionAppFunction = new azure.appservice.FunctionAppFunction("example", { * name: "example-function-app-function", * functionAppId: exampleWindowsFunctionApp.id, * language: "CSharp", * files: [{ * name: "run.csx", * content: std.file({ * input: "exampledata/run.csx", * }).then(invoke => invoke.result), * }], * testData: JSON.stringify({ * name: "Azure", * }), * configJson: JSON.stringify({ * bindings: [ * { * authLevel: "function", * direction: "in", * methods: [ * "get", * "post", * ], * name: "req", * type: "httpTrigger", * }, * { * direction: "out", * name: "$return", * type: "http", * }, * ], * }), * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.Web` - 2023-12-01 * * ## Import * * a Function App Function can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:appservice/functionAppFunction:FunctionAppFunction example "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/sites/site1/functions/function1" * ``` */ export declare class FunctionAppFunction extends pulumi.CustomResource { /** * Get an existing FunctionAppFunction 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?: FunctionAppFunctionState, opts?: pulumi.CustomResourceOptions): FunctionAppFunction; /** * Returns true if the given object is an instance of FunctionAppFunction. 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 FunctionAppFunction; /** * The config for this Function in JSON format. */ readonly configJson: pulumi.Output; /** * The URL of the configuration JSON. */ readonly configUrl: pulumi.Output; /** * Should this function be enabled. Defaults to `true`. */ readonly enabled: pulumi.Output; /** * A `file` block as detailed below. Changing this forces a new resource to be created. */ readonly files: pulumi.Output; /** * The ID of the Function App in which this function should reside. Changing this forces a new resource to be created. */ readonly functionAppId: pulumi.Output; /** * The invocation URL. */ readonly invocationUrl: pulumi.Output; /** * The language the Function is written in. Possible values are `CSharp`, `Custom`, `Java`, `Javascript`, `Python`, `PowerShell`, and `TypeScript`. * * > **Note:** when using `Custom` language, you must specify the code handler in the `host.json` file for your function. See the [official docs](https://docs.microsoft.com/azure/azure-functions/functions-custom-handlers#hostjson) for more information. */ readonly language: pulumi.Output; /** * The name of the function. Changing this forces a new resource to be created. */ readonly name: pulumi.Output; /** * The Script root path URL. */ readonly scriptRootPathUrl: pulumi.Output; /** * The script URL. */ readonly scriptUrl: pulumi.Output; /** * The URL for the Secrets File. */ readonly secretsFileUrl: pulumi.Output; /** * The test data for the function. */ readonly testData: pulumi.Output; /** * The Test data URL. */ readonly testDataUrl: pulumi.Output; /** * The function URL. */ readonly url: pulumi.Output; /** * Create a FunctionAppFunction 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: FunctionAppFunctionArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering FunctionAppFunction resources. */ export interface FunctionAppFunctionState { /** * The config for this Function in JSON format. */ configJson?: pulumi.Input; /** * The URL of the configuration JSON. */ configUrl?: pulumi.Input; /** * Should this function be enabled. Defaults to `true`. */ enabled?: pulumi.Input; /** * A `file` block as detailed below. Changing this forces a new resource to be created. */ files?: pulumi.Input[]>; /** * The ID of the Function App in which this function should reside. Changing this forces a new resource to be created. */ functionAppId?: pulumi.Input; /** * The invocation URL. */ invocationUrl?: pulumi.Input; /** * The language the Function is written in. Possible values are `CSharp`, `Custom`, `Java`, `Javascript`, `Python`, `PowerShell`, and `TypeScript`. * * > **Note:** when using `Custom` language, you must specify the code handler in the `host.json` file for your function. See the [official docs](https://docs.microsoft.com/azure/azure-functions/functions-custom-handlers#hostjson) for more information. */ language?: pulumi.Input; /** * The name of the function. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * The Script root path URL. */ scriptRootPathUrl?: pulumi.Input; /** * The script URL. */ scriptUrl?: pulumi.Input; /** * The URL for the Secrets File. */ secretsFileUrl?: pulumi.Input; /** * The test data for the function. */ testData?: pulumi.Input; /** * The Test data URL. */ testDataUrl?: pulumi.Input; /** * The function URL. */ url?: pulumi.Input; } /** * The set of arguments for constructing a FunctionAppFunction resource. */ export interface FunctionAppFunctionArgs { /** * The config for this Function in JSON format. */ configJson: pulumi.Input; /** * Should this function be enabled. Defaults to `true`. */ enabled?: pulumi.Input; /** * A `file` block as detailed below. Changing this forces a new resource to be created. */ files?: pulumi.Input[]>; /** * The ID of the Function App in which this function should reside. Changing this forces a new resource to be created. */ functionAppId: pulumi.Input; /** * The language the Function is written in. Possible values are `CSharp`, `Custom`, `Java`, `Javascript`, `Python`, `PowerShell`, and `TypeScript`. * * > **Note:** when using `Custom` language, you must specify the code handler in the `host.json` file for your function. See the [official docs](https://docs.microsoft.com/azure/azure-functions/functions-custom-handlers#hostjson) for more information. */ language?: pulumi.Input; /** * The name of the function. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * The test data for the function. */ testData?: pulumi.Input; }