title: AADSTS65005: Invalid resource. (Azure Time Series Insights API)
body: <p>I'm trying to obtain an authorization code and token to access a time series environment.</p>
  
  <p>I created an application in Azure Active Directory and gave it access to the time series environment by following the instructions in this <a href="https://docs.microsoft.com/en-us/azure/time-series-insights/time-series-insights-authentication-and-authorization" rel="nofollow noreferrer">link</a>. After that I got my client_id (Application Id) , client_secret (Application Key) and my tenant id.</p>
  
  <p>Then I tried to follow the instructions in this <a href="https://docs.microsoft.com/pt-pt/azure/active-directory/develop/active-directory-protocols-oauth-code#request-an-authorization-code" rel="nofollow noreferrer">link</a> and I'm trying to obtain the authentication code for the resource "<a href="https://api.timeseries.azure.com/" rel="nofollow noreferrer">https://api.timeseries.azure.com/</a>" in my browser. The address that I insert in my browser is something like this:</p>
  
  <pre><code>https://login.microsoftonline.com/{tenant}/oauth2/authorize?client_id={client_id}&amp;response_type=code&amp;redirect_uri=http%3A%2F%2Flocalhost%2F&amp;response_mode=query&amp;resource=https%3A%2F%2Fapi.timeseries.azure.com%2F&amp;state=12345
  </code></pre>
  
  <p>I tripled checked the values and it seems to me that everything is correct, but I keep getting the following error in my browser:</p>
  
  <pre><code>AADSTS65005: Invalid resource. The client has requested access to a resource 
  which is not listed in the requested permissions in the client's application 
  registration. Client app ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. Resource 
  value from request: https://api.timeseries.azure.com/. Resource app ID: 
  xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. List of valid resources from app 
  registration: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
  </code></pre>
  
  <p>Thanks for any help.</p>