Azure-Samples / Azure-Time-Series-Insights

Sample modules written in different languages that can be used as templates for applications needing to query Time Series Insights
MIT License
21 stars 31 forks source link

Guidance on obtaining access tokens via MSAL (.NET) #26

Closed marxxxx closed 3 years ago

marxxxx commented 3 years ago

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Expected/desired behavior

Please provide guidance on how to use MSAL.NET to get an access token for Time Series Insights. I can get it to work using a Postman by passing https://api.timeseries.azure.com/ as resource but using MSAL i can only get an access token by passing https://api.timeseries.azure.com/.default as scope (as documented here.

However, the obtained token is denied by TSI (Microsoft.Azure.TimeSeriesInsights.Models.TsiErrorException: Operation returned an invalid status code 'Unauthorized').