Skip to content
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

Containerapp 0.3.6 release #4879

Merged
merged 17 commits into from
Jun 8, 2022
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
3 changes: 2 additions & 1 deletion scripts/ci/credscan/CredScanSuppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@
"src\\containerapp\\azext_containerapp\\tests\\latest\\recordings\\test_containerapp_dapr_e2e.yaml",
"src\\containerapp\\azext_containerapp\\tests\\latest\\recordings\\test_containerapp_up_image_e2e.yaml",
"src\\containerapp\\azext_containerapp\\tests\\latest\\recordings\\test_containerapp_custom_domains_e2e.yaml",
"src\\containerapp\\azext_containerapp\\tests\\latest\\recordings\\test_containerapp_revision_label_e2e.yaml",
"src\\containerapp\\azext_containerapp\\tests\\latest\\cert.pfx",
"src\\containerapp\\azext_containerapp\\tests\\latest\\test_containerapp_commands.py",
"src\\containerapp\\azext_containerapp\\tests\\latest\test_containerapp_env_commands.py"
"src\\containerapp\\azext_containerapp\\tests\\latest\\test_containerapp_env_commands.py"
],
"_justification": "Dummy resources' keys left during testing Microsoft.App (required for log-analytics to create managedEnvironments)"
}
Expand Down
11 changes: 11 additions & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
Release History
===============

0.3.6
++++++
* BREAKING CHANGE: 'az containerapp revision list' now shows only active revisions by default, added flag --all to show all revisions
* BREAKING CHANGE: 'az containerapp env certificate upload' does not prompt by default when re-uploading an existing certificate. Added --show-prompt to show prompts on re-upload.
* Added parameter --environment to 'az containerapp list'
* Added 'az containerapp revision label swap' to swap traffic labels
* Fixed bug with 'az containerapp up' where custom domains would be removed when updating existing containerapp
* Fixed bug with 'az containerapp auth update' when using --unauthenticated-client-action
* Fixed bug with 'az containerapp env certificate upload' where it shows a misleading message for invalid certificate name
* 'az containerapp registry set': allow authenticating with managed identity (MSI) instead of ACR username & password

0.3.5
++++++
* Add parameter --zone-redundant to 'az containerapp env create'
Expand Down
7 changes: 6 additions & 1 deletion src/containerapp/azext_containerapp/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
SHORT_POLLING_INTERVAL_SECS = 3
LONG_POLLING_INTERVAL_SECS = 10

ACR_IMAGE_SUFFIX = ".azurecr.io"

LOG_ANALYTICS_RP = "Microsoft.OperationalInsights"
CONTAINER_APPS_RP = "Microsoft.App"

Expand All @@ -21,6 +23,9 @@
MSA_SECRET_SETTING_NAME = "msa-provider-authentication-secret"
TWITTER_SECRET_SETTING_NAME = "twitter-provider-authentication-secret"
APPLE_SECRET_SETTING_NAME = "apple-provider-authentication-secret"
UNAUTHENTICATED_CLIENT_ACTION = ['RedirectToLoginPage', 'AllowAnonymous', 'RejectWith401', 'RejectWith404']
UNAUTHENTICATED_CLIENT_ACTION = ['RedirectToLoginPage', 'AllowAnonymous', 'Return401', 'Return403']
FORWARD_PROXY_CONVENTION = ['NoProxy', 'Standard', 'Custom']
CHECK_CERTIFICATE_NAME_AVAILABILITY_TYPE = "Microsoft.App/managedEnvironments/certificates"

NAME_INVALID = "Invalid"
NAME_ALREADY_EXISTS = "AlreadyExists"
13 changes: 13 additions & 0 deletions src/containerapp/azext_containerapp/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,15 @@
az containerapp revision label remove -n MyContainerapp -g MyResourceGroup --label myLabel
"""

helps['containerapp revision label swap'] = """
type: command
short-summary: Swap a revision label between two revisions with associated traffic weights.
examples:
- name: Swap a revision label between two revisions.
text: |
az containerapp revision label swap -n MyContainerapp -g MyResourceGroup --source myLabel1 --target myLabel2
"""

# Environment Commands
helps['containerapp env'] = """
type: group
Expand All @@ -303,6 +312,10 @@
text: |
az containerapp env create -n MyContainerappEnvironment -g MyResourceGroup \\
--location eastus2
- name: Create a zone-redundant environment
text: |
az containerapp env create -n MyContainerappEnvironment -g MyResourceGroup \\
--location eastus2 --zone-redundant
- name: Create an environment with an existing Log Analytics workspace.
text: |
az containerapp env create -n MyContainerappEnvironment -g MyResourceGroup \\
Expand Down
8 changes: 8 additions & 0 deletions src/containerapp/azext_containerapp/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def load_arguments(self, _):
c.argument('certificate_file', options_list=['--certificate-file', '-f'], help='The filepath of the .pfx or .pem file')
c.argument('certificate_name', options_list=['--certificate-name', '-c'], help='Name of the certificate which should be unique within the Container Apps environment.')
c.argument('certificate_password', options_list=['--password', '-p'], help='The certificate file password')
c.argument('prompt', options_list=['--show-prompt'], action='store_true', help='Show prompt to upload an existing certificate.')

with self.argument_context('containerapp env certificate list') as c:
c.argument('name', id_part=None)
Expand Down Expand Up @@ -200,6 +201,7 @@ def load_arguments(self, _):

with self.argument_context('containerapp revision') as c:
c.argument('revision_name', options_list=['--revision'], help='Name of the revision.')
c.argument('all', help='Show inactive revisions.', action='store_true')

with self.argument_context('containerapp revision copy') as c:
c.argument('from_revision', help='Revision to copy from. Default: latest revision.')
Expand All @@ -209,6 +211,11 @@ def load_arguments(self, _):
c.argument('name', id_part=None)
c.argument('revision', help='Name of the revision.')
c.argument('label', help='Name of the label.')
c.argument('yes', options_list=['--no-prompt', '--yes', '-y'], help='Do not prompt for confirmation.', action='store_true')

with self.argument_context('containerapp revision label') as c:
c.argument('source_label', options_list=['--source'], help='Source label to be swapped.')
c.argument('target_label', options_list=['--target'], help='Target label to be swapped to.')

with self.argument_context('containerapp ingress') as c:
c.argument('allow_insecure', help='Allow insecure connections for ingress traffic.')
Expand Down Expand Up @@ -241,6 +248,7 @@ def load_arguments(self, _):
c.argument('server', help="The container registry server, e.g. myregistry.azurecr.io")
c.argument('username', help='The username of the registry. If using Azure Container Registry, we will try to infer the credentials if not supplied')
c.argument('password', help='The password of the registry. If using Azure Container Registry, we will try to infer the credentials if not supplied')
c.argument('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 or a resource id for a user-defined identity. The managed identity should have been assigned acrpull permissions on the ACR before deployment (use 'az role assignment create --role acrpull ...').")

with self.argument_context('containerapp registry list') as c:
c.argument('name', id_part=None)
Expand Down
10 changes: 5 additions & 5 deletions src/containerapp/azext_containerapp/_up_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
register_provider_if_needed
)

from ._constants import MAXIMUM_SECRET_LENGTH, LOG_ANALYTICS_RP, CONTAINER_APPS_RP
from ._constants import MAXIMUM_SECRET_LENGTH, LOG_ANALYTICS_RP, CONTAINER_APPS_RP, ACR_IMAGE_SUFFIX

from .custom import (
create_managed_environment,
Expand Down Expand Up @@ -297,7 +297,7 @@ def create_acr_if_needed(self):
def create_acr(self):
registry_rg = self.resource_group
url = self.registry_server
registry_name = url[: url.rindex(".azurecr.io")]
registry_name = url[: url.rindex(ACR_IMAGE_SUFFIX)]
location = "eastus"
if self.env.location and self.env.location.lower() != "northcentralusstage":
location = self.env.location
Expand Down Expand Up @@ -613,7 +613,7 @@ def _get_registry_from_app(app):


def _get_acr_rg(app):
registry_name = app.registry_server[: app.registry_server.rindex(".azurecr.io")]
registry_name = app.registry_server[: app.registry_server.rindex(ACR_IMAGE_SUFFIX)]
client = get_mgmt_service_client(
app.cmd.cli_ctx, ContainerRegistryManagementClient
).registries
Expand Down Expand Up @@ -663,11 +663,11 @@ def _get_registry_details(cmd, app: "ContainerApp", source):
registry_name, registry_rg = find_existing_acr(cmd, app)
if registry_name and registry_rg:
_set_acr_creds(cmd, app, registry_name)
app.registry_server = registry_name + ".azurecr.io"
app.registry_server = registry_name + ACR_IMAGE_SUFFIX
else:
registry_rg = app.resource_group.name
registry_name = _get_default_registry_name(app)
app.registry_server = registry_name + ".azurecr.io"
app.registry_server = registry_name + ACR_IMAGE_SUFFIX
app.should_create_acr = True

app.acr = AzureContainerRegistry(
Expand Down
Loading