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
logger.debug('throw requests.exceptions.HTTPError when doing MSIAuthentication: \n%s',
83
84
traceback.format_exc())
84
85
try:
86
+
# RPs will often bubble up detailed error messages in the HTTP response body, making response.status and response.reason alone non-actionable.
87
+
# Eg., The error 'Multiple user assigned identities exist, please specify the clientId / resourceId of the identity in the token request' is
88
+
# returned with a response status of 400 and response.reason of 'Bad Request' only.
89
+
#
90
+
# We're still using the msrestazure library which is deprecated and not accepting new PRs.
91
+
# As this library runs the get response without the stream=True param, the raw response that gets returned does not include the http response body.
92
+
# result = requests.get(request_uri, params=payload, headers={'Metadata': 'true', 'User-Agent':self._user_agent})
93
+
#
94
+
# If we have a 400 http status, retry the operation to get the error. The err.request contains the request uri, payload and headers, so we can resend the request
95
+
iferr.response.status==400:
96
+
replay=replay_request(err)
97
+
iflen(replay.text) >0:
98
+
parsed_body_error=try_parse_json(replay.text)
99
+
else:
100
+
parsed_body_error='Unspecified'
85
101
raiseAzureResponseError('Failed to connect to MSI. Please make sure MSI is configured correctly.\n'
86
-
'Get Token request returned http error: {}, reason: {}'
0 commit comments