diff --git a/iotedgedev/azurecli.py b/iotedgedev/azurecli.py
index c5bce70..6bce331 100644
--- a/iotedgedev/azurecli.py
+++ b/iotedgedev/azurecli.py
@@ -226,10 +226,10 @@ class AzureCli:
 
         return result
 
-    def apply_configuration(self, deviceId, connection_string, config):
-        self.output.status(f("Deploying '{config}' to '{deviceId}'..."))
+    def apply_configuration(self, device_id, connection_string, hub_name, config):
+        self.output.status(f("Deploying '{config}' to '{device_id}'..."))
 
-        return self.invoke_az_cli_outproc(["iot", "hub", "apply-configuration", "-d", deviceId, "-k", config, "-l", connection_string], error_message=f("Failed to deploy '{config}' to '{deviceId}'..."), suppress_output=True)
+        return self.invoke_az_cli_outproc(["iot", "hub", "apply-configuration", "-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 get_free_iothub(self):
         with output_io_cls() as io:
diff --git a/iotedgedev/connectionstring.py b/iotedgedev/connectionstring.py
index cc29b68..2c8c19e 100644
--- a/iotedgedev/connectionstring.py
+++ b/iotedgedev/connectionstring.py
@@ -1,10 +1,10 @@
 class ConnectionString:
     def __init__(self, value):
-        self.value = value
+        self.ConnectionString = value
         self.data = dict()
 
-        if self.value: 
-            parts = value.split(';')
+        if self.ConnectionString: 
+            parts = self.ConnectionString.split(';')
             if len(parts) > 0:
                 for part in parts:
                     subpart = part.split('=', 1)
@@ -13,6 +13,8 @@ class ConnectionString:
 
             if self.data:
                 self.HostName = self["hostname"]
+                if self.HostName:
+                    self.HubName = self.HostName.split('.')[0]
                 self.SharedAccessKey = self["sharedaccesskey"]
 
     def __getitem__(self, key):
@@ -23,7 +25,7 @@ class IoTHubConnectionString(ConnectionString):
     def __init__(self, value):
         ConnectionString.__init__(self, value)
 
-        if self.value:
+        if self.ConnectionString:
             self.SharedAccessKeyName = self["sharedaccesskeyname"]
 
 
@@ -31,5 +33,5 @@ class DeviceConnectionString(ConnectionString):
     def __init__(self, value):
         ConnectionString.__init__(self, value)
 
-        if self.value:
+        if self.ConnectionString:
             self.DeviceId = self["deviceid"]
diff --git a/iotedgedev/edge.py b/iotedgedev/edge.py
index 6e71ba0..4d20943 100644
--- a/iotedgedev/edge.py
+++ b/iotedgedev/edge.py
@@ -10,11 +10,11 @@ class Edge:
 
         self.output.header("DEPLOYING CONFIGURATION")
 
-        self.envvars.verify_envvar_has_val("IOTHUB_CONNECTION_STRING", self.envvars.IOTHUB_CONNECTION_STRING)
-        self.envvars.verify_envvar_has_val("DEVICE_CONNECTION_STRING", self.envvars.DEVICE_CONNECTION_STRING)
+        self.envvars.verify_envvar_has_val("IOTHUB_CONNECTION_INFO", self.envvars.IOTHUB_CONNECTION_INFO)
+        self.envvars.verify_envvar_has_val("DEVICE_CONNECTION_INFO", self.envvars.DEVICE_CONNECTION_INFO)
         self.envvars.verify_envvar_has_val("DEPLOYMENT_CONFIG_FILE", self.envvars.DEPLOYMENT_CONFIG_FILE)
 
-        self.azure_cli.apply_configuration(self.envvars.DEVICE_CONNECTION_INFO.DeviceId, self.envvars.IOTHUB_CONNECTION_STRING, self.envvars.DEPLOYMENT_CONFIG_FILE_PATH)
+        self.azure_cli.apply_configuration(self.envvars.DEVICE_CONNECTION_INFO.DeviceId, self.envvars.IOTHUB_CONNECTION_INFO.ConnectionString, self.envvars.IOTHUB_CONNECTION_INFO.HubName, self.envvars.DEPLOYMENT_CONFIG_FILE_PATH)
 
         self.output.footer("DEPLOYMENT COMPLETE")
         
\ No newline at end of file

AZ IOT HUB apply-configuration needs hubname.
If user has old version of az cli iot extension installed they get this: 

`az iot hub apply-configuration: error: argument --hub-name/-n is required
`

- add the -n parameter to the apply-configuration call.  you can get it in IOTHUB_CONNECTION_INFO.HostName

apply-configuration might need ONLY hubname, but HostName has [name].azuredevices.net.

Therefore, You might have to split the ConnectionString.HostName property and add a new property to that class called HubName.

diff --git a/tests/test_connectionstring.py b/tests/test_connectionstring.py
new file mode 100644
index 0000000..21d0dc9
--- /dev/null
+++ b/tests/test_connectionstring.py
@@ -0,0 +1,78 @@
+import os
+import pytest
+from dotenv import load_dotenv
+from iotedgedev.connectionstring import ConnectionString, IoTHubConnectionString, DeviceConnectionString
+
+emptystring = ""
+valid_connectionstring = "HostName=testhub.azure-devices.net;SharedAccessKey=gibberish"
+valid_iothub_connectionstring = "HostName=testhub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=moregibberish"
+valid_device_connectionstring = "HostName=testhub.azure-devices.net;DeviceId=testdevice;SharedAccessKey=othergibberish"
+invalid_connectionstring = "HostName=azure-devices.net;SharedAccessKey=gibberish"
+invalid_iothub_connectionstring = "HostName=testhub.azure-devices.net;SharedAccessKey=moregibberish"
+invalid_device_connectionstring = "HostName=testhub.azure-devices.net;DeviceId=;SharedAccessKey=othergibberish"
+
+def test_empty_connectionstring():
+    connectionstring = ConnectionString(emptystring)
+    assert not connectionstring.data
+
+def test_empty_iothub_connectionstring():
+    connectionstring = IoTHubConnectionString(emptystring)
+    assert not connectionstring.data
+
+def test_empty_device_connectionstring():
+    connectionstring = DeviceConnectionString(emptystring)
+    assert not connectionstring.data
+
+def test_valid_connectionstring():
+    connectionstring = ConnectionString(valid_connectionstring)
+    assert connectionstring.HostName == "testhub.azure-devices.net"
+    assert connectionstring.HubName == "testhub"
+    assert connectionstring.SharedAccessKey == "gibberish"
+
+def test_valid_iothub_connectionstring():
+    connectionstring = IoTHubConnectionString(valid_iothub_connectionstring)
+    assert connectionstring.HostName == "testhub.azure-devices.net"
+    assert connectionstring.HubName == "testhub"
+    assert connectionstring.SharedAccessKeyName == "iothubowner"
+    assert connectionstring.SharedAccessKey == "moregibberish"
+
+def test_valid_devicehub_connectionstring():
+    connectionstring = DeviceConnectionString(valid_device_connectionstring)
+    assert connectionstring.HostName == "testhub.azure-devices.net"
+    assert connectionstring.HubName == "testhub"
+    assert connectionstring.DeviceId == "testdevice"
+    assert connectionstring.SharedAccessKey == "othergibberish"
+
+def test_invalid_connectionstring():
+    connectionstring = ConnectionString(invalid_connectionstring)
+    assert connectionstring.HubName != "testhub"
+
+def test_invalid_iothub_connectionstring():
+    with pytest.raises(KeyError):
+        IoTHubConnectionString(invalid_iothub_connectionstring)
+
+def test_invalid_devicehub_connectionstring():
+    connectionstring = DeviceConnectionString(invalid_device_connectionstring)
+    assert connectionstring.HostName == "testhub.azure-devices.net"
+    assert connectionstring.HubName == "testhub"
+    assert not connectionstring.DeviceId
+    assert connectionstring.SharedAccessKey == "othergibberish"
+
+def test_valid_env_iothub_connectionstring():
+    load_dotenv(".env")
+    env_iothub_connectionstring = os.getenv("IOTHUB_CONNECTION_STRING")
+    connectionstring = IoTHubConnectionString(env_iothub_connectionstring)
+    assert connectionstring.HostName
+    assert connectionstring.HubName
+    assert connectionstring.SharedAccessKey
+    assert connectionstring.SharedAccessKeyName
+
+def test_valid_env_device_connectionstring():
+    load_dotenv(".env")
+    env_device_connectionstring = os.getenv("DEVICE_CONNECTION_STRING")
+    connectionstring = DeviceConnectionString(env_device_connectionstring)
+    assert connectionstring.HostName
+    assert connectionstring.HubName
+    assert connectionstring.SharedAccessKey
+    assert connectionstring.DeviceId
+    
\ No newline at end of file
diff --git a/tests/test_iotedgedev.py b/tests/test_iotedgedev.py
index 2d08bad..c809c15 100644
--- a/tests/test_iotedgedev.py
+++ b/tests/test_iotedgedev.py
@@ -153,7 +153,7 @@ def test_monitor(request, capfd):
     print (err)
     print (result.output)
 
-    assert 'application properties' in out
+    assert 'timeCreated' in out
 
 
 @pytest.fixture

pip install -e .
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y gcc
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
adal==1.2.7
applicationinsights==0.11.10
argcomplete==1.12.3
attrs==22.2.0
azure-cli==2.40.0
azure-cli-cloud==2.1.1
azure-cli-command-modules-nspkg==2.0.3
azure-cli-configure==2.0.24
azure-cli-core==2.40.0
azure-cli-extension==0.2.5
azure-cli-iot==0.3.11
azure-cli-nspkg==3.0.4
azure-cli-profile==2.1.5
azure-cli-resource==2.1.16
azure-cli-telemetry==1.0.8
azure-common==1.1.28
azure-core==1.24.2
azure-iot-edge-runtime-ctl==1.0.0rc22
azure-mgmt-authorization==0.50.0
azure-mgmt-core==1.3.2
azure-mgmt-iothub==0.8.2
azure-mgmt-iothubprovisioningservices==0.2.0
azure-mgmt-managementgroups==0.1.0
azure-mgmt-nspkg==3.0.2
azure-nspkg==3.0.2
bcrypt==4.0.1
certifi==2021.5.30
cffi==1.15.1
charset-normalizer==2.0.12
click==8.0.4
cryptography==39.0.2
docker==3.0.0
docker-pycreds==0.4.0
enum34==1.1.10
fstrings==0.1.0
humanfriendly==10.0
idna==3.10
importlib-metadata==4.8.3
iniconfig==1.1.1
-e git+https://github.com/Azure/iotedgedev.git@ce59bad1286bf650d442b2b7fbe16a3db676a497#egg=iotedgedev
isodate==0.6.1
jmespath==0.10.0
knack==0.10.1
msal==1.18.0b1
msal-extensions==1.0.0
msrest==0.7.1
msrestazure==0.6.4.post1
oauthlib==3.2.2
packaging==21.3
paramiko==2.12.0
pkginfo==1.10.0
pluggy==1.0.0
portalocker==2.7.0
psutil==5.9.8
py==1.11.0
pycparser==2.21
Pygments==2.14.0
PyJWT==2.4.0
PyNaCl==1.5.0
pyOpenSSL==23.2.0
pyparsing==3.1.4
PySocks==1.7.1
pytest==7.0.1
python-dateutil==2.9.0.post0
python-dotenv==0.20.0
PyYAML==6.0.1
requests==2.27.1
requests-oauthlib==2.0.0
six==1.17.0
tabulate==0.8.10
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
websocket-client==1.3.1
zipp==3.6.0

name: iotedgedev
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - adal==1.2.7
      - applicationinsights==0.11.10
      - argcomplete==1.12.3
      - attrs==22.2.0
      - azure-cli==2.40.0
      - azure-cli-cloud==2.1.1
      - azure-cli-command-modules-nspkg==2.0.3
      - azure-cli-configure==2.0.24
      - azure-cli-core==2.40.0
      - azure-cli-extension==0.2.5
      - azure-cli-iot==0.3.11
      - azure-cli-nspkg==3.0.4
      - azure-cli-profile==2.1.5
      - azure-cli-resource==2.1.16
      - azure-cli-telemetry==1.0.8
      - azure-common==1.1.28
      - azure-core==1.24.2
      - azure-iot-edge-runtime-ctl==1.0.0rc22
      - azure-mgmt-authorization==0.50.0
      - azure-mgmt-core==1.3.2
      - azure-mgmt-iothub==0.8.2
      - azure-mgmt-iothubprovisioningservices==0.2.0
      - azure-mgmt-managementgroups==0.1.0
      - azure-mgmt-nspkg==3.0.2
      - azure-nspkg==3.0.2
      - bcrypt==4.0.1
      - cffi==1.15.1
      - charset-normalizer==2.0.12
      - click==8.0.4
      - cryptography==39.0.2
      - docker==3.0.0
      - docker-pycreds==0.4.0
      - enum34==1.1.10
      - fstrings==0.1.0
      - humanfriendly==10.0
      - idna==3.10
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - isodate==0.6.1
      - jmespath==0.10.0
      - knack==0.10.1
      - msal==1.18.0b1
      - msal-extensions==1.0.0
      - msrest==0.7.1
      - msrestazure==0.6.4.post1
      - oauthlib==3.2.2
      - packaging==21.3
      - paramiko==2.12.0
      - pkginfo==1.10.0
      - pluggy==1.0.0
      - portalocker==2.7.0
      - psutil==5.9.8
      - py==1.11.0
      - pycparser==2.21
      - pygments==2.14.0
      - pyjwt==2.4.0
      - pynacl==1.5.0
      - pyopenssl==23.2.0
      - pyparsing==3.1.4
      - pysocks==1.7.1
      - pytest==7.0.1
      - python-dateutil==2.9.0.post0
      - python-dotenv==0.20.0
      - pyyaml==6.0.1
      - requests==2.27.1
      - requests-oauthlib==2.0.0
      - six==1.17.0
      - tabulate==0.8.10
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - websocket-client==1.3.1
      - zipp==3.6.0
prefix: /opt/conda/envs/iotedgedev

tests/test_connectionstring.py::test_valid_connectionstring tests/test_connectionstring.py::test_valid_iothub_connectionstring tests/test_connectionstring.py::test_valid_devicehub_connectionstring tests/test_connectionstring.py::test_invalid_connectionstring tests/test_connectionstring.py::test_invalid_devicehub_connectionstring
tests/test_connectionstring.py::test_valid_env_iothub_connectionstring tests/test_connectionstring.py::test_valid_env_device_connectionstring
tests/test_connectionstring.py::test_empty_connectionstring tests/test_connectionstring.py::test_empty_iothub_connectionstring tests/test_connectionstring.py::test_empty_device_connectionstring tests/test_connectionstring.py::test_invalid_iothub_connectionstring
iotedgedev/connectionstring.py iotedgedev/azurecli.py iotedgedev/edge.py
iotedgedev/connectionstring.py iotedgedev/azurecli.py iotedgedev/edge.py