Repository: Azure/iotedgedev

Issue:
Push fails with authentication error
Reported by @michaeljqzq:

Met below error when `iotedgedev push`:
```
{"errorDetail":{"message":"unauthorized: authentication required"},"error":"unauthorized: authentication required"}}
ERROR: Error: unauthorized: authentication required
```

.env:
```
<snipped>

#
# CONTAINER REGISTRY
#
    # Settings for your container registry, set CONTAINER_REGISTRY_SERVER to the following:
    # Local Registry: "localhost:5000" - USERNAME/PASSWORD not required.
    # Azure Container Registry: "jong.azurecr.io", Also set USERNAME/PASSWORD
    # Docker Hub: "jongallant" - Your Docker hub username. Enter your Docker hub username into the CONTAINER_REGISTRY_USERNAME setting. Also set the PASSWORD.

CONTAINER_REGISTRY_SERVER="myregistry.azurecr.io"
CONTAINER_REGISTRY_USERNAME="<snipped>"
CONTAINER_REGISTRY_PASSWORD="<snipped>"

<snipped>
```


Discussion:

Patch:
diff --git a/.env.tmp b/.env.tmp
index b3e3f5c..76b8120 100644
--- a/.env.tmp
+++ b/.env.tmp
@@ -9,22 +9,23 @@ DEVICE_CONNECTION_STRING=""
 #
 # CONTAINER REGISTRY
 #
-    # Settings for your container registry, set CONTAINER_REGISTRY_SERVER to the following as the default registry:
-    # Local Registry: "localhost:5000" - USERNAME/PASSWORD not required.
-    # Azure Container Registry: "jong.azurecr.io", Also set USERNAME/PASSWORD
-    # Docker Hub: "jongallant" - Your Docker hub username. Enter your Docker hub username into the CONTAINER_REGISTRY_USERNAME setting. Also set the PASSWORD.
+    # Settings for your default container registry.
+    # Set CONTAINER_REGISTRY_SERVER to the following:
+    # - Local Registry: "localhost:5000" - USERNAME/PASSWORD not required (Windows container not supported)
+    # - Azure Container Registry: "jong.azurecr.io", Also set USERNAME/PASSWORD
+    # - Docker Hub: "jongallant" - Your Docker hub username. Enter your Docker hub username into the CONTAINER_REGISTRY_USERNAME setting. Also set the PASSWORD.
 
 CONTAINER_REGISTRY_SERVER="localhost:5000"
 CONTAINER_REGISTRY_USERNAME=""
 CONTAINER_REGISTRY_PASSWORD=""
 
-    # To specify additional container registries ensure the prefix is CONTAINER_REGISTRY_SERVER, CONTAINER_REGISTRY_USERNAME, CONTAINER_REGISTRY_PASSWORD
+    # To specify additional container registries ensure the prefix is CONTAINER_REGISTRY_SERVER_, CONTAINER_REGISTRY_USERNAME_, CONTAINER_REGISTRY_PASSWORD_
     # And the token following the prefix uniquely associates the SERVER/USERNAME/PASSWORD
     # Token can be any string of alphanumeric characters
 
-# CONTAINER_REGISTRY_SERVER2=""
-# CONTAINER_REGISTRY_USERNAME2=""
-# CONTAINER_REGISTRY_PASSWORD2=""
+# CONTAINER_REGISTRY_SERVER_2=""
+# CONTAINER_REGISTRY_USERNAME_2=""
+# CONTAINER_REGISTRY_PASSWORD_2=""
 
 #
 # HOST
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..76cd57b
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,16 @@
+---
+name: Bug report
+about: Create a issue to help us improve
+---
+
+<!-- Fill in the information needed -->
+- iotedgedev Version:
+- Python Version:
+- Pip Version:
+- Development machine OS Version:
+- IoT Edge device OS Version:
+
+Steps to Reproduce:
+
+1.
+2.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..de27153
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,7 @@
+---
+name: Feature request
+about: Suggest an idea for IoT Edge and IoT Edge development tools
+
+---
+
+<!-- Describe the feature you'd like. -->
\ No newline at end of file
diff --git a/iotedgedev/azurecli.py b/iotedgedev/azurecli.py
index ca3c104..f2501df 100644
--- a/iotedgedev/azurecli.py
+++ b/iotedgedev/azurecli.py
@@ -278,10 +278,12 @@ class AzureCli:
         self.output.status(f("Deploying '{config}' to '{device_id}'..."))
         config = os.path.join(os.getcwd(), config)
 
-        return self.invoke_az_cli_outproc(["iot", "edge", "set-modules", "-d", device_id, "-n", hub_name, "-k", config, "-l", connection_string], error_message=f("Failed to deploy '{config}' to '{device_id}'..."), suppress_output=True)
+        return self.invoke_az_cli_outproc(["iot", "edge", "set-modules", "-d", device_id, "-n", hub_name, "-k", config, "-l", connection_string],
+                                          error_message=f("Failed to deploy '{config}' to '{device_id}'..."), suppress_output=True)
 
     def monitor_events(self, device_id, connection_string, hub_name, timeout=300):
-        return self.invoke_az_cli_outproc(["iot", "hub", "monitor-events", "-d", device_id, "-n", hub_name, "-l", connection_string, '-t', str(timeout), '-y'], error_message=f("Failed to start monitoring events."), suppress_output=False, timeout=timeout)
+        return self.invoke_az_cli_outproc(["iot", "hub", "monitor-events", "-d", device_id, "-n", hub_name, "-l", connection_string, '-t', str(timeout), '-y'],
+                                          error_message=f("Failed to start monitoring events."), suppress_output=False, timeout=timeout)
 
     def get_free_iothub(self):
         with output_io_cls() as io:
@@ -312,7 +314,8 @@ class AzureCli:
         self.output.header("IOT HUB")
         self.output.status(f("Retrieving IoT Hubs in '{resource_group}'..."))
 
-        return self.invoke_az_cli_outproc(["iot", "hub", "list", "--resource-group", resource_group, "--query", "[].{\"IoT Hub\":name}", "--out", "table"], f("Could not list the IoT Hubs in {resource_group}."))
+        return self.invoke_az_cli_outproc(["iot", "hub", "list", "--resource-group", resource_group, "--query", "[].{\"IoT Hub\":name}", "--out", "table"],
+                                          f("Could not list the IoT Hubs in {resource_group}."))
 
     def iothub_exists(self, value, resource_group):
         self.output.status(
diff --git a/iotedgedev/cli.py b/iotedgedev/cli.py
index 2fe5b45..c85aa25 100644
--- a/iotedgedev/cli.py
+++ b/iotedgedev/cli.py
@@ -85,13 +85,13 @@ def docker():
               type=click.Choice(["csharp", "nodejs", "python", "csharpfunction"]),
               help="Specify the template used to create the default module")
 @with_telemetry
-def create(name, module, template):
+def new(name, module, template):
     utility = Utility(envvars, output)
     sol = Solution(output, utility)
     sol.create(name, module, template)
 
 
-main.add_command(create)
+main.add_command(new)
 
 
 @solution.command(context_settings=CONTEXT_SETTINGS,
@@ -103,7 +103,7 @@ def init():
     utility = Utility(envvars, output)
 
     if len(os.listdir(os.getcwd())) == 0:
-        solcmd = "iotedgedev solution create ."
+        solcmd = "iotedgedev new ."
         output.header(solcmd)
         utility.call_proc(solcmd.split())
 
diff --git a/iotedgedev/dockercls.py b/iotedgedev/dockercls.py
index c55f4d4..8c308a7 100644
--- a/iotedgedev/dockercls.py
+++ b/iotedgedev/dockercls.py
@@ -1,6 +1,5 @@
 import json
 import os
-import sys
 import zipfile
 
 import docker
diff --git a/iotedgedev/envvars.py b/iotedgedev/envvars.py
index f180959..9662159 100644
--- a/iotedgedev/envvars.py
+++ b/iotedgedev/envvars.py
@@ -1,6 +1,5 @@
 import os
 import platform
-import sys
 from shutil import copyfile
 
 from dotenv import load_dotenv, set_key
@@ -20,7 +19,7 @@ class EnvVars:
         current_command = Args().get_current_command()
         # for some commands we don't want to load dotenv
         # TODO: temporary hack. A more grace solution would be a decorator on the command to indicate whether to bypass env
-        self.bypass_dotenv_load_commands = ['solution init', 'solution e2e', 'solution create', 'create', 'simulator stop', 'simulator modulecred']
+        self.bypass_dotenv_load_commands = ['solution init', 'solution e2e', 'solution new', 'new', 'simulator stop', 'simulator modulecred']
         self.bypass = self.is_bypass_command(current_command)
         # for some commands we don't want verbose dotenv load output
         self.terse_commands = ['', 'iothub setup']
@@ -151,7 +150,7 @@ class EnvVars:
                 else:
                     self.DOCKER_HOST = None
             except Exception as ex:
-                msg = "Environment variables not configured correctly. Run `iotedgedev solution create` to create a new solution with sample .env file. "
+                msg = "Environment variables not configured correctly. Run `iotedgedev new` to create a new solution with sample .env file. "
                 "Please see README for variable configuration options. Tip: You might just need to restart your command prompt to refresh your Environment Variables. "
                 "Variable that caused exception: {0}".format(str(ex))
                 raise ValueError(msg)
@@ -216,33 +215,12 @@ class EnvVars:
             raise IOError(f("Could not update the environment variable {key} in file {dotenv_path}"))
 
     def get_registries(self):
-        registries = {}
         self.CONTAINER_REGISTRY_MAP = {}
-        length_container_registry_server = len('container_registry_server')
-        length_container_registry_username_or_password = len('container_registry_username')
-        length_container_registry = len('container_registry_')
-        # loops through .env file for key matching container_registry_server, container_registry_username, container_registry_password
+        subkeys = ['server', 'username', 'password']
+        # loops through os.environ for key matching container_registry_server, container_registry_username, container_registry_password
         for key in os.environ:
-            key = key.upper()
-            # get token for container_registry_server key
-            if key.startswith('CONTAINER_REGISTRY_SERVER'):
-                token = key[length_container_registry_server:]
-                # if the token doesn't already exist as an item in the dictionary, add it. if it does, add the server value
-                if token not in registries:
-                    registries[token] = {'username': '', 'password': ''}
-                registries[token]['server'] = self.get_envvar(key, required=True)
-            # get token for container_registry_username or container_registry_password key and get subkey (username or password)
-            elif key.startswith(('CONTAINER_REGISTRY_USERNAME', 'CONTAINER_REGISTRY_PASSWORD')):
-                token = key[length_container_registry_username_or_password:]
-                subkey = key[length_container_registry:length_container_registry_username_or_password]
-                # if the token doesn't already exist as an item in the dictionary, add it. if it does, add the subkey(username/password) value
-                if token not in registries:
-                    registries[token] = {'username': '', 'password': ''}
-                registries[token][subkey] = self.get_envvar(key)
-
-        # store parsed values as a dictionary of containerregistry objects
-        for key, value in registries.items():
-            self.CONTAINER_REGISTRY_MAP[key] = ContainerRegistry(value['server'], value['username'], value['password'])
+            for subkey in subkeys:
+                self._set_registry_map(key, subkey)
 
     def is_posix(self):
         plat = platform.system().lower()
@@ -268,3 +246,23 @@ class EnvVars:
                 else:
                     continue
         return False
+
+    def _set_registry_map(self, env_key, subkey):
+        registry_key_prefix = 'CONTAINER_REGISTRY_'
+        default_key_prefix = registry_key_prefix + subkey.upper()
+
+        # The prefix for additional registries has an additional underscore
+        add_key_prefix = default_key_prefix + '_'
+        add_key_prefix_length = len(add_key_prefix)
+
+        if env_key.startswith(default_key_prefix):
+            if env_key == default_key_prefix:
+                token = ''
+            elif env_key.startswith(add_key_prefix):
+                token = env_key[add_key_prefix_length:]
+            else:
+                return
+
+            if token not in self.CONTAINER_REGISTRY_MAP:
+                self.CONTAINER_REGISTRY_MAP[token] = ContainerRegistry('', '', '')
+            setattr(self.CONTAINER_REGISTRY_MAP[token], subkey.lower(), self.get_envvar(env_key))
diff --git a/iotedgedev/modules.py b/iotedgedev/modules.py
index c0f44c9..bb25df5 100644
--- a/iotedgedev/modules.py
+++ b/iotedgedev/modules.py
@@ -152,7 +152,7 @@ class Modules:
                             registry_key = key
                             break
                     if registry_key is None:
-                        self.output.error("Could not find registry server with name {0}. Please make sure your envvar is set.".format(tag.split('/')[0].lower()))
+                        raise ValueError("Could not find registry server with name {0}. Please make sure your envvar is set.".format(tag.split('/')[0].lower()))
                     self.output.info("module json reading {0}".format(tag))
 
                     response = docker.docker_client.images.push(repository=tag, stream=True, auth_config={
diff --git a/iotedgedev/template/.env.tmp b/iotedgedev/template/.env.tmp
index b3e3f5c..76b8120 100644
--- a/iotedgedev/template/.env.tmp
+++ b/iotedgedev/template/.env.tmp
@@ -9,22 +9,23 @@ DEVICE_CONNECTION_STRING=""
 #
 # CONTAINER REGISTRY
 #
-    # Settings for your container registry, set CONTAINER_REGISTRY_SERVER to the following as the default registry:
-    # Local Registry: "localhost:5000" - USERNAME/PASSWORD not required.
-    # Azure Container Registry: "jong.azurecr.io", Also set USERNAME/PASSWORD
-    # Docker Hub: "jongallant" - Your Docker hub username. Enter your Docker hub username into the CONTAINER_REGISTRY_USERNAME setting. Also set the PASSWORD.
+    # Settings for your default container registry.
+    # Set CONTAINER_REGISTRY_SERVER to the following:
+    # - Local Registry: "localhost:5000" - USERNAME/PASSWORD not required (Windows container not supported)
+    # - Azure Container Registry: "jong.azurecr.io", Also set USERNAME/PASSWORD
+    # - Docker Hub: "jongallant" - Your Docker hub username. Enter your Docker hub username into the CONTAINER_REGISTRY_USERNAME setting. Also set the PASSWORD.
 
 CONTAINER_REGISTRY_SERVER="localhost:5000"
 CONTAINER_REGISTRY_USERNAME=""
 CONTAINER_REGISTRY_PASSWORD=""
 
-    # To specify additional container registries ensure the prefix is CONTAINER_REGISTRY_SERVER, CONTAINER_REGISTRY_USERNAME, CONTAINER_REGISTRY_PASSWORD
+    # To specify additional container registries ensure the prefix is CONTAINER_REGISTRY_SERVER_, CONTAINER_REGISTRY_USERNAME_, CONTAINER_REGISTRY_PASSWORD_
     # And the token following the prefix uniquely associates the SERVER/USERNAME/PASSWORD
     # Token can be any string of alphanumeric characters
 
-# CONTAINER_REGISTRY_SERVER2=""
-# CONTAINER_REGISTRY_USERNAME2=""
-# CONTAINER_REGISTRY_PASSWORD2=""
+# CONTAINER_REGISTRY_SERVER_2=""
+# CONTAINER_REGISTRY_USERNAME_2=""
+# CONTAINER_REGISTRY_PASSWORD_2=""
 
 #
 # HOST


Test patch:
diff --git a/tests/test_envvars.py b/tests/test_envvars.py
index 038da27..03c41ad 100644
--- a/tests/test_envvars.py
+++ b/tests/test_envvars.py
@@ -75,49 +75,49 @@ def test_envvar_clean():
 def test_in_command_list_true_1():
     output = Output()
     envvars = EnvVars(output)
-    assert envvars.in_command_list("solution create test_solution", ["init", "e2e", "solution create", "create", "simulator stop"])
+    assert envvars.in_command_list("solution new test_solution", ["init", "e2e", "solution new", "new", "simulator stop"])
 
 
 def test_in_command_list_true_2():
     output = Output()
     envvars = EnvVars(output)
-    assert envvars.in_command_list("solution create", ["init", "e2e", "solution create", "create", "simulator stop"])
+    assert envvars.in_command_list("solution new", ["init", "e2e", "solution new", "new", "simulator stop"])
 
 
 def test_in_command_list_false_1():
     output = Output()
     envvars = EnvVars(output)
-    assert not envvars.in_command_list("solution add filtermodule", ["init", "e2e", "solution create", "create", "simulator stop"])
+    assert not envvars.in_command_list("solution add filtermodule", ["init", "e2e", "solution new", "new", "simulator stop"])
 
 
 def test_in_command_list_false_2():
     output = Output()
     envvars = EnvVars(output)
-    assert not envvars.in_command_list("solution addotherstuff filtermodule", ["init", "e2e", "solution add", "create", "simulator stop"])
+    assert not envvars.in_command_list("solution addotherstuff filtermodule", ["init", "e2e", "solution add", "new", "simulator stop"])
 
 
 def test_in_command_list_empty_1():
     output = Output()
     envvars = EnvVars(output)
-    assert not envvars.in_command_list("", ["init", "e2e", "solution create", "create", "simulator stop"])
+    assert not envvars.in_command_list("", ["init", "e2e", "solution new", "new", "simulator stop"])
 
 
 def test_in_command_list_empty_2():
     output = Output()
     envvars = EnvVars(output)
-    assert not envvars.in_command_list("solution create test_solution", ["init", "e2e", "", "create", "simulator stop"])
+    assert not envvars.in_command_list("solution new test_solution", ["init", "e2e", "", "new", "simulator stop"])
 
 
 def test_in_command_list_empty_3():
     output = Output()
     envvars = EnvVars(output)
-    assert envvars.in_command_list("", ["init", "e2e", "", "create", "simulator stop"])
+    assert envvars.in_command_list("", ["init", "e2e", "", "new", "simulator stop"])
 
 
 def test_is_bypass_command_true():
     output = Output()
     envvars = EnvVars(output)
-    assert envvars.is_bypass_command("solution create EdgeSolution")
+    assert envvars.is_bypass_command("solution new EdgeSolution")
 
 
 def test_is_bypass_command_false():
@@ -141,7 +141,7 @@ def test_is_terse_command_true():
 def test_is_terse_command_false():
     output = Output()
     envvars = EnvVars(output)
-    assert not envvars.is_terse_command("solution create")
+    assert not envvars.is_terse_command("solution new")
 
 
 def test_is_terse_command_empty():
@@ -182,29 +182,26 @@ def test_container_registry_server_key_missing_sys_exit():
     output = Output()
     envvars = EnvVars(output)
     with pytest.raises(ValueError):
-        envvars.get_envvar("CONTAINER_REGISTRY_SERVERUNITTEST", required=True)
+        envvars.get_envvar("CONTAINER_REGISTRY_SERVER_UNITTEST", required=True)
 
 
 @pytest.fixture
 def setup_test_env(request):
     output = Output()
     envvars = EnvVars(output)
-    envvars.set_envvar("CONTAINER_REGISTRY_SERVERUNITTEST", '')
+    envvars.set_envvar("CONTAINER_REGISTRY_SERVER_UNITTEST", 'unittest.azurecr.io')
+    envvars.set_envvar("CONTAINER_REGISTRY_USERNAME_UNITTEST", 'username')
+    envvars.set_envvar("CONTAINER_REGISTRY_PASSWORD_UNITTEST", 'password')
 
     def clean():
-        os.environ.pop("CONTAINER_REGISTRY_SERVERUNITTEST")
+        os.environ.pop("CONTAINER_REGISTRY_SERVER_UNITTEST")
+        os.environ.pop("CONTAINER_REGISTRY_USERNAME_UNITTEST")
+        os.environ.pop("CONTAINER_REGISTRY_PASSWORD_UNITTEST")
     request.addfinalizer(clean)
 
     return
 
 
-def test_container_registry_server_value_missing_sys_exit(setup_test_env):
-    output = Output()
-    envvars = EnvVars(output)
-    with pytest.raises(ValueError):
-        envvars.get_envvar("CONTAINER_REGISTRY_SERVERUNITTEST", required=True)
-
-
 def test_unique_container_registry_server_tokens():
     unique = set()
     length_container_registry_server = len('container_registry_server')
@@ -259,45 +256,12 @@ def test_unique_container_registry_password_tokens():
     assert is_unique
 
 
-def test_container_registry_map_has_val():
-    output = Output()
-    envvars = EnvVars(output)
-    envvars.load()
-    result = envvars.verify_envvar_has_val("CONTAINER_REGISTRY_MAP", envvars.CONTAINER_REGISTRY_MAP)
-    assert not result
-
-
-def test_additional_container_registry_server_has_val():
-    output = Output()
-    envvars = EnvVars(output)
-    envvars.load()
-    if len(envvars.CONTAINER_REGISTRY_MAP) > 1:
-        keys = envvars.CONTAINER_REGISTRY_MAP.keys()
-        for key in keys:
-            if key != '':
-                token = key
-        assert envvars.CONTAINER_REGISTRY_MAP[token].server is not None
-
-
-def test_additional_container_registry_username_has_val():
-    output = Output()
-    envvars = EnvVars(output)
-    envvars.load()
-    if len(envvars.CONTAINER_REGISTRY_MAP) > 1:
-        keys = envvars.CONTAINER_REGISTRY_MAP.keys()
-        for key in keys:
-            if key != '':
-                token = key
-        assert envvars.CONTAINER_REGISTRY_MAP[token].username is not None
-
-
-def test_additional_container_registry_password_has_val():
+def test_additional_container_registry_map_has_val(setup_test_env):
     output = Output()
     envvars = EnvVars(output)
     envvars.load()
-    if len(envvars.CONTAINER_REGISTRY_MAP) > 1:
-        keys = envvars.CONTAINER_REGISTRY_MAP.keys()
-        for key in keys:
-            if key != '':
-                token = key
-        assert envvars.CONTAINER_REGISTRY_MAP[token].password is not None
+    assert len(envvars.CONTAINER_REGISTRY_MAP) == 2
+    assert 'UNITTEST' in envvars.CONTAINER_REGISTRY_MAP.keys()
+    assert envvars.CONTAINER_REGISTRY_MAP['UNITTEST'].server == 'unittest.azurecr.io'
+    assert envvars.CONTAINER_REGISTRY_MAP['UNITTEST'].username == 'username'
+    assert envvars.CONTAINER_REGISTRY_MAP['UNITTEST'].password == 'password'
diff --git a/tests/test_iotedgedev.py b/tests/test_iotedgedev.py
index c436ca8..60d7f06 100644
--- a/tests/test_iotedgedev.py
+++ b/tests/test_iotedgedev.py
@@ -36,7 +36,7 @@ def create_solution(request):
 
     runner = CliRunner()
     os.chdir(tests_dir)
-    result = runner.invoke(cli.main, ['solution', 'create', test_solution])
+    result = runner.invoke(cli.main, ['solution', 'new', test_solution])
     print(result.output)
     assert 'AZURE IOT EDGE SOLUTION CREATED' in result.output
 
@@ -58,7 +58,7 @@ def test_solution_create_in_non_empty_current_path(request):
 
     cli = __import__("iotedgedev.cli", fromlist=['main'])
     runner = CliRunner()
-    result = runner.invoke(cli.main, ['solution', 'create', '.'])
+    result = runner.invoke(cli.main, ['solution', 'new', '.'])
     print(result.output)
 
     assert "Directory is not empty" in result.output
@@ -75,7 +75,7 @@ def test_solution_create_in_empty_current_path(request):
 
     cli = __import__("iotedgedev.cli", fromlist=['main'])
     runner = CliRunner()
-    result = runner.invoke(cli.main, ['solution', 'create', '.'])
+    result = runner.invoke(cli.main, ['solution', 'new', '.'])
     print(result.output)
 
     assert 'AZURE IOT EDGE SOLUTION CREATED' in result.output
@@ -88,7 +88,7 @@ def test_solution_create_in_non_empty_dir(request):
 
     cli = __import__("iotedgedev.cli", fromlist=['main'])
     runner = CliRunner()
-    result = runner.invoke(cli.main, ['solution', 'create', test_solution])
+    result = runner.invoke(cli.main, ['solution', 'new', test_solution])
     print(result.output)
 
     assert "Directory is not empty" in result.output
@@ -104,7 +104,7 @@ def test_solution_create_in_empty_child_dir(request):
 
     cli = __import__("iotedgedev.cli", fromlist=['main'])
     runner = CliRunner()
-    result = runner.invoke(cli.main, ['solution', 'create', dirname])
+    result = runner.invoke(cli.main, ['solution', 'new', dirname])
     print(result.output)
 
     assert 'AZURE IOT EDGE SOLUTION CREATED' in result.output
diff --git a/tests/test_simulator.py b/tests/test_simulator.py
index 5ba1e56..38849d6 100644
--- a/tests/test_simulator.py
+++ b/tests/test_simulator.py
@@ -26,7 +26,7 @@ def create_solution(request):
 
     runner = CliRunner()
     os.chdir(tests_dir)
-    result = runner.invoke(cli.main, ['solution', 'create', test_solution])
+    result = runner.invoke(cli.main, ['solution', 'new', test_solution])
     print(result.output)
 
     assert 'AZURE IOT EDGE SOLUTION CREATED' in result.output