Website not working in azure locally

EDIT: Running Visual Studio as Administrator fixes the issue below, but can anyone explain why I need to Run as Administrator to run the website in the Azure Emulator?

We are in the process of migrating our site to Windows Azure, I created a cloud service and added the site as a web role, and when I try to start the cloud services project in debug, it won't start and in the output:

The program '[12396] WaIISHost.exe' has exited with code 0 (0x0).

      

And in the bottom left corner it says "Operation canceled". I don't seem to see any reason why this is happening, if I create an empty asp.net mvc website, it works fine, so there must be something in our application that makes it bomb like this, does anyone know how to track this issue?

I only get a second to see the output of the emulator, but it says:

[fabric] Role Instance: deployment24(29).xxx.Web.0
[fabric] Role state Busy
[fabric] Role state Unhealthy
[fabric] Role state Stopped

      

I found the following entries in the waHostBootstrapper.log file

[00005740:00008088, 2014/09/13, 15:57:43.320, ERROR] <- WapXmlReadRoleModel=0x1
[00005740:00008088, 2014/09/13, 15:57:43.324, ERROR] <- GetDebugger=0x1
[00005740:00008088, 2014/09/13, 15:57:43.324, ERROR] <- GetStartupTaskDebugger=0x1
[00005740:00008088, 2014/09/13, 15:57:43.324, ERROR] <- WapGetEnvironmentVariable=0x800700cb
[00005740:00008088, 2014/09/13, 15:57:43.324, ERROR] <- WapGetEnvironmentVariable=0x800700cb
[00005740:00008088, 2014/09/13, 15:57:43.324, INFO ] Executing Startup Task type=2 rolemodule=Diagnostics cmd="E:\xxx\Diagnostics\DiagnosticsAgent.exe" 
[00005740:00008088, 2014/09/13, 15:57:43.325, INFO ] Executing "E:\xxx\Diagnostics\DiagnosticsAgent.exe" .
[00005740:00008088, 2014/09/13, 15:57:43.334, ERROR] <- WapGetEnvironmentVariable=0x800700cb
[00005740:00008088, 2014/09/13, 15:57:43.335, ERROR] <- WapGetEnvironmentVariable=0x800700cb
[00005740:00008088, 2014/09/13, 15:57:43.335, INFO ] Executing Startup Task type=0 rolemodule=Diagnostics cmd="E:\xxx\Diagnostics\DiagnosticsAgent.exe" /blockStartup
[00005740:00008088, 2014/09/13, 15:57:43.335, INFO ] Executing "E:\xxx\DiagnosticsAgent.exe" /blockStartup.
[00005740:00002464, 2014/09/13, 15:57:43.480, INFO ] Registering client with PID 13152.
[00005740:00002464, 2014/09/13, 15:57:43.480, INFO ] Client DiagnosticsAgent.exe (13152) registered.
[00005740:00002464, 2014/09/13, 15:57:43.493, INFO ] Registering client with PID 11656.
[00005740:00002464, 2014/09/13, 15:57:43.493, INFO ] Client DiagnosticsAgent.exe (11656) registered.
[00005740:00008088, 2014/09/13, 15:57:43.564, INFO ] Program "E:\xxx\Diagnostics\DiagnosticsAgent.exe" /blockStartup exited with 0. Working Directory = E:\xxx\plugins\Diagnostics
[00005740:00008088, 2014/09/13, 15:57:43.564, INFO ] Executing "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Windows Azure Tools\v2.4\Debugger\WindowsAzureDebugger.exe" base\x64\WaIISHost.exe .
[00005740:00008088, 2014/09/13, 15:57:43.565, INFO ] Role host process PID: 5456.
[00005740:00002464, 2014/09/13, 15:57:43.742, INFO ] Registering client with PID 16360.
[00005740:00002464, 2014/09/13, 15:57:43.742, INFO ] Client WaIISHost.exe (16360) registered.
[00005740:00002464, 2014/09/13, 15:57:43.742, INFO ] Client process WaIISHost.exe is the role host.
[00005740:00002464, 2014/09/13, 15:57:43.742, INFO ] Role host process registered.
[00005740:00008572, 2014/09/13, 15:57:43.820, INFO ] Getting status from client DiagnosticsAgent.exe (13152).
[00005740:00008572, 2014/09/13, 15:57:43.820, ERROR] Failed to connect to client DiagnosticsAgent.exe (13152).
[00005740:00008572, 2014/09/13, 15:57:43.820, ERROR] <- CRuntimeClient::OnRoleStatusCallback(0x0000000E8AE90C90) =0x800706ba
[00005740:00008572, 2014/09/13, 15:57:43.820, INFO ] Removing disconnected client: DiagnosticsAgent.exe (13152).
[00005740:00008572, 2014/09/13, 15:57:43.820, INFO ] Getting status from client DiagnosticsAgent.exe (11656).
[00005740:00008572, 2014/09/13, 15:57:43.826, INFO ] Client reported status 0.
[00005740:00008572, 2014/09/13, 15:57:43.826, INFO ] Getting status from client WaIISHost.exe (16360).
[00005740:00008572, 2014/09/13, 15:57:43.826, INFO ] Client reported status 1.
[00005740:00008572, 2014/09/13, 15:57:44.327, INFO ] Getting status from client DiagnosticsAgent.exe (11656).
[00005740:00008572, 2014/09/13, 15:57:44.331, INFO ] Client reported status 0.
[00005740:00008572, 2014/09/13, 15:57:44.331, INFO ] Getting status from client WaIISHost.exe (16360).
[00005740:00008572, 2014/09/13, 15:57:44.331, INFO ] Client reported status 1.
[00005740:00008572, 2014/09/13, 15:57:44.833, INFO ] Getting status from client DiagnosticsAgent.exe (11656).
[00005740:00008572, 2014/09/13, 15:57:44.842, INFO ] Client reported status 0.
[00005740:00008572, 2014/09/13, 15:57:44.842, INFO ] Getting status from client WaIISHost.exe (16360).
[00005740:00008572, 2014/09/13, 15:57:44.842, ERROR] Failed to connect to client WaIISHost.exe (16360).
[00005740:00008572, 2014/09/13, 15:57:44.842, ERROR] <- CRuntimeClient::OnRoleStatusCallback(0x0000000E8AE90CF0) =0x800706ba
[00005740:00008572, 2014/09/13, 15:57:44.842, INFO ] Client process WaIISHost.exe is the role host.
[00005740:00008572, 2014/09/13, 15:57:44.842, WARN ] Failed to contact the role host process. Treat role as unhealthy.
[00005740:00017556, 2014/09/13, 15:57:45.295, INFO ] Sending shutdown notification to client DiagnosticsAgent.exe (11656).
[00005740:00017556, 2014/09/13, 15:57:45.301, INFO ] Sending shutdown notification to client WaIISHost.exe (16360).
[00005740:00017556, 2014/09/13, 15:57:45.302, ERROR] Failed to connect to client WaIISHost.exe (16360).
[00005740:00017556, 2014/09/13, 15:57:45.302, ERROR] <- CRuntimeClient::OnRoleShutdownCallback(0x0000000E8AE90CF0) =0x800706ba

      

Viewing logs in the \ AppData \ Local \ dftmp \ Resources {guid} \ directory \ DiagnosticStore folder in the WaIISHost.log file there are errors:

WaIISHost Information: 0: [00006516: 00000001, 2014/09/14 06: 43: 23.994, ERROR] Exception: System.ServiceModel.FaultException`1 [System.ServiceModel.ExceptionDetail]: An attempt was made to perform an unauthorized operation. (Fault Detail is ExceptionDetail, probably thrown by IncludeExceptionDetailInFaults = true, whose value is: System.UnauthorizedAccessException: An attempt was made to perform an unauthorized operation. In System.Security.AccessControl.Win32.SetSecurityInfo (type ResourceType, string name, securityIn descriptor, securityInosHandle SecurityIdentifier, SecurityIdentifier group, GenericAcl sacl, GenericAcl dacl)

+3


source to share


1 answer


The emulator needs administrator privileges to perform several of its tasks. It must control IIS, it must (often) open ports below 1024, and it must have control privileges for worker processes. Since Visual Studio spawns and controls it, this means Visual Studio also needs these privileges.

There is now an Express Emulator option that mitigates this, but you are limited to one instance per role and must allow IIS to use a random high port. Instructions for using Express Emulator mode can be found at http://msdn.microsoft.com/en-us/library/azure/dn339018.aspx .



This similar question also provides additional information: Windows Azure Emulator without Administrator Rights

+2


source







All Articles