Skip to content

Commit

Permalink
[containerapp] Give a better error message when customer uses --artif… (
Browse files Browse the repository at this point in the history
#6983)

* [containerapp] Give a better error message when customer uses --artifact with ACR Task

* Clarify the error message

* Minor update
  • Loading branch information
daniv-msft authored Nov 11, 2023
1 parent 9509e41 commit d3890e7
Show file tree
Hide file tree
Showing 2 changed files with 300 additions and 4,582 deletions.
4 changes: 4 additions & 0 deletions src/containerapp/azext_containerapp/_up_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,10 @@ def build_container_from_source_with_acr_task(self, image_name, source):
from azure.cli.command_modules.acr._client_factory import cf_acr_tasks, cf_acr_runs
from azure.cli.core.profiles import ResourceType

# Validate that the source provided is a directory, and not a file.
if os.path.isfile(source):
raise ValidationError(f"Impossible to build the artifact file {source} with ACR Task. Please make sure that you use --source and target a directory, or if you want to build your artifact locally, please make sure Docker is running on your machine.")

task_name = "cli_build_containerapp"
registry_name = (self.registry_server[: self.registry_server.rindex(ACR_IMAGE_SUFFIX)]).lower()
if not self.target_port:
Expand Down
Loading

0 comments on commit d3890e7

Please sign in to comment.