Skip to content

Add --kind to AzureContainerAppsV1 to support Azure Function Apps #21049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"loc.input.help.containerAppEnvironment": "The name of the Azure Container App environment to use with the application. If not provided, an existing environment in the resource group of the Container App will be used, otherwise, an environment will be created in the form of `<container-app-name>-env`.",
"loc.input.label.runtimeStack": "Application runtime stack",
"loc.input.help.runtimeStack": "The platform version stack that the application runs in when deployed to the Azure Container App. This should be provided in the form of `<platform>:<version>`. If not provided, this value is determined by Oryx based on the contents of the provided application. Please view the following document for more information on the supported runtime stacks for Oryx: https://github.com/microsoft/Oryx/blob/main/doc/supportedRuntimeVersions.md",
"loc.input.label.kind": "Container App kind",
"loc.input.help.kind": "Set to `functionapp` to get built in support and autoscaling to run Azure functions on Azure Container apps.",
"loc.input.label.targetPort": "Application target port",
"loc.input.help.targetPort": "The designated port for the application to run on. If no value is provided and the builder is used to build the runnable application image, the target port will be set to 80 for Python applications and 8080 for all other platform applications. If no value is provided when creating a Container App, the target port will default to 80. Note: when using this task to update a Container App, the target port may be updated if not provided based on changes to the ingress property.",
"loc.input.label.location": "Location of the Container App",
Expand Down
9 changes: 9 additions & 0 deletions Tasks/AzureContainerAppsV1/azurecontainerapps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export class azurecontainerapps {
// Miscellaneous properties
private static imageToBuild: string;
private static runtimeStack: string;
private static kind: string;
private static ingress: string;
private static targetPort: string;
private static shouldUseUpdateCommand: boolean;
Expand Down Expand Up @@ -472,6 +473,14 @@ export class azurecontainerapps {
this.commandLineArgs.push(`--ingress ${this.ingress}`);
this.commandLineArgs.push(`--target-port ${this.targetPort}`);
}

// Get the kind input
this.kind = tl.getInput('kind', false);

// Set the value of kind if provided
if (!util.isNullOrEmpty(this.kind)) {
this.commandLineArgs.push(`--kind ${this.kind}`);
}
}

const environmentVariables: string = tl.getInput('environmentVariables', false);
Expand Down
9 changes: 8 additions & 1 deletion Tasks/AzureContainerAppsV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"version": {
"Major": 1,
"Minor": 255,
"Minor": 258,
"Patch": 0
},
"minimumAgentVersion": "2.144.0",
Expand Down Expand Up @@ -127,6 +127,13 @@
"required": false,
"helpMarkDown": "The platform version stack that the application runs in when deployed to the Azure Container App. This should be provided in the form of `<platform>:<version>`. If not provided, this value is determined by Oryx based on the contents of the provided application. Please view the following document for more information on the supported runtime stacks for Oryx: https://github.com/microsoft/Oryx/blob/main/doc/supportedRuntimeVersions.md"
},
{
"name": "kind",
"type": "string",
"label": "Container App kind",
"required": false,
"helpMarkDown": "Set to `functionapp` to get built in support and autoscaling to run Azure functions on Azure Container apps."
},
{
"name": "targetPort",
"type": "string",
Expand Down
9 changes: 8 additions & 1 deletion Tasks/AzureContainerAppsV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"version": {
"Major": 1,
"Minor": 255,
"Minor": 258,
"Patch": 0
},
"minimumAgentVersion": "2.144.0",
Expand Down Expand Up @@ -127,6 +127,13 @@
"required": false,
"helpMarkDown": "ms-resource:loc.input.help.runtimeStack"
},
{
"name": "kind",
"type": "string",
"label": "ms-resource:loc.input.label.kind",
"required": false,
"helpMarkDown": "ms-resource:loc.input.help.kind"
},
{
"name": "targetPort",
"type": "string",
Expand Down