Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8860499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:16:45+00:00 2026-06-14T15:16:45+00:00

If an Azure site’s application pool shuts down due to Rapid Fail Protection is

  • 0

If an Azure site’s application pool shuts down due to Rapid Fail Protection is it possible to restart it again automatically?

This question asks pretty much the same question but not related to azure
ASP.NET application pool shutdown problem

Possibly using a WebRole to monitor and some adaption of the code on this page Is it possible to restart IIS on a Azure web role without restarting the process?

var mgr = new ServerManager();
var azurePools = mgr.ApplicationPools.Where(p => Guid.TryParse(p.Name));
azurePools.ToList().ForEach(p => p.Recycle());
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:16:46+00:00Added an answer on June 14, 2026 at 3:16 pm

    You can run the following script from a startup task (make sure you create an elevated background task):

    Timeout= 30000
    set events = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecNotificationQuery("select * from __instancecreationevent where targetinstance isa 'Win32_NTLogEvent' and TargetInstance.LogFile='System' and TargetInstance.EventCode=5002") 
    Do
        WScript.Echo "==========================================================================="
        WScript.Echo "Listening for IIS Rapid Fail Protection Events"
        Set objLatestEvent = events.NextEvent
        Wscript.Echo objLatestEvent.TargetInstance.Message
        ' get the AppPool name from the Eventlog message
        appPool = objLatestEvent.TargetInstance.InsertionStrings(0)
        WScript.Echo "Restarting Application Pool '" & appPool & "' in " & Timeout & " milliseconds"
        WScript.Sleep(Timeout)
        'construct ADSI path to failed AppPool and start by setting AppPoolCommand to 1
        set pool = GetObject("IIS://localhost/w3svc/AppPools/" & appPool)
        pool.AppPoolCommand = 1
        pool.SetInfo
        WScript.Echo "AppPool " & appPool & " restarted"
        WScript.Echo "==========================================================================="
        WScript.Echo
    Loop
    

    Using WMI it will listen for IIS RFP events. This is done by combining ExecNotificationQuery with NextEvent. The call to NextEvent will block until a new event arrives. When this happens, the script waits 30sec and restarts the application pool.

    Anyways, if RFP kicks in it might be more appropriate to see why your process is crashing over and over again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I deploy my web application to an Azure Web Site, I am getting
I am running a azure storage program. https://www.windowsazure.com/en-us/develop/nodejs/tutorials/web-site-with-storage/ When I am running the application
I have a Windows Azure site which is deployed to two separate hosted services.
My site is hosted on Azure. I need to programmatically turn off Internet Explorer's
The new Web site instances for Azure appear to be VM's, without all of
Can I deploy an azure application to Staging Environment, using the 1.7 SDK, if
I have an ASP.NET MVC 4 site running perfectly well in an Azure WebRole.
I am working on an Azure project. To secure this site, I wanted to
I have a Azure Web Site that is linked with a Git Repository (in
I'm trying to implement storing an Azure web site's Themes in the Azure CDN.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.