From f5035a50bf9bc111512f63e8d349ca57cc38d1c7 Mon Sep 17 00:00:00 2001 From: Dongjiang You Date: Thu, 18 Jan 2018 15:35:01 -0800 Subject: [PATCH] Improve error message in running acr login in cloud shell --- .../azure-cli-acr/azure/cli/command_modules/acr/custom.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/custom.py b/src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/custom.py index 67bead01ec3..9ee7569b2f7 100644 --- a/src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/custom.py +++ b/src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/custom.py @@ -172,6 +172,10 @@ def acr_update_set(cmd, def acr_login(cmd, registry_name, resource_group_name=None, username=None, password=None): + from azure.cli.core.util import in_cloud_console + if in_cloud_console(): + raise CLIError('This command requires running the docker daemon, which is not supported in Azure Cloud Shell.') + from subprocess import PIPE, Popen, CalledProcessError docker_not_installed = "Please verify if docker is installed." docker_not_available = "Please verify if docker daemon is running properly."