Skip to content

Commit

Permalink
Support for current version of az-* libraries (#326)
Browse files Browse the repository at this point in the history
* Update azurevm.py

* Peer review based fixes

Co-authored-by: Milos <milos.kozak@nanoenergies.cz>
  • Loading branch information
lejmr and Milos committed Dec 16, 2021
1 parent f9c3272 commit 876ccba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dask_cloudprovider/azure/azurevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
from dask_cloudprovider.exceptions import ConfigError

try:
from azure.common.credentials import get_azure_cli_credentials
from azure.common.credentials import get_cli_profile
from azure.mgmt.network import NetworkManagementClient
from azure.mgmt.compute import ComputeManagementClient
from azure.identity import DefaultAzureCredential
except ImportError as e:
msg = (
"Dask Cloud Provider Azure requirements are not installed.\n\n"
Expand Down Expand Up @@ -477,7 +478,8 @@ def __init__(
self.public_ingress = self.config.get(
"azurevm.public_ingress", override_with=public_ingress
)
self.credentials, self.subscription_id = get_azure_cli_credentials()
self.subscription_id = get_cli_profile().get_subscription_id()
self.credentials = DefaultAzureCredential()
self.compute_client = ComputeManagementClient(
self.credentials, self.subscription_id
)
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"azure-mgmt-network>=16.0.0",
"azure-cli-core>=2.15.1",
"msrestazure",
"azure-identity",
],
"digitalocean": ["python-digitalocean>=1.15.0"],
"gcp": ["google-api-python-client>=1.12.5", "google-auth>=1.23.0"],
Expand Down

0 comments on commit 876ccba

Please sign in to comment.