From bab62757b45c9160fda1d654577c8c36b94a9eb3 Mon Sep 17 00:00:00 2001 From: Serge Smertin Date: Wed, 19 Apr 2023 15:06:54 +0200 Subject: [PATCH] Support more Azure environments before, only Azure Public Cloud was supported Fix #71 --- databricks/sdk/core.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/databricks/sdk/core.py b/databricks/sdk/core.py index 5b5315dc3..1bfbc0bbc 100644 --- a/databricks/sdk/core.py +++ b/databricks/sdk/core.py @@ -423,7 +423,11 @@ def as_dict(self) -> dict: def is_azure(self) -> bool: has_resource_id = self.azure_workspace_resource_id is not None has_host = self.host is not None - return has_resource_id or (has_host and ".azuredatabricks.net" in self.host) + is_public_cloud = ".azuredatabricks.net" in self.host + is_china_cloud = ".databricks.azure.cn" in self.host + is_gov_cloud = ".databricks.azure.us" in self.host + is_valid_cloud = is_public_cloud or is_china_cloud or is_gov_cloud + return has_resource_id or (has_host and is_valid_cloud) @property def is_gcp(self) -> bool: