question

Mike-9467 avatar image
0 Votes"
Mike-9467 asked ·

Hotmail access via Graph API - Forbidden / Target resource hosted on database is currently on backend 'Unknown'

Hi

I am trying to access the emails from my personal Hotmail account via the Graph API.

I have registered an application in Azure and granted it the necessary permissions from Mail.x and User.x

I set the supported account type to 'Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)'

Minimal python script:

 tenant = 'xxx'
 app_id = 'xxx'
 app_password = 'xxx'
 userAccount = '{user.id}'
    
 resource_URL ='https://graph.microsoft.com'
 authority_url = 'https://login.microsoftonline.com/%s'%(tenant)
    
 context = adal.AuthenticationContext(authority_url)
 token = context.acquire_token_with_client_credentials(resource_URL, app_id, app_password)
 request_headers = {'Authorization': 'bearer %s'%(token['accessToken'])}
    
 message_URL = 'https://graph.microsoft.com/v1.0/users/{user.id}/messages'
 result = requests.get(message_URL, headers = request_headers)


It returns a 503 response and the message 'Target resource 'xxxxxxxx-xxxx-xxxx-0000-000000000000' hosted on database 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx' is currently on backend 'Unknown'. (Redacted)

The Graph Explorer works just fine. I believe the issue is with my configuration within Azure since I get the 503 status from a Javascript call too. I really don't know what I am missing though...

Thanks in advance








azure-active-directoryazure-ad-graphmicrosoft-graph-mailmicrosoft-graph-identity
· 2
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Glad that you isolated the issue with Microsoft Graph Explorer.
Share the detailed error that you're getting with the requestid, timestamp and see which Graph API call it's failing.

0 Votes 0 ·

Hi

Thanks for the response. Can you please advise where I can obtain this information? Nothing else is returned in the request and I cannot see the relevant logs in Azure either.

Cheers

0 Votes 0 ·

0 Answers