Skip to content
Merged
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
1 change: 1 addition & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Release History
===============
upcoming
++++++
* 'az containerapp create': support --kind {functionapp}

1.1.0b3
++++++
Expand Down
5 changes: 5 additions & 0 deletions src/containerapp/azext_containerapp/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,11 @@
az containerapp create -n my-containerapp -g MyResourceGroup \\
--image my-app:v1.0 --environment MyContainerappEnv \\
--enable-java-agent
- name: Create a container app with kind as functionapp
text: |
az containerapp create -n my-containerapp -g MyResourceGroup \\
--image my-app:v1.0 --environment MyContainerappEnv \\
--kind functionapp
"""

# containerapp update for preview
Expand Down
3 changes: 2 additions & 1 deletion src/containerapp/azext_containerapp/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@
"template": None, # Template
"workloadProfileName": None
},
"tags": None
"tags": None,
"kind": None
}

ContainerAppsJob = {
Expand Down
1 change: 1 addition & 0 deletions src/containerapp/azext_containerapp/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def load_arguments(self, _):
c.argument('build_env_vars', nargs='*', help="A list of environment variable(s) for the build. Space-separated values in 'key=value' format.",
validator=validate_build_env_vars, is_preview=True)
c.argument('max_inactive_revisions', type=int, help="Max inactive revisions a Container App can have.", is_preview=True)
c.argument('kind', type=str, help="Set to 'functionapp' to get built in support and autoscaling to run Azure functions on Azure Container apps", is_preview=True)
c.argument('registry_identity', help="The managed identity with which to authenticate to the Azure Container Registry (instead of username/password). Use 'system' for a system-defined identity, Use 'system-environment' for an environment level system-defined identity or a resource id for a user-defined environment/containerapp level identity. The managed identity should have been assigned acrpull permissions on the ACR before deployment (use 'az role assignment create --role acrpull ...').")
c.argument('target_label', help="The label to apply to new revisions. Required for revisions-mode 'labels'.", is_preview=True)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,9 @@ def get_argument_customized_keys(self):
def get_argument_service_connectors_def_list(self):
return self.get_param("service_connectors_def_list")

def get_argument_kind(self):
return self.get_param("kind")

def set_argument_service_connectors_def_list(self, service_connectors_def_list):
self.set_param("service_connectors_def_list", service_connectors_def_list)

Expand Down Expand Up @@ -906,6 +909,8 @@ def construct_payload(self):
self.set_up_repo()
if self.get_argument_max_inactive_revisions() is not None:
safe_set(self.containerapp_def, "properties", "configuration", "maxInactiveRevisions", value=self.get_argument_max_inactive_revisions())
if self.get_argument_kind() is not None:
safe_set(self.containerapp_def, "kind", value=self.get_argument_kind())
self.set_up_runtime()

# copy from parent
Expand Down
3 changes: 2 additions & 1 deletion src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,8 @@ def create_containerapp(cmd,
max_inactive_revisions=None,
runtime=None,
enable_java_metrics=None,
enable_java_agent=None):
enable_java_agent=None,
kind=None):
raw_parameters = locals()

containerapp_create_decorator = ContainerAppPreviewCreateDecorator(
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3361,6 +3361,30 @@ def test_containerapp_max_inactive_revisions(self, resource_group):
self.cmd(f'containerapp update -g {resource_group} -n {app} --cpu 0.25 --memory 0.5Gi')
self.cmd(f'containerapp show -g {resource_group} -n {app}', checks=[JMESPathCheck("properties.configuration.maxInactiveRevisions", maxInactiveRevisions)])

@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="centraluseuap")
def test_containerapp_kind_functionapp(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))

app = self.create_random_name(prefix='aca', length=24)
image = "mcr.microsoft.com/k8se/quickstart:latest"

env = prepare_containerapp_env_for_app_e2e_tests(self)

self.cmd(f'containerapp create -g {resource_group} -n {app} --image {image} --ingress external --target-port 80 --environment {env} --cpu 0.5 --memory 1Gi', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("kind", None)
])

self.cmd(f'containerapp create -g {resource_group} -n {app} --image {image} --ingress external --target-port 80 --environment {env} --kind functionapp', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("kind", "functionapp")
])

self.cmd(f'containerapp update -g {resource_group} -n {app} --cpu 0.25 --memory 0.5Gi', checks=[
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("kind", "functionapp")
])

class ContainerappRuntimeTests(ScenarioTest):
def __init__(self, *arg, **kwargs):
Expand Down
Loading