开发者

How to have Azure web role application pool start under right user from the beginning?

开发者 https://www.devze.com 2023-03-16 22:59 出处:网络
I need the application pool in my Azure web role to run under a specific user. There\'s this code that restarts the application pool - I run it from OnStart() in my RoleEntryPoint descendant and it wo

I need the application pool in my Azure web role to run under a specific user. There's this code that restarts the application pool - I run it from OnStart() in my RoleEntryPoint descendant and it works fine.

However restarting is not so good - the pool first starts under the default user (Network service), is t开发者_运维知识库hen stopped and started again under the right user. First, it takes some time and I'd like my web role to start as fast as possible. Second, when I do that on Compute Emulator the debugger will detach from the IIS worker process once the application pool stops (and the process terminates) and I have to manually reattach the debugger to the newly started IIS worker process.

Is there a way to have the web role application pool started under the right user from the very beginning?


Maybe you can script the change in a startup task with appcmd?

Note that you'd have to change the default settings for all app pools, since the specific app pool you're going to run under hasn't been created yet at the time when startup tasks execute.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号