Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -3,6 +3,7 @@
Release History
===============
upcoming
* 'az containerapp create/update': support --kind {functionapp}
++++++

1.1.0b2
Expand Down
9 changes: 9 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 Expand Up @@ -951,6 +956,10 @@
text: |
az containerapp update -n my-containerapp -g MyResourceGroup \\
--runtime generic
- name: Update a container app with kind as functionapp
text: |
az containerapp update -n my-containerapp -g MyResourceGroup \\
--kind functionapp
"""

# containerapp list 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
2 changes: 2 additions & 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="kind of containerApp is Function", is_preview=True)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to revise the help command for kind, as it can be either be containerapps, functionapp or workflowapp. Please take help from Ramya here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before we publish kind=containerapp and kind=workflowapp as allowed values this needs to be tested and validated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now can we just say "support containerApp to run as kind {Functionapp}, once kind=containerapp and kind=workflowapp are validated, this help can be updated later with containerapp and workflowapp values.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably say, kind property to be set on the containerapp. e.g: "functionapp". And we can expand on the supported values later.

Copy link

@raorugan raorugan Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update help="Set to functionapp to get built in support and autoscaling to run Azure functions on Azure Container apps"

Copy link

@vivekjilla vivekjilla Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raorugan kind is a string property with multiple potential values like functionapp etc. Not sure if "Enable this to get..." is intuitive enough for customers to understand what they need to do with the attribute

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see above for now only kind=functionapp will be published since kind=conttainerapp or workflow is not validated. Not sure what you mean by intuitive enough

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating your comment. Now it makes sense.

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 Expand Up @@ -69,6 +70,7 @@ def load_arguments(self, _):
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('target_label', help="The label to apply to new revisions. Required for revisions-mode 'labels'.", is_preview=True)
c.argument('kind ', type=str, help="kind of containerApp is Function", is_preview=True)

# Springboard
with self.argument_context('containerapp update', arg_group='Service Binding', is_preview=True) as c:
Expand Down
11 changes: 11 additions & 0 deletions src/containerapp/azext_containerapp/containerapp_decorator.py
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 Expand Up @@ -1404,6 +1409,9 @@ def get_argument_scale_rule_identity(self):
def set_argument_registry_identity(self, registry_identity):
self.set_param("registry_identity", registry_identity)

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

def validate_arguments(self):
super().validate_arguments()
if self.get_argument_service_bindings() and len(self.get_argument_service_bindings()) > 1 and self.get_argument_customized_keys():
Expand Down Expand Up @@ -1527,6 +1535,9 @@ def construct_payload(self):
identity = _ensure_identity_resource_id(subscription_id, self.get_argument_resource_group_name(), identity)
self.new_containerapp["properties"]["template"]["scale"]["rules"][0]["custom"]["identity"] = identity

if self.get_argument_kind() is not None:
safe_set(self.new_containerapp, "kind", value=self.get_argument_kind())

def set_up_source(self):
from ._up_utils import (_validate_source_artifact_args)

Expand Down
12 changes: 8 additions & 4 deletions 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 Expand Up @@ -574,7 +575,8 @@ def update_containerapp_logic(cmd,
enable_java_agent=None,
user_assigned=None,
registry_identity=None,
system_assigned=None):
system_assigned=None,
kind=None):
raw_parameters = locals()

containerapp_update_decorator = ContainerAppPreviewUpdateDecorator(
Expand Down Expand Up @@ -632,7 +634,8 @@ def update_containerapp(cmd,
max_inactive_revisions=None,
runtime=None,
enable_java_metrics=None,
enable_java_agent=None):
enable_java_agent=None,
kind=None):
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)

return update_containerapp_logic(cmd=cmd,
Expand Down Expand Up @@ -674,7 +677,8 @@ def update_containerapp(cmd,
max_inactive_revisions=max_inactive_revisions,
runtime=runtime,
enable_java_metrics=enable_java_metrics,
enable_java_agent=enable_java_agent)
enable_java_agent=enable_java_agent,
kind=kind)


def show_containerapp(cmd, name, resource_group_name, show_secrets=False):
Expand Down
Loading
Loading