1

I'd like to execute a

appcmd set config /commit:WEBROOT /section:sessionState /mode:StateServer /stateConnectionString: tcpip=loopback:42424 /stateNetworkTimeout: 120 /useHostingIdentity:True

command on the box belonging to an Azure Web App. The console is a "sandbox environment", so I don't necessarily expect to have enough privileges, but appcmd is not recognized as a command.

Same thing happened with the KUDU special console - which looked more promising in terms of potential privileges to carry out the task -, both with the CMD and the PowerShell console.

My main goal is to start the IIS's State Server. How to start ASP.Net State Service in Azure mentions "startup task", but I couldn't figure out how to do that. https://technet.microsoft.com/en-us/library/cc732412(v=ws.10).aspx quotes appcmd.

4

1 回答 1

2

根据您问题中的链接:启动任务适用于云服务中的网络/工作人员角色,而不是网络应用程序(完全不同的事情;网络/工作人员角色实例是 Windows Server 实例,而不是沙盒环境)。

您不能在 Web 应用程序上启用 IIS 状态服务器。您需要将会话状态存储在 Redis 缓存服务之类的东西中,该服务独立于 Azure Web 应用程序运行。实际上,您可以使用 Web App 沙箱外部的任何缓存(或存储),只要您有适合您选择的驱动程序/提供程序。

于 2017-04-05T05:18:16.113 回答