Reputation: 11
I am trying to pull some data from the TSI for a defined time period using python. I would like to do this with the help of access tokens generated for security purposes. Can you help me with how to start this process.
@ranah
Upvotes: 0
Views: 109
Reputation: 727
How you'll do this will depend on whether or not you want to authenticate a user, a Service principal / application, or via the device code option. Take a look at the Python sample for obtaining an AAD token here. If it's a user that will be accessing the data within TSI then the user should be granted either the Reader or Contributor role. If the app will be calling the API as itself then you'll grant the AAD app a role on the TSI instance just like you would for the user. In the sample code, replace the value for the resource URI with "https://api.timeseries.azure.com/" The trailing slash is needed. Once you have an AAD token you can then make calls to TSI's APIs for events, series, aggregates and model metadata. Useful links: https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad https://learn.microsoft.com/en-us/azure/time-series-insights/time-series-insights-authentication-and-authorization#service-principal
Upvotes: 0