The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Azure Active Directory!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
unauthorized_client","error_description":"AADSTS70001: Application with identifier 'xxxx-xxxx-xxxx-xxxx-xxxx' was not found in the directory RRS feed

  • Question

  • using management certificate to authorize with this python script

    from azure import *
    from azure.servicemanagement import *
    subscription_id = 'xxxx-xxxx-xxxx-xxxx-xxxx'
    certificate_path = '/root/python/azure/Azure-python/my-cert-file.pem'

    sms = ServiceManagementService(subscription_id, certificate_path)

    When run with python returns this error

    python test.py
    /usr/lib/python2.7/site-packages/urllib3/connectionpool.py:857: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
      InsecureRequestWarning)
    Traceback (most recent call last):
      File "test.py", line 1, in <module>
        from azure import *
      File "/root/python/azure/Azure-python/azure.py", line 25, in <module>
      File "/usr/lib/python2.7/site-packages/adal/authentication_context.py", line 179, in acquire_token_with_client_credentials
        return self._acquire_token(token_func)
      File "/usr/lib/python2.7/site-packages/adal/authentication_context.py", line 128, in _acquire_token
        return token_func(self)
      File "/usr/lib/python2.7/site-packages/adal/authentication_context.py", line 177, in token_func
        return token_request.get_token_with_client_credentials(client_secret)
      File "/usr/lib/python2.7/site-packages/adal/token_request.py", line 315, in get_token_with_client_credentials
        token = self._oauth_get_token(oauth_parameters)
      File "/usr/lib/python2.7/site-packages/adal/token_request.py", line 113, in _oauth_get_token
        return client.get_token(oauth_parameters)
      File "/usr/lib/python2.7/site-packages/adal/oauth2_client.py", line 289, in get_token
        raise AdalError(return_error_string, error_response)
    adal.adal_error.AdalError: Get Token request returned http error: 400 and server response: {"error":"unauthorized_client","error_description":"AADSTS70001: Application with identifier 'xxxx-xxxx-xxxx-xxxx-xxxx' was not found in the directory xxxx-xxxx-xxxx-xxxx-xxxx\r\nTrace ID: xxxx-xxxx-xxxx-xxxx-xxxx\r\nCorrelation ID: xxxx-xxxx-xxxx-xxxx-xxxx\r\nTimestamp: 2018-07-16 02:24:46Z","error_codes":[70001],"timestamp":"2018-07-16 02:24:46Z","trace_id":"xxxx-xxxx-xxxx-xxxx-xxxx","correlation_id":"xxxx-xxxx-xxxx-xxxx-xxxx"}


    • Edited by Swikruti Bose Monday, July 16, 2018 4:17 AM Edited PII data
    • Moved by Swikruti Bose Monday, July 16, 2018 7:05 AM Better suited here than API Management
    Monday, July 16, 2018 2:25 AM

All replies