Created
January 28, 2020 21:09
-
-
Save trondhindenes/7aba91589b1a8549b40e5d19813104c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change line 138/139 from | |
# except AuthenticationError: | |
# raise AnsibleError('Invalid credentials provided.') | |
#to: | |
except AuthenticationError as e: | |
raise AnsibleError(str(e)) | |
#This will surface the actual exception from azure, instead of just printing a generic one. | |
#It might be possible to use `(e)` instead of `(str(e))` depending on what param AnsibleError takes. It might provide more info |
Thanks @trondhindenes that helped a ton! It exposed the real error which is:
Get Token request returned http error: 400 and server response: {\"error\":\"invalid_request\",\"error_description\":\"AADSTS900144: The request body must contain the following parameter: 'client_id'
I found the python libraries they are using and was able to authenticate and grab the cred with a python script. I'll have to dive deeper into how they are constructing the body of that request to see what' is jacked up. It's starting to make a little sense now. Thanks again!
Glad to help!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
improves https://github.com/Azure/azure_preview_modules/blob/master/lookup_plugins/azure_keyvault_secret.py with better exception messages.