在Azure Web应用程序上使用AppCmd.exe配置SignalR

时间:2017-01-01 11:42:33

标签: signalr azure-web-sites

您是否可以提供有关如何使用SignalR在Azure网络应用中运行AppCmd的更多详细信息,因为它需要管理员权限?我不认为下面的内容会因此而起作用。

protected void Application_Start()
        try
        {
            var windowsDir = Environment.GetEnvironmentVariable("windir");
            var command = System.IO.Path.Combine(windowsDir, @"System32\inetsrv\appcmd.exe set config / section:system.webserver / serverRuntime / appConcurrentRequestLimit:10000");
            Process.Start(command);
        }
        catch (Exception ex)
        {
            Trace.WriteLine(ex.GetBaseException().Message);
        }
}

1 个答案:

答案 0 :(得分:0)

Azure网络应用程序在sandbox中运行。我们无权编写系统驱动器。

  

系统驱动器访问

     

应用程序可以读取驱动器上的ACL控制的系统驱动器。应用程序无法写入系统驱动器上的任何位置,如沙箱中实现的那样(即,即使ACL允许写入系统驱动器上的某个位置,沙箱也会限制它)。

但是,如果您选择Azure云服务,我们可以使用appcmd.exe in startup task。当然,如果选择Azure VM作为Web服务器,它将像魅力一样工作。

相关问题