---
title: Stop an Azure App Service
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/azure/azure-appservice-stop
---

Stops a running Azure App Service web application. Use this action to shut down an app on a schedule, during maintenance, or as part of a cost-control workflow.

For authentication setup, see [Azure App Service actions](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/azure/azure-appservice).

## Inputs

| Input               | Type   | Description                                                                                                                                                                                                    |
| ------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `clientId`          | String | **Required.** An Azure service-principal client ID. See how to [register an Azure app](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/api/register-app-for-token). Must be passed as a secret.     |
| `clientSecret`      | String | **Required.** An Azure service-principal client secret. See how to [register an Azure app](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/api/register-app-for-token). Must be passed as a secret. |
| `tenantId`          | String | **Required.** The Azure tenant identifier. Can be passed as a secret.                                                                                                                                          |
| `subscriptionId`    | String | **Required.** The Azure subscription identifier. For example, `"12345678-1234-1234-1234-123456789abc"`.                                                                                                        |
| `resourceGroupName` | String | **Required.** The name of the resource group that contains the App Service. For example, `"my-resource-group"`.                                                                                                |
| `appServiceName`    | String | **Required.** The name of the App Service to stop. For example, `"my-web-app"`.                                                                                                                                |
| `selectors`         | List   | **Optional.** JQ selectors to extract specific values from the response. For example, `[{"name": "statusCode", "expression": ".response.status_code"}]`.                                                       |

## Outputs

| Output              | Type    | Description                                                                                                                                                                                                            |
| ------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `success`           | Boolean | Indicates whether the action succeeded. Returns `true` or `false`.                                                                                                                                                     |
| `errorMessage`      | String  | Contains the failure reason as a message.                                                                                                                                                                              |
| `response`          | Object  | The Azure API body response. Empty on success — Azure returns a 200 with no body for this operation. For more information, see [Web Apps - Stop](https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/stop). |
| `asyncResponseUrl`  | String  | Optional for long-running operations. The URL to poll for status.                                                                                                                                                      |
| `finalResponseUrl`  | String  | Optional for long-running operations. The URL that returns the final result once the operation completes.                                                                                                              |
| `retryAfterSeconds` | Integer | Optional for long-running operations. The number of seconds to wait before polling the async URL.                                                                                                                      |
| `eTag`              | String  | **Optional.** Used for concurrency control when updating a resource.                                                                                                                                                   |

## Example

```yaml
name: stopAzureAppService
description: Stop a running Azure App Service
steps:
  - name: stop_app_service
    type: action
    action: azure.appService.stop
    version: 1
    inputs:
      clientId: ${{ :secrets:azure-client-id }}
      clientSecret: ${{ :secrets:azure-client-secret }}
      tenantId: ${{ :secrets:azure-client-tenant }}
      subscriptionId: "12345678-1234-1234-1234-123456789abc"
      resourceGroupName: "my-resource-group"
      appServiceName: "my-web-app"
    next: end
```
