diff --git a/azext_iot/_factory.py b/azext_iot/_factory.py index d7bd2d6f6..aee601e82 100644 --- a/azext_iot/_factory.py +++ b/azext_iot/_factory.py @@ -10,7 +10,7 @@ from azext_iot.common.sas_token_auth import SasTokenAuthentication from azext_iot.iothub.providers.aad_oauth import IoTHubOAuth -from azext_iot.common.shared import SdkType +from azext_iot.common.shared import SdkType, AuthenticationTypeDataplane from azext_iot.constants import USER_AGENT, IOTHUB_RESOURCE_ID from msrestazure.azure_exceptions import CloudError @@ -102,7 +102,7 @@ def _get_iothub_service_sdk(self): if self.auth_override: credentials = self.auth_override - elif self.target["policy"] == "login": + elif self.target["policy"] == AuthenticationTypeDataplane.login.value: credentials = IoTHubOAuth( cmd=self.target["cmd"], resource_id=IOTHUB_RESOURCE_ID