Closed gabog closed 5 years ago
I think the key here might be Powershell having different escape characters. I usually use command prompt. I'll try it out and see if I can repro.
I am able to repro. It works correctly in command prompt and gives the error in PS. I tried the string several different ways and haven’t gotten it working yet in PowerShell.
K, thanks, it does also work for me from command prompt (I normally use PS).
Regarding PS, I tried the PS option (with variables) and I get "Missing URL" (probably something with the quotes also)
This issue provides a workaround for PS #191
I'll add this to known issues in the meantime.
Mentioned workaround didn't work for me. After messing with this for a few hours I've found the working solution:
msbot connect generic --bot MyBot.bot --url https://westeurope.api.cognitive.microsoft.com --keys '{\"subscriptionKey\":\"some_key\"}' --name Name
Json should be wrapped in ''
and all properties should have ""
properly escaped with \
and no spaces in JSON if used from cmd
This works for me in PowerShell:
msbot connect generic --name Authentication --url portal.azure.com --% --keys "{\"O365\":\"Azure Active Directory v2\"}"
Project Virtual Assistant
Description Hi, I am trying to add the AAD connection to my bot file from powershell and I am getting "SyntaxError: Unexpected token \ in JSON at position 1".
I am running the following command (that I copied and pasted from https://github.com/Microsoft/AI/blob/master/solutions/Virtual-Assistant/docs/virtualassistant-createvirtualassistant.md and just updated the connection name)
To Reproduce
Expected behavior I would like to be able to add the connection from the command line as described in the documentation.
Additional context As a workaround, I manually edited the bot file and added the following json fragment:
Is this a bug? or am I doing something wrong?