Skip to content

Commit

Permalink
resolve anthony's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
StrawnSC committed Aug 31, 2022
1 parent 3511826 commit 332089c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/containerapp/azext_containerapp/_up_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ def _create_github_action(
)


def up_output(app):
def up_output(app: 'ContainerApp', no_dockerfile):
url = safe_get(
ContainerAppClient.show(app.cmd, app.resource_group.name, app.name),
"properties",
Expand All @@ -846,6 +846,9 @@ def up_output(app):
logger.warning(
f"\nYour container app {app.name} has been created and deployed! Congrats! \n"
)
if no_dockerfile and app.ingress:
logger.warning(f"Your app is running image {app.image} and listening on port {app.target_port}")

url and logger.warning(f"Browse to your container app at: {url} \n")
logger.warning(
f"Stream logs for your container with: az containerapp logs show -n {app.name} -g {app.resource_group.name} \n"
Expand Down
7 changes: 5 additions & 2 deletions src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,10 @@ def create_containerapp(cmd,
if "configuration" in r["properties"] and "ingress" in r["properties"]["configuration"] and "fqdn" in r["properties"]["configuration"]["ingress"]:
not disable_warnings and logger.warning("\nContainer app created. Access your app at https://{}/\n".format(r["properties"]["configuration"]["ingress"]["fqdn"]))
else:
not disable_warnings and logger.warning("\nContainer app created. To access it over HTTPS, enable ingress: az containerapp ingress enable --help\n")
target_port = target_port or "<port>"
not disable_warnings and logger.warning("\nContainer app created. To access it over HTTPS, enable ingress: "
"az containerapp ingress enable -n %s -g %s --type external --target-port %s"
" --transport auto\n", name, resource_group_name, target_port)

return r
except Exception as e:
Expand Down Expand Up @@ -2389,7 +2392,7 @@ def containerapp_up(cmd,
if browse:
open_containerapp_in_browser(cmd, app.name, app.resource_group.name)

up_output(app)
up_output(app, no_dockerfile=(source and not _has_dockerfile(source, dockerfile)))


def containerapp_up_logic(cmd, resource_group_name, name, managed_env, image, env_vars, ingress, target_port, registry_server, registry_user, registry_pass):
Expand Down

0 comments on commit 332089c

Please sign in to comment.