Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port #49063 to master #58042

Merged
merged 5 commits into from Jul 29, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 17 additions & 4 deletions salt/cloud/clouds/azurearm.py
Expand Up @@ -34,6 +34,9 @@
* ``client_id``
* ``secret``

if using Managed Service Identity authentication:
* ``subscription_id``

Optional provider parameters:

**cloud_environment**: Used to point the cloud driver to different API endpoints, such as Azure GovCloud. Possible values:
Expand Down Expand Up @@ -260,6 +263,14 @@ def __is_provider_configured(opts, provider, required_keys=()):
("subscription_id", "username", "password"),
)

if provider is False:
# check if using MSI style credentials...
provider = config.is_provider_configured(
__opts__,
__active_provider_name__ or __virtualname__,
required_keys=("subscription_id",),
)

nicholasmhughes marked this conversation as resolved.
Show resolved Hide resolved
return provider


Expand Down Expand Up @@ -301,10 +312,12 @@ def get_conn(client_type):
"secret", get_configured_provider(), __opts__, search_global=False
)
conn_kwargs.update({"client_id": client_id, "secret": secret, "tenant": tenant})
else:
username = config.get_cloud_config_value(
"username", get_configured_provider(), __opts__, search_global=False
)

username = config.get_cloud_config_value(
"username", get_configured_provider(), __opts__, search_global=False
)

if username:
nicholasmhughes marked this conversation as resolved.
Show resolved Hide resolved
password = config.get_cloud_config_value(
"password", get_configured_provider(), __opts__, search_global=False
)
Expand Down