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

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

    /usr/lib/python2.7/site-packages/urllib3/ InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See:
    Traceback (most recent call last):
      File "", line 1, in <module>
        from azure import *
      File "/root/python/azure/Azure-python/", line 25, in <module>
      File "/usr/lib/python2.7/site-packages/adal/", line 179, in acquire_token_with_client_credentials
        return self._acquire_token(token_func)
      File "/usr/lib/python2.7/site-packages/adal/", line 128, in _acquire_token
        return token_func(self)
      File "/usr/lib/python2.7/site-packages/adal/", line 177, in token_func
        return token_request.get_token_with_client_credentials(client_secret)
      File "/usr/lib/python2.7/site-packages/adal/", line 315, in get_token_with_client_credentials
        token = self._oauth_get_token(oauth_parameters)
      File "/usr/lib/python2.7/site-packages/adal/", line 113, in _oauth_get_token
        return client.get_token(oauth_parameters)
      File "/usr/lib/python2.7/site-packages/adal/", 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