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

This page provides a reference for Azure App Service actions available in the workflow automation actions catalog. These actions let you get, list, start, stop, and restart Azure App Service web applications directly from a workflow definition, enabling operational workflows such as scheduled shutdowns for cost control, incident-triggered restarts, and pre-flight checks before a deploy step.

## Prerequisites

Before using Azure App Service actions in workflow automation, ensure you have:

-   An Azure subscription with one or more App Services.
-   An Entra (Azure AD) app registration (service principal) with the required permissions.
-   The app registration credentials stored in the New Relic Secrets Service.

## Set up Entra authentication

Azure App Service actions authenticate using an Entra (Azure AD) service-principal client-credentials OAuth2 flow. The required permissions depend on the action:

-   **Reader** role — required for `azure.appService.get` and `azure.appService.list`.
-   **Contributor** (or **Website Contributor** for least privilege) — required for `azure.appService.start`, `azure.appService.stop`, and `azure.appService.restart`.

### Create an Entra app registration

1.  In the Azure portal, go to **Microsoft Entra ID > App registrations** and click **New registration**.
2.  Give the registration a name and click **Register**.
3.  Note the **Application (client) ID** and **Directory (tenant) ID** — you'll need these as inputs.
4.  Under **Certificates & secrets**, create a new client secret and copy the value immediately.

    For full instructions, see [Register an app to get authentication tokens](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/api/register-app-for-token).

### Assign the required role

Assign the app registration the **Reader** role (for get/list) or **Contributor** / **Website Contributor** role (for start/stop/restart) scoped to the target App Service or resource group.

1.  In the Azure portal, navigate to the target resource group or App Service.
2.  Go to **Access control (IAM) > Add role assignment**.
3.  Select the appropriate role and assign it to the app registration.

### Store credentials as secrets

Store the `clientId`, `clientSecret`, and `tenantId` in the New Relic Secrets Service and reference them in your workflow YAML using the `${{ :secrets:keyName }}` syntax:

````yaml
clientId: ${{ :secrets:azure-client-id }}
clientSecret: ${{ :secrets:azure-client-secret }}
tenantId: ${{ :secrets:azure-client-tenant }}
```

````

## Available Azure App Service actions

The following table lists the available Azure App Service actions and links to their reference pages.

| Action name                                                                                                                                               | Description                                                                      |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| [**Get an Azure App Service**](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. |
| [**List Azure App Services**](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/azure/azure-appservice-list)         | Lists Azure App Service web applications in a resource group.                    |
| [**Start an Azure App Service**](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/azure/azure-appservice-start)     | Starts a stopped Azure App Service web application.                              |
| [**Stop an Azure App Service**](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/azure/azure-appservice-stop)       | Stops a running Azure App Service web application.                               |
| [**Restart an Azure App Service**](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/azure/azure-appservice-restart) | Restarts an Azure App Service web application.                                   |
