I'm trying to query data from Azure Time Series Insights Preview using JavaScript and the tsiclient library. My code follows the format from the github documentation but when I push the query, I get the 500 'internal service error' POST error.
My code:
var data = [];
data.push(new tsiClient.ux.TsqExpression(
// instanceObject
{
timeSeriesId: ['CSIRO_Density-SC503_DPV']
},
// variableObject
{
rawdata: {
kind: 'numeric',
value: {
tsx: 'rawdata.value'
},
filter: null,
aggregation: null
}
},
// searchSpan
{
from: startDate,
to: endDate,
bucketSize: '5m'
},
// color
'#60B9AE',
// alias
'Tag_Values',
// contextMenu
null
));
authContext.getTsiToken().then(function(token) {
tsiClient.server.getTsqResults(
token,
environmentFqdn,
data.map(ae => ae.toTsq())).then(function(result) {
console.log(result);
});
});
Does anyone have any experience with this?
Edit - full response:
code: "InternalServerError"
message: "Internal server error. Please retry your request later."
Last edit! I figured out the problem - a syntax error on the variable object:
'rawdata.value'
Should have been
'$event.[value]'