6

I have been using Visual Studio to deploy a Web Service to Azure; downloaded my publish profile to enable that and it was working fine for the past few weeks.

Today I tried to deploy an update and now all my deployments fail with the following:

17:25:03 - Preparing deployment for WindowsAzure1 - 25/03/2013 17:24:53 with Subscription ID 'xxx' using Service Management URL 'https://management.core.windows.net/'...
17:25:03 - Connecting...
17:25:04 - Object reference not set to an instance of an object.
17:25:04 - Deployment failed with a fatal error

I'm not sure what's failing here; is this saying it's unable to connect to the Service Management URL?

Last week I installed an SSL certificate on Azure and now I'm not seeing the option to download my publish settings. I know it used to be there but isn't now. Does having an SSL prevent me from somehow connecting to the management page?

Edit
Before leaving work I removed the certificate but when I then checked for the PublishProfile it was still not showing.

The PublishProfile is not available for any of the other users attached to the subscription - so I don't think it's related to my login.

Edit 2
A bit more drastic; I've now tried deleting my storage and service, to start from scratch. I created a new publishsettings file by removing the subscriptions already imported into Visual Studio and then following the link to "Sign in to download credentials". Next I created a new service and storage in Azure and tried to publish but the deployment still fails when connecting with

Object reference not set to an instance of an object

I have no idea what else I could try or what could be wrong, or where to look to find out.

Simon Martin
  • 4,203
  • 7
  • 56
  • 93

5 Answers5

4

I got the same error today. Why it wasn't working was because I hadn't uploaded the certificate in the managementportal prior to the publish.

After adding the certificate, everything worked just fine!

You can read more here: http://www.amido.co.uk/mark-omahoney/publishing-in-windows-azure-object-reference-not-set-to-an-instance-of-an-object/

Fore
  • 5,726
  • 7
  • 22
  • 35
2

The best way to solve above problem is to download the latest PublishSettings from Azure Management Portal and then use it with Visual Studio. This way your connection to Windows Azure Management Portal from local machine will be verified and validated. Once you have the basic connection working then you can publish your application to specific Windows Azure Service.

Also you can log into your Azure Management Portal and remove all old management certificates which are added in previous publishsettings download attempts.

AvkashChauhan
  • 20,495
  • 3
  • 34
  • 65
  • Trouble is I can't see the link to download my PublishSettings in the Azure Management Portal. Previously when I went to the `Cloud Services` Dashboard for my service I could get to the Publish Settings; now I just see an option (under "quick glance") to "Set up TFS publishing. – Simon Martin Mar 25 '13 at 22:30
  • The easiest way to download PublishSettings file is to install Azure Powershell first and then run PS command Get-AzurePublishSettingsFile which will launch browser with management portal and once login you can download & save it. – AvkashChauhan Mar 25 '13 at 22:35
  • I have the latest `PublishSettings`, in the Visual Studio publish dialogue I can sign in, pick my subscription, the settings are verified and everything seems fine in the `Summary` but when I press publish and the deployment starts I get failure I mentioned in my question. – Simon Martin Mar 26 '13 at 09:55
1

The problem, in my case, was that my solution Cloud project had the thumbprint of the SSL certificate I'd uploaded in its ServiceDefinition.csdef and ServiceConfiguration.Cloud.cscfg. In my first edit I said that I'd removed the certificate from Azure, but hadn't then removed it from the project files; commenting them out allowed me to publish from Visual Studio again.

I'm not sure why this happened though, I had uploaded the certificate to Azure and was able to connect to my service on https in FireFox so the SSL was "working".

Simon Martin
  • 4,203
  • 7
  • 56
  • 93
0

Web Deploy v3.6 BETA3 was released that fixes this issue. To resolve this error, you can download the Web Deploy beta and patch your VS2013 installation. http://azure.microsoft.com/blog/2014/08/11/web-deploy-3-6-beta-released/

Test Validate Connection once you installed the above Web Deploy. If it works, then fine else you can modify the proxy settings used by msbuild.exe (msbuild.exe.config) and check you can now publish from behind a proxy with Web Deploy.

Regards, Logesh Shan

0

I think the certificate got corrupt. Deleting the solution .suo file and the .ccproj.user file in my Azure project did it for me.

Dirk Boer
  • 8,522
  • 13
  • 63
  • 111