Skip to content

Commit

Permalink
Support more Azure environments
Browse files Browse the repository at this point in the history
before, only Azure Public Cloud was supported

Fix #71
  • Loading branch information
nfx committed Apr 19, 2023
1 parent d7089ec commit da588b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion databricks/sdk/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit da588b6

Please sign in to comment.