---
title: Invoke an Azure Function
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/azure/azure-functions-invoke
---

The Azure Functions Invoke action lets you call any HTTP-triggered Azure Function directly from your workflows. It provides a supported, validated interface for invoking Azure Functions — with typed inputs, URL validation, and secret-backed authentication — rather than constructing raw HTTP calls.

## Invoke an Azure Function [#azure-functions-invoke]

This action sends an HTTP request to an Azure Function endpoint and returns the response. Authentication uses Azure's function key mechanism; the workflow passes it as the `x-functions-key` header.

### Inputs

The following fields configure the Azure Function request.
Input field
Optionality
Type
Description


function
Required
String
Full HTTPS URL of the Azure Function HTTP trigger endpoint. For example, "https&#x3A;//myapp.azurewebsites.net/api/MyFunction".

key
Optional
String
A function-level or host-level API key for authentication. The workflow sends it as the x-functions-key header. Pass as a secret.

method
Required
String
HTTP method to use. One of "GET", "POST", "PUT", "DELETE", "PATCH". Defaults to "POST".

body
Optional
String
Request body as a JSON string. Applies only when method is not GET or HEAD. Accepts secret references.

headers
Optional
Map
Additional HTTP headers in JSON format. For example, {"X-Custom-Header": "value", "Content-Type": "application/json"}. Accepts secret references.

queryParameters
Optional
Map
Query parameters to append to the function URL. Must not start with ? or &. For example, param1=value1&amp;param2=value2.




### Outputs

The action returns the following fields.
Output field
Type
Description


statusCode
Integer
HTTP status code returned by the Azure Function. For example, 200, 404, or 500.

response
String
Response body from the Azure Function. Can be JSON, plain text, HTML, or any other format.

success
Boolean
Indicates whether the function call succeeded. true for 2xx responses (200–299), false otherwise.




### Example

#### Example: Trigger a remediation function

```yaml
name: azure-function-invoke-remediation

steps:
  - name: invokeRemediationFunction
    type: action
    action: azure.functions.invoke
    version: 1
    inputs:
      function: "https://remediation.azurewebsites.net/api/fix-incident"
      key: ${{ :secrets:azure:functionKey }}
      method: "POST"
      body: '{"incidentId":"${{ .workflowInputs.incidentId }}"}'
```

#### Example: GET request with query parameters

```yaml
name: azure-function-invoke-get

steps:
  - name: getFromFunction
    type: action
    action: azure.functions.invoke
    version: 1
    inputs:
      function: "https://myapp.azurewebsites.net/api/GetStatus"
      key: ${{ :secrets:azure:functionKey }}
      method: "GET"
      queryParameters: "env=prod&region=eastus"
```

#### Example: Invoke a function and log the result

```yaml
name: azure-function-invoke-and-log

steps:
  - name: invokeFunction
    type: action
    action: azure.functions.invoke
    version: 1
    inputs:
      function: "https://myapp.azurewebsites.net/api/RunCheck"
      key: ${{ :secrets:azure:functionKey }}
      method: "POST"
      body: '{"target":"${{ .workflowInputs.target }}"}'
      headers:
        Content-Type: "application/json"

  - name: logFunctionResult
    type: action
    action: newrelic.ingest.sendLogs
    version: 1
    inputs:
      logs:
        - message: "Azure Function invocation complete"
          attributes:
            success: ${{ .steps.invokeFunction.outputs.success }}
            statusCode: ${{ .steps.invokeFunction.outputs.statusCode }}
            response: ${{ .steps.invokeFunction.outputs.response }}
```
