4b0
4b0

Reputation: 22323

500 - Internal server error in azure

I am using SDK 1.8.I want to deploy a sample site in azure.I have a test account so I don't know I have full privilege or not.When I run a site locally using simulator its run but when I create a package and deploy in azure I got a error:

500 - Internal server error

I found this question with same problem.Its 5 months old with no solution.I include in web.config:

customErrors="Off"

But still same problm.I deploy this as a site with create a package.

I search but never found any solution.May some body face same problem and get a solution.Thanks.

Upvotes: 1

Views: 6508

Answers (3)

d.popov
d.popov

Reputation: 4255

It can be due to various reasons. In my case it was misconfiguration of the LocalWebDevelopmentServer setting. Setting it to IISExpress fixed the problem.enter image description here

Upvotes: 0

Phil Cooper
Phil Cooper

Reputation: 3123

You'll probably want to debug this locally using the compute emulator. Even if your not using it now to get something quick working on the cloud, you'll need it in the future.

One way to help get more descriptive output is to enable detailed error messages rather than the one you're seeing at the moment.

This isn't as easy as enabling custom errors and requires some tinkering with the web role. This article 'Debugging Azure HTTP 500 Errors' explains how to do it, so, in a nutshell:

Create a new folder at the root level of your web role called startup and, within this folder, create a batch file called startup.cmd. Set the properties of this file to Copy Always to ensure that it will be deployed.

Add the following code to the startup.cmd file:

%windir%\system32\inetsrv\AppCmd.exe set config -section:system.webServer/httpErrors -errorMode:Detailed 
%APPCMD% set config -section:system.webServer/httpErrors -errorMode:Detailed

The first line enables detailed error messages on Azure. The second line enables them on the compute emulator.

Next, open the ServiceDefinition.csdef file in your web role project and add the following element:

<Startup>
    <Task commandLine=”..\startup\startup.cmd” executionContext=”elevated” />
</Startup>

Your project will should look something like this (in this example the startup tag is commented out):

enter image description here

If all goes well, you should start seeing more useful and descriptive error messages.

Upvotes: 0

viperguynaz
viperguynaz

Reputation: 12174

Azure websites aren't deployed as packages, you publish from TFS or Visual Studio. Azure WebRoles are deployed to Azure Cloud Services using packages. As recommended in the question you referenced, remove the "sites" element completely. It is over-specified for a simple deployment. See figure 1 here - http://msdn.microsoft.com/en-us/wazplatformtrainingcourse_advancedwebandworkerroles_topic2.aspx

Upvotes: 0

Related Questions