> ## Documentation Index
> Fetch the complete documentation index at: https://docs.controlplane.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure Connector

> Create an Azure Connector secret to store credentials for connecting to Azure Function Apps from Control Plane workloads.

Azure Connector secrets store credentials for connecting to Azure Function Apps, enabling Control Plane to integrate with serverless Azure functions for custom processing or webhooks.

## Use Cases

* **Webhook Processing**: Trigger Azure Functions from Control Plane events
* **Custom Integrations**: Connect to Azure-hosted business logic
* **Serverless Workflows**: Integrate with Azure Durable Functions
* **Event Processing**: Route events to Azure Function endpoints

## Configuration Options

| Field  | Description                                            | Required |
| :----- | :----------------------------------------------------- | :------- |
| `url`  | Azure Function App deployment URL                      | Yes      |
| `code` | Function authentication key (host key or function key) | Yes      |

<Note>
  The `code` is the function key that authenticates requests to your Azure Function. You can find it in the Azure Portal under your Function App's **App keys** or **Function keys** section.
</Note>

***

## Create an Azure Connector Secret

<Tabs>
  <Tab title="Console UI">
    <Steps>
      <Step title="Navigate to Secrets">
        In the Console, navigate to **Secrets** and click **New**, or use the **Create** dropdown in the top-right corner and select **Secret**.
      </Step>

      <Step title="Enter basic information">
        Enter a **Name** and optional **Description**.
      </Step>

      <Step title="Select secret type">
        Select **Azure Connector** as the secret type.
      </Step>

      <Step title="Configure connector data">
        Click **Data** in the left pane. Enter the **URL** (Azure Function App deployment URL) and the **Code** (authentication key).
      </Step>

      <Step title="Create the secret">
        Click **Create**.
      </Step>
    </Steps>
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    cpln secret create-azure-connector \
      --name azure-function-connector \
      --url https://my-function-app.azurewebsites.net/api/webhook \
      --code your-function-key-here \
      --org my-org
    ```
  </Tab>

  <Tab title="Terraform">
    ```hcl theme={null}
    resource "cpln_secret" "azure_connector" {
      name        = "azure-function-connector"
      description = "Azure Function App webhook connector"

      azure_connector {
        url  = "https://my-function-app.azurewebsites.net/api/webhook"
        code = "your-function-key-here"
      }
    }
    ```

    <Warning>
      This example uses a placeholder function key for testing. In production, use Terraform variables or a secrets manager.
    </Warning>
  </Tab>

  <Tab title="Pulumi">
    <Tabs>
      <Tab title="TypeScript">
        ```typescript theme={null}
        import * as cpln from "@pulumiverse/cpln";

        const azureConnectorSecret = new cpln.Secret("azure-function-connector", {
          name: "azure-function-connector",
          description: "Azure Function App webhook connector",
          azureConnector: {
            url: "https://my-function-app.azurewebsites.net/api/webhook",
            code: "your-function-key-here",
          },
        });
        ```
      </Tab>

      <Tab title="Python">
        ```python theme={null}
        import pulumiverse_cpln as cpln

        azure_connector_secret = cpln.Secret("azure-function-connector",
            name="azure-function-connector",
            description="Azure Function App webhook connector",
            azure_connector={
                "url": "https://my-function-app.azurewebsites.net/api/webhook",
                "code": "your-function-key-here",
            })
        ```
      </Tab>

      <Tab title="Go">
        ```go theme={null}
        package main

        import (
            "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
            "github.com/pulumiverse/pulumi-cpln/sdk/go/cpln"
        )

        func main() {
            pulumi.Run(func(ctx *pulumi.Context) error {
                _, err := cpln.NewSecret(ctx, "azure-function-connector", &cpln.SecretArgs{
                    Name:        pulumi.String("azure-function-connector"),
                    Description: pulumi.String("Azure Function App webhook connector"),
                    AzureConnector: &cpln.SecretAzureConnectorArgs{
                        Url:  pulumi.String("https://my-function-app.azurewebsites.net/api/webhook"),
                        Code: pulumi.String("your-function-key-here"),
                    },
                })
                return err
            })
        }
        ```
      </Tab>

      <Tab title="C#">
        ```csharp theme={null}
        using Pulumi;
        using Pulumiverse.Cpln;
        using Pulumiverse.Cpln.Inputs;

        return await Deployment.RunAsync(() =>
        {
            var azureConnectorSecret = new Secret("azure-function-connector", new SecretArgs
            {
                Name = "azure-function-connector",
                Description = "Azure Function App webhook connector",
                AzureConnector = new SecretAzureConnectorArgs
                {
                    Url = "https://my-function-app.azurewebsites.net/api/webhook",
                    Code = "your-function-key-here",
                },
            });
        });
        ```
      </Tab>
    </Tabs>
  </Tab>
</Tabs>

***

## Finding Your Function Key

<Steps>
  <Step title="Open Azure Portal">
    Sign in to the [Azure Portal](https://portal.azure.com).
  </Step>

  <Step title="Navigate to your Function App">
    Search for and select **Function App**, then select your function app from the list.
  </Step>

  <Step title="Access the keys">
    In the left menu, expand **Functions**, then select **App keys** for host-level keys. Alternatively, click on a specific function and select **Function Keys** for function-specific keys.
  </Step>

  <Step title="Copy the key">
    Copy the **default** key or create a new one for use in your Control Plane secret.
  </Step>
</Steps>

<Tip>
  Use function-level keys when possible to limit access to specific functions. Use host keys only when you need to access multiple functions.
</Tip>

***

## URL Format

Azure Function URLs follow this pattern:

```text theme={null}
https://<function-app-name>.azurewebsites.net/api/<function-name>
```

For custom domains:

```text theme={null}
https://api.example.com/api/<function-name>
```

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Azure SDK Secrets" icon="microsoft" href="/guides/create-secret/azure-sdk">
    Authenticate with Azure services using SDK
  </Card>

  <Card title="Using Secrets in Workloads" icon="cube" href="/guides/create-secret/overview#using-secrets-in-workloads">
    Learn how to grant access and inject secrets
  </Card>
</CardGroup>
