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
11 changes: 9 additions & 2 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

Release History
===============
Upcoming
+++++++
0.3.23
++++++
* BREAKING CHANGE: 'az containerapp env certificate list' returns [] if certificate not found, instead of raising an error.
* Added 'az containerapp env certificate create' to create managed certificate in a container app environment
* Added 'az containerapp hostname add' to add hostname to a container app without binding
* 'az containerapp env certificate delete': add support for managed certificate deletion
* 'az containerapp env certificate list': add optional parameters --managed-certificates-only and --private-key-certificates-only to list certificates by type
* 'az containerapp hostname bind': change --thumbprint to an optional parameter and add optional parameter --validation-method to support managed certificate bindings
* 'az containerapp ssl upload': log messages to indicate which step is in progress
* Upgrade api-version from 2022-06-01-preview to 2022-10-01
* Fix error when running `az containerapp up` on local source that doesn't contain a Dockerfile
* Fix the 'TypeError: 'NoneType' object does not support item assignment' error obtained while running the CLI command 'az containerapp dapr enable'
Expand Down
2 changes: 1 addition & 1 deletion src/containerapp/azext_containerapp/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

ACR_TASK_TEMPLATE = """version: v1.1.0
steps:
- cmd: mcr.microsoft.com/oryx/cli:20220811.1 oryx dockerfile --bind-port {{target_port}} --output ./Dockerfile .
- cmd: mcr.microsoft.com/oryx/cli:debian-buster-20230222.1 oryx dockerfile --bind-port {{target_port}} --output ./Dockerfile .
timeout: 28800
- build: -t $Registry/{{image_name}} -f Dockerfile .
timeout: 28800
Expand Down
2 changes: 1 addition & 1 deletion src/containerapp/azext_containerapp/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@
examples:
- name: Add hostname without binding.
text: |
az containerapp hostname add -n MyContainerapp -g MyResourceGroup --hostname MyHostname --location MyLocation
az containerapp hostname add -n MyContainerapp -g MyResourceGroup --hostname MyHostname
"""

helps['containerapp hostname bind'] = """
Expand Down
5 changes: 2 additions & 3 deletions src/containerapp/azext_containerapp/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ def load_arguments(self, _):
with self.argument_context('containerapp env certificate create') as c:
c.argument('hostname', options_list=['--hostname'], help='The custom domain name.')
c.argument('certificate_name', options_list=['--certificate-name', '-c'], help='Name of the managed certificate which should be unique within the Container Apps environment.')
c.argument('location', get_location_type(self.cli_ctx), help='Location of the managed certificate which can be different from the location of the Container Apps environment.')
c.argument('validation_method', options_list=['--validation-method', '-v'], help='Validation method of custom domain ownership.')
c.argument('validation_method', options_list=['--validation-method', '-v'], help='Validation method of custom domain ownership. Supported methods are HTTP, CNAME and TXT.')

with self.argument_context('containerapp env certificate upload') as c:
c.argument('certificate_file', options_list=['--certificate-file', '-f'], help='The filepath of the .pfx or .pem file')
Expand Down Expand Up @@ -374,7 +373,7 @@ def load_arguments(self, _):
c.argument('thumbprint', options_list=['--thumbprint', '-t'], help='Thumbprint of the certificate.')
c.argument('certificate', options_list=['--certificate', '-c'], help='Name or resource id of the certificate.')
c.argument('environment', options_list=['--environment', '-e'], help='Name or resource id of the Container App environment.')
c.argument('validation_method', options_list=['--validation-method', '-v'], help='Validation method of custom domain ownership.')
c.argument('validation_method', options_list=['--validation-method', '-v'], help='Validation method of custom domain ownership.', is_preview=True)

with self.argument_context('containerapp hostname add') as c:
c.argument('hostname', help='The custom domain name.')
Expand Down
8 changes: 4 additions & 4 deletions src/containerapp/azext_containerapp/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ def load_command_table(self, _):
g.custom_command('remove', 'remove_dapr_component')

with self.command_group('containerapp env certificate') as g:
g.custom_command('create', 'create_managed_certificate')
g.custom_command('list', 'list_certificates')
g.custom_command('create', 'create_managed_certificate', is_preview=True)
g.custom_command('list', 'list_certificates', is_preview=True)
g.custom_command('upload', 'upload_certificate')
g.custom_command('delete', 'delete_certificate', confirmation=True, exception_handler=ex_handler_factory())
g.custom_command('delete', 'delete_certificate', confirmation=True, exception_handler=ex_handler_factory(), is_preview=True)

with self.command_group('containerapp env storage', is_preview=True) as g:
g.custom_show_command('show', 'show_storage')
Expand Down Expand Up @@ -180,7 +180,7 @@ def load_command_table(self, _):
g.custom_command('upload', 'upload_ssl', exception_handler=ex_handler_factory())

with self.command_group('containerapp hostname') as g:
g.custom_command('add', 'add_hostname', exception_handler=ex_handler_factory())
g.custom_command('add', 'add_hostname', exception_handler=ex_handler_factory(), is_preview=True)
g.custom_command('bind', 'bind_hostname', exception_handler=ex_handler_factory())
g.custom_command('list', 'list_hostname')
g.custom_command('delete', 'delete_hostname', confirmation=True, exception_handler=ex_handler_factory())
Expand Down
4 changes: 2 additions & 2 deletions src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2737,15 +2737,15 @@ def containerapp_up_logic(cmd, resource_group_name, name, managed_env, image, en
return create_containerapp(cmd=cmd, name=name, resource_group_name=resource_group_name, managed_env=managed_env, image=image, env_vars=env_vars, ingress=ingress, target_port=target_port, registry_server=registry_server, registry_user=registry_user, registry_pass=registry_pass)


def create_managed_certificate(cmd, name, resource_group_name, hostname, validation_method, certificate_name=None, location=None):
def create_managed_certificate(cmd, name, resource_group_name, hostname, validation_method, certificate_name=None):
if certificate_name and not check_managed_cert_name_availability(cmd, resource_group_name, name, certificate_name):
raise ValidationError(f"Certificate name '{certificate_name}' is not available.")
cert_name = certificate_name
while not cert_name:
cert_name = generate_randomized_managed_cert_name(hostname, resource_group_name)
if not check_managed_cert_name_availability(cmd, resource_group_name, name, certificate_name):
cert_name = None
certificate_envelop = prepare_managed_certificate_envelop(cmd, name, resource_group_name, hostname, validation_method, location)
certificate_envelop = prepare_managed_certificate_envelop(cmd, name, resource_group_name, hostname, validation_method)
try:
r = ManagedEnvironmentClient.create_or_update_managed_certificate(cmd, resource_group_name, name, cert_name, certificate_envelop, True, validation_method == 'TXT')
return r
Expand Down
Loading