You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Did't know why but ansible playbook return 404 with my subscription.
[WARNING]: * Failed to parse /runner/inventory/ag1/azure_rm.yml with auto plugin: a batched request failed with status code 404
Debugging
After debugging, I found out that the playbook use AzurePublicCloud endpoint, instead of AzureChinaCloud . That's why the response is 404 with my subcribtion_id.
Here is the issue with the library:
Return AZURE_PUBLIC_CLOUD when variable raw_cloud_env is None:
Despite the authentication via msi is success, these line-of-codes lead the object to none when select attribute cloud_environment. Then with the if clause, it selects the cloud as AzurePublicCloud. After all, other module send batch_request uses the wrong endpoint because of the wrong cloud_environment.
TL;DR
Module AzureRMAuth does not treat msi auth method as same as the cli method.
Function _get_msi_credentials is missing attribute cloud_environment when returns.
The text was updated successfully, but these errors were encountered:
Description:
In
azure_rm.yaml
, my config is:Did't know why but ansible playbook return 404 with my subscription.
Debugging
After debugging, I found out that the playbook use AzurePublicCloud endpoint, instead of
AzureChinaCloud
. That's why the response is 404 with my subcribtion_id.Here is the issue with the library:
Return
AZURE_PUBLIC_CLOUD
when variableraw_cloud_env
is None:azure/plugins/module_utils/azure_rm_common.py
Lines 1462 to 1466 in 7b1611d
However, when auth_source=msi, the return object is not including
cloud_environment
, while the cli method has:azure/plugins/module_utils/azure_rm_common.py
Lines 1587 to 1625 in 7b1611d
Despite the authentication via msi is success, these line-of-codes lead the object to none when select attribute cloud_environment. Then with the if clause, it selects the cloud as AzurePublicCloud. After all, other module send batch_request uses the wrong endpoint because of the wrong cloud_environment.
TL;DR
Module
AzureRMAuth
does not treatmsi
auth method as same as thecli
method.Function
_get_msi_credentials
is missing attributecloud_environment
when returns.The text was updated successfully, but these errors were encountered: