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:
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?
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":
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With