Skip to content

My Windows Azure Web Deploy Stopped Working Because My Certificate Expired

Updated: at 02:12 PM

This is one of those things that you do once every year or so and it is very easy to forget how to do it the next time. I’d almost prefer my Cert’s to expire every week so I get in the swing of fixing it (just kidding).

So, I tried do a web deploy to my Windows Azure Instance this morning and I got a cryptic error that I blogged about here:  http://social.msdn.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/3b1b6204-2a5f-4fe0-aebc-5245edf46c82

It looks something like this:

 

Error 1 Web deployment task failed.(Remote agent 
(URL https://xxx.cloudapp.net:8172/MsDeploy.axd?site=Web_IN_0_Web) could not be
contacted. Make sure the remote agent service is installed and started on the target computer.)
Make sure the site name, user name, and password are correct. If the issue is not resolved,
please contact your local or server administrator.
Error details:
Remote agent (URL https://xxx.cloudapp.net:8172/MsDeploy.axd?site=Web_IN_0_Web)
could not be contacted. Make sure the remote agent service is
installed and started on the target computer.
An unsupported response was received. The response header 'MSDeploy.Response' was
'' but 'v1' was expected.
The remote server returned an error: (401) Unauthorized.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets 3847 5 Web
They key is really one word.  (401) Unauthorized.  The rest is just confusing.  What tipped me off is that I tried to remote into the session with RDP and I got an error that says “username password expired”.
 
So, here are the steps to re-up your password expiration.  I got this from the post here: 
 
http://msdn.microsoft.com/en-us/library/gg443832.aspx
 

 
Here we go.
 
First, right click on your azure project and choose publish.
 
image
 
Then, choose “Configure Remote Desktop connections”.
 
image
 
From there, make sure “Enable connections for all roles” is checked, then choose the bottom choice “Create”.
 
image
 
Give your cert a new name.
 
image
 
 
Make sure you set the expiration date far in the future.
 
image
 
Don’t press OK!!! instead, click on the “View button next to your new cert in the dialog above
 
image
 
Select the button “CopyToFile”
 
Make sure you say “Yes, export the private key in the next dialog”.
 
image
 
Take the default for the next choice.
 
image
 
Retype in your password from the dialog 4 back.
 
image
 
Finally, give it a filename where you want to export your cert.
 
image
 
Press Finish.
 
image
 
You get rewared wih…
 
image
 
Press OK to the next message
 
image
 
And now, you can deploy your package!!!
 
(and, don’t forget to update your certificate into your windows azure portal and delete the old one)
 
image
 
Clear as mud, right?
 
I wonder if this is so hard on mac’s.?
 
 
 
 
Check out the ORM (Object Relational Mapper) PRISMA. The database access method I use in all my projects