Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't my Gmail user/password work when deploying ASP.NET to Compute Engine inside Visual Studio?

Tags:

I created a Compute Engine VM using the ASP.NET Cloud Launcher, and now I want to deploy to it from Visual Studio.

I've created a publish settings file using the Visual Studio extension then tried to deploy using the regular Visual Studio "Publish" command. The settings didn't contain a user name and password, so I used my Gmail/Google credentials - this is a Compute Engine instance that my account has access to, after all:

Publish dialog

This failed with the following error:

Web deployment task failed. (Connected to the remote computer ("(redacted)") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.)

If that's not the user name and password to use, what is?

like image 246
Jon Skeet Avatar asked Aug 22 '16 11:08

Jon Skeet


1 Answers

The Compute Engine instance doesn't know about your Google user at all - it only knows about regular Windows accounts, and you don't have a Windows account on it. So, you need to create a Windows account on the instance, and then put that into the publish settings.

In the Google Cloud Explorer, select the instance and choose "Create or Reset Password":

Create or reset account

You can then choose whatever username you like - I'd suggest "aspnet" for simplicity, for example. Note that this username is a normal Windows account on the machine - it's not specific to your Google user. If you're sharing this machine with others for development, you should agree on a set of account names, either securely sharing credentials for a single account, or creating a separate account per developer. You don't want to reset the password for an account a colleague is using!

This account can also be used to open a Terminal Server session with the Compute Engine instance.

Wait until the user has been created with a password, then copy the password:

Copy password

You can now put that into your Publish Settings and let Visual Studio save the password - and keep a copy in a separate secure location, should you wish, of course.

like image 67
Jon Skeet Avatar answered Sep 20 '22 14:09

Jon Skeet