Skip to content

Instantly share code, notes, and snippets.

@trondhindenes
Created January 28, 2020 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trondhindenes/7aba91589b1a8549b40e5d19813104c6 to your computer and use it in GitHub Desktop.
Save trondhindenes/7aba91589b1a8549b40e5d19813104c6 to your computer and use it in GitHub Desktop.
# 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
@trondhindenes
Copy link
Author

@duffney
Copy link

duffney commented Jan 29, 2020

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!

@trondhindenes
Copy link
Author

Glad to help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment