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

Retrieves the details and current state of an Azure App Service web application. Useful for checking whether an app is running before deciding to start, stop, or restart it.

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 retrieve. For example, `"my-web-app"`.                                                                                                                            |
| `selectors`         | List   | **Optional.** JQ selectors to extract specific values from the response. For example, `[{"name": "appState", "expression": ".response.properties.state"}]`.                                                    |

## 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 response body containing the App Service details, including `name`, `type`, `kind`, `location`, and `properties` (with `state`, `hostNames`, `enabled`, and more). For full schema, see [Web Apps - Get](https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/get). |
| `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: getAzureAppService
description: Get the current state of an Azure App Service
steps:
  - name: get_app_service
    type: action
    action: azure.appService.get
    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"
      selectors:
        - name: appState
          expression: ".response.properties.state"
    next: end
```
