> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/code/integrations/providers/azure-functions.md).

# Azure Functions

Connect Azure Functions to the Code module.

Azure Functions runs your functions in a function app in your own Microsoft Azure subscription. Norbix connects to the app with a function key or a storage connection string.

{% hint style="warning" %}
You can connect Azure Functions in Cloud, but Norbix cannot call your functions yet: every test answers *Provider 'AzureFunctions' is not wired up yet* (the server has no Azure Functions client). Connect it now so the settings are ready; nothing is sent to Azure. Through the SDK, CLI and API the integration is saved the same way.
{% endhint %}

## Get your credentials

1. Sign in to the [Azure portal](https://portal.azure.com/). If you have no function app yet, create one: **Create a resource → Function App**, pick the subscription, a **Resource group** (for example `bookshop-rg`) and an app name (for example `bookshop-functions`). Microsoft guide: [Create a function app in the Azure portal](https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-function-app-portal).
2. Open the function app and go to **Functions → App keys**. Copy the value of a **Host key** (for example `default`), or add a new key for Norbix. Microsoft guide: [Work with access keys in Azure Functions](https://learn.microsoft.com/en-us/azure/azure-functions/function-keys-how-to).
3. If you use a storage connection string instead, copy it from the storage account → **Security + networking → Access keys**. Microsoft guide: [Configure a connection string for an Azure storage account](https://learn.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string).

The old setup with an Azure Active Directory app registration and a redirect address is not needed any more — the V2 form has no sign-in step.

## Connect it in Cloud

**Where:** Code → Integrations → **Add New Integration** → Azure Functions → **Connect** · `/projects/<project>/code/integrations/new/azure-functions`

| Field                             | Required | What it does                                                            | Example                             |
| --------------------------------- | -------- | ----------------------------------------------------------------------- | ----------------------------------- |
| Function App Name                 | yes      | The name of your function app.                                          | `bookshop-functions`                |
| Resource Group (optional)         | no       | The resource group that holds the app.                                  | `bookshop-rg`                       |
| Connection String or Function Key | yes      | The key Norbix authenticates with. Stored encrypted, never shown again. | `placeholder-function-key-not-real` |
| Integration Name                  | yes      | How the integration is listed in Norbix.                                | `Bookshop Azure`                    |

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-6dbc6070b112d01c18ec82a5685f6843a2fcd107%2Fazure-functions-form-1.png?alt=media" alt="New Azure Functions Integration filled with bookshop-functions, bookshop-rg, a hidden placeholder key and the name Bookshop Azure"><figcaption><p>The filled form (the key is a made-up placeholder).</p></figcaption></figure>

Press **Save**. The title becomes *Editing Azure Functions integration*, the badges say **ENABLED** and **NOT TESTED**, the id (`int_…`) appears with a copy button, and the key field is empty again with a note that the key is not shown.

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-01765fe831bd8c7cb4751a388a02bc110b4875ab%2Fset-default-2.png?alt=media" alt="Editing Azure Functions integration Bookshop Azure with the badges ENABLED and TEST FAILED and the id int_56TAXhjxoHW9nYldqdra9X"><figcaption><p>After save (this one was already tested once).</p></figcaption></figure>

## Test and set as default

**Test integration** answers *Provider 'AzureFunctions' is not wired up yet* and sets **TEST FAILED** — see [Test an integration](/codemash/cloud/code/integrations/test.md). **Set as default** is accepted but not kept — see [Set as default](/codemash/cloud/code/integrations/set-default.md). To turn it off: [Disable or delete](/codemash/cloud/code/integrations/disable.md).

From code:

```ts
await norbix.hub.code.saveCodeIntegration({
  integration: {
    provider: 'AzureFunctions',
    integrationName: 'Billing Azure',
    isEnabled: true,
    functionAppName: 'billing-functions',
    connectionStringOrKey: 'placeholder-function-key-not-real',
  },
});
```

```sh
norbix hub code integration save --integration:json '{"provider":"AzureFunctions","integrationName":"Reports Azure","isEnabled":true,"functionAppName":"reports-functions","connectionStringOrKey":"placeholder-function-key-not-real"}'
```

API: [Save Code Integration](/codemash/api-reference/code/integrations/save-code-integration.md)

## Common errors

| Message                                                                  | Cause                                               | Fix                                                                       |
| ------------------------------------------------------------------------ | --------------------------------------------------- | ------------------------------------------------------------------------- |
| *Required* under **Function App Name**                                   | The app name is empty.                              | Type the function app name.                                               |
| *Required* under **Connection String or Function Key**                   | The key is empty — it is asked again on every save. | Paste the key again.                                                      |
| *Provider 'AzureFunctions' is not wired up yet.* on **Test integration** | Norbix has no Azure Functions client yet.           | Nothing to fix on your side; the test will work when the client is added. |
