menu

Questions & Answers

Unexpected token in JSON when opening app content downloaded from azure?

I am currently trying to decide on the best tools to use to develop azure functions. (I have successfully developed functions that read information from our Power Bi tenant).

Unfortunately, I do not like developing the functions in the web interface, as I have major issues with this interface and the voice recognition software that I use (Dragon professional 15.6.1).

We are currently developing Power Shell scripts.

So I can then develop scripts, test them and deploy them using visual studio code.

The issue that I am having, is that in azure, you can download the app content but whenever I open that folder in visual studio code, the function reports Error: unexpected token in JSON at position 0

I have now tried this with two different functions (Development functions using PowerShell). Both developed in visual studio code, run locally successfully and they run in Azure as well. However, if app content download, in Azure and load that folder up into visual studio code, it reports the error: unexpected token in JSON at position 0.

I cannot see any invalid characters in any of the JSON files (it is not the usual for Dragon to accidentally hear something and I do not notice).

Yes I need to investigate devops for source control but in the immediate future, I am thinking that visual studio code will only be a suitable tool if we can then download the files from Azure in order to make updates.

Any suggestions.

Thanks Any ideas?

Answers(1) :

visual studio code will only be a suitable tool if we can then download the files from Azure in order to make updates?

VSCode is more user-friendly development tool which offered by Microsoft itself. In this scenario, the issue may cause because of the extra spaces or comma characters.

If any such scenario while parse this as JSON, it will through an exception like this. Please validate the json prior.

Issue may also cause because of missing extension, request to add respective extensions in VSCode Extensions existing reference thread which i found similar to the same, refer for more details.