Declaring LightSwitch Azure Tools Certificate Bankruptcy

We have seen some forum posts very recently where folks aren’t able to publish to Azure because of an error like this:

image

In response to this I have been messing around with things this afternoon and I think I have come up with a set of steps to get users out of this mess.  The way that I can repro getting into this situation is if I have published my project successfully to Azure (at some point) and then I remove the Azure Management Certificate from my Personal Certificate Store:

image

And have removed the subscription from the list of subscriptions that VS is keeping track of:

image

In this case, if I launch the Publish Wizard we will see that there is no Subscription entry that matches what we are tracking in the lsxproj and lsxproj.user and we create one, this one still won’t work, however, because we still don’t have the backing certificate (here’s what this entry looks like)

image

 

Now there are likely other ways to get into the situation, but this is how I got into it.  Here is how I can get out:

1. In "Server Explorer", right-click on "Windows Azure" and select Manage Subscriptions

clip_image001

2. In the "Manage Windows Azure Subscriptions" window, use the Delete button to remove all stored subscriptions.  Then Close the window.

image

3. In the Server Explorer, Right-click on "Windows Azure" and this time select Import Subscriptions

image

4. First, Download subscription file, (you may need to enter your Azure credentials at this time).  Browseto the location that you saved the file, then hit Import

clip_image002

Now attempt to launch the LightSwitch publish wizard again.  What should have happened is that a new Subscription Entry was created (for VS) and the certificate was re-imported into the Personal Certificate Store.

This worked for me, I hope it works for you as well.