How to recycle and App Pool using Microsoft IIS Administration API

Andrew Martin 0 Reputation points
2023-05-26T09:39:55.56+00:00

Dear MS

I have successfully stopped and started App Pools using Microsoft IIS Administration API.

I am struggling to find a way to recycle an App Pool, would you be able to advise?

Kind regards

Andrew

Internet Information Services
{count} votes

1 answer

Sort by: Most helpful
  1. Jerry Fu - MSFT 561 Reputation points Microsoft Vendor
    2023-05-26T13:49:44.44+00:00

    Hi,

    There seems no endpoint for recycle. But there's a workaround.

    You can use 'Patch' at the application pool endpoint (/api/webserver/application-pools/{id}) with a recycling schedule

    {
        "recycling": {
            "periodic_restart": {
                "schedule": [
                    "21:38:45"
                ]
            }
        },
    }
    

    The time format is 24hours hh:mm:ss of current day. After recycled, you can clear the schedule with empty value.

    {
        "recycling": {
            "periodic_restart": {
                "schedule": [
                ]
            }
        },
    }
    
    

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments