VSCode extension fails to connect without giving reason

Product: PowerShell Universal
Version: 2.10.2

Settings.json

I removed the powerShellUniversal.url and samplesdirectory to put them in Connections with the same results. This isn’t a firewall issue neither as I can access the dashboard from my browser and log in. Any suggested way to troubleshoot?

image

In case it helps, here’s how a working settings.json appears on my end.

{
    "powerShellUniversal.samplesDirectory": "C:\\Users\\username\\AppData\\Roaming",
    "powerShellUniversal.appToken": "eyJhb..........",
    "powerShellUniversal.url": "http://192.168.1.1:5000",
    "powerShellUniversal.connections": [
    ],
}

Thanks for the quick troubleshoot, the problem persists so I assume nothing should be wrong with the json. For the app token I’m using the following:

The Identity is Admin and it’s default created token. How to proceed to find where the problem persists?

BTW my PSU is installed in a remote host, a cloud-hosted Linux, while in my localhost I only have VSCode extension for PSU. Is that the problem? Do I need PSU in my localhost too?

@adam I can’t remember, is a developer/enterprise license required this type of remote/authentication workflow? OP’s screenshot shows the instance is unlicensed, was wondering if that would prevent VSCode extension from working with a remotely hosted PSU instance.

The VS Code extension works with unlicensed instances so that shouldn’t be the problem.

One thing I would suggest would be to try and created a new app token with just the Administrator role to see if that changes the behavior.

The other thing you can do is see if there are any errors in VS Code. The Extension Host log may have an error thrown by the PSU extension with more info.

1 Like

@aaarkid , Have you tried Connect-PSUServer from the command line? Trying to connect this way might reveal more about the root cause.

I have what appears to be the same issue, and I have never been able to get this to work. I have copied the known working JSON from above, I have tried to create a token with just Administrator role (it requires Identity too), I have put my server info inside the “powerShellUniversal.connections”: field in the settings.json. I had it partially working at one point, it would load dashboards and configuration, but nothing else. I tried to open a module from the configuration and save it, but it did not update when I went back to the web interface. I did the same with a dashboard, I opened in VSCode and modified, then saved but no change on the actual server.

When I have the extension loaded and configured in VSCode I get lots of the loading bars and periodic standard error messages: Failed to query jobs. Request failed with status code 404 This is a connection error. Click Settings to adjust your connection settings or App Tokens to generate a new token.

Do I have to have Powershell Universal running on my localhost for it to work? Because I could do that with a developer license and then I guess copy paste into the web console for putting it into production.