Hi Matt,
You can use Time Series Insights REST API .
See: Access Policies - Overview
Create or update an access policy in the specified environment. Example:
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/environments/env1/accessPolicies/ap1?api-version=2018-08-15-preview
Request Body
{
"properties": {
"principalObjectId": "aGuid",
"roles": [
"Reader"
],
"description": "some description"
}
}
Also a similar question on StackOverflow for your reference: Scripting Azure Time Series Insights Data Access Policies