Using the JavaScript SDK in preview

Category: azure time series insights


dtwaydd on Wed, 06 Feb 2019 17:25:58

I have been trying to use the JS SDK with a TSI preview service.

When trying to query the service I get a error 400 (Bad Request) message.

I think the problem as to do with the api version. The documentation states that preview requires  api-version=2018-11-01-preview, however the JS SDK doesn't let me choose the version and defaults to version 2016-12-12. Is this the problem?

Is there a workaround for this?

Thankyou in advance


Alberto Vega (Azure) on Mon, 11 Feb 2019 21:41:19

Hi is it possible for you to share some code? Have you checked the Sample Application on the docs Tutorial: Explore the Azure Time Series Insights JavaScript client library

dtwaydd on Wed, 13 Feb 2019 09:38:44


We have resolved this issue. The tutorial does not give documentation for the preview calls.

That tutorial is specifically for the GA version. After much digging we were able to find the correct calls for the preview version. These are substantially different from what is shown in the tutorial.

We will prepare a couple of indications of how we solved the issue and publish them on this thread so that anyone that comes next can get it working quickly. 

Alberto Vega (Azure) on Wed, 20 Feb 2019 18:12:15

Thanks for the update and if you could share how you solved the issue that would be great :) 

dtwaydd on Fri, 22 Feb 2019 09:57:00


Apologies for the delay.

Since there was no indication of the library calls we need to do in order to use the preview SKU with the JS library, we searched the Service REST API for preview to find the differences between the GA and preview functions.

Preview API documentation

After knowing the functions, we searched in the JS library for these calls, then followed the flow to get to the main method in the library for what we wanted to do.

Git hub source for the SDK library

 It was a tedious job, but we couldn't find any other way to do this.