Modern business applications rarely work in isolation. An order exception might need an email, a support case might need a Teams notification, and a completed document might need to be stored in SharePoint. Developers can build each integration directly against a service API, but that also means owning different authentication models, request and response shapes, pagination rules, and error handling for every service.
The Azure Connectors SDK brings the typed experience of a .NET client library to Connector Namespace, which makes the Logic Apps and Power Platform connector runtime available to developers as a programmable integration layer. Your application can call connector operations through generated clients and models while Azure manages the connection to the external service.
In this post, we will build a small Azure function app that reacts to a new email through a Connector trigger and sends a formatted review email through the Office 365 Outlook connector. The same pattern can then be extended to many other business systems.
Preview: Azure Connectors SDK is currently in preview. Preview features are provided without a service-level agreement and are not recommended for production workloads. APIs and setup steps can change before general availability.
Why this matters
Integration code often starts with one HTTP call and grows into a collection of service-specific concerns. The Azure Connectors SDK gives .NET developers:
- Typed clients, request models, and response models generated from connector contracts
- Async operations with cancellation-token support
- Azure credential integration for authenticating the calling application
- Consistent connector exceptions and diagnostics
- Built-in retry support for transient failures
- Pagination, binary payload, and dynamic-schema support where connectors expose them
- OpenTelemetry integration for tracing connector calls
- Access to a broad connector ecosystem that includes Microsoft 365, Azure services, data platforms, storage, messaging, and SaaS applications
The SDK does not put external-service credentials in your application. Instead, your code authenticates to a Connector Namespace connection. That connection holds the authorization for Office 365 Outlook or another target service.
Scenario: notify operations about an order exception
Imagine an order service that flags transactions for manual review by sending an email to an Office 365 mailbox. The subject identifies the order and the body briefly explains the exception:
To: orders@contoso.com
Subject: Order exception: SO-10482
Body: Customer requested a delivery-address change after payment.
Connector Namespace polls the mailbox for new messages matching the subject filter and calls an Azure function app's Connector trigger. The function reads the typed email payload and sends a formatted review email to a separate operations inbox. Unlike an HTTP-triggered function, there is no application endpoint or 202 Accepted response to invoke.
Prerequisites
You need:
- An Azure subscription in which Connector Namespace is available
- Permission to create Connector Namespace resources and connections
- .NET 10 SDK
- Azure Functions Core Tools v4
- Azure CLI
- Azure Developer CLI (
azd) for deployment, or an existing .NET 10 isolated-worker function app - An Office 365 account that can authorize the connection and send email
At the time of writing, Connector Namespace is available in a limited set of preview regions. Confirm current region availability before creating the resource.
1. Create an Office 365 connection
First sign in and select the subscription that will own the Connector Namespace:
az login
az account set --subscription "<subscription-id>"
$subscriptionId = "<subscription-id>"
$resourceGroup = "<resource-group>"
$namespaceName = "<connector-namespace-name>"
$connectionName = "office365-orders"
$location = "<supported-azure-region>"
$apiVersion = "2026-05-01-preview"
$nsId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroup/providers/Microsoft.Web/connectorGateways/$namespaceName"
Create a Connector Namespace with a system-assigned managed identity:
$namespace = @{
location = $location
identity = @{ type = "SystemAssigned" }
properties = @{}
} | ConvertTo-Json -Depth 5 -Compress
$tempFile = Join-Path $env:TEMP "connector-namespace.json"
[System.IO.File]::WriteAllText($tempFile, $namespace)
az rest --method PUT `
--uri "https://management.azure.com${nsId}?api-version=$apiVersion" `
--body "@$tempFile" `
--headers "Content-Type=application/json" `
--output none
Remove-Item $tempFile
Create the Office 365 connection:
$connection = @{
properties = @{ connectorName = "office365" }
} | ConvertTo-Json -Depth 5 -Compress
$tempFile = Join-Path $env:TEMP "connector-connection.json"
[System.IO.File]::WriteAllText($tempFile, $connection)
az rest --method PUT `
--uri "https://management.azure.com${nsId}/connections/${connectionName}?api-version=$apiVersion" `
--body "@$tempFile" `
--headers "Content-Type=application/json" `
--output none
Remove-Item $tempFile
The new connection is not authorized yet. Request an OAuth consent link and open it in your browser:
$consentRequest = @{
parameters = @(
@{
redirectUrl = "https://portal.azure.com"
parameterName = "token"
}
)
} | ConvertTo-Json -Depth 5 -Compress
$tempFile = Join-Path $env:TEMP "connector-consent.json"
[System.IO.File]::WriteAllText($tempFile, $consentRequest)
$consent = az rest --method POST `
--uri "https://management.azure.com${nsId}/connections/${connectionName}/listConsentLinks?api-version=$apiVersion" `
--body "@$tempFile" `
--headers "Content-Type=application/json" `
--output json | ConvertFrom-Json
Remove-Item $tempFile
Start-Process $consent.value[0].link
Complete the sign-in and consent flow. Then verify that the connection reports Connected:
az rest --method GET `
--uri "https://management.azure.com${nsId}/connections/${connectionName}?api-version=$apiVersion" `
--output json |
ConvertFrom-Json |
Select-Object -ExpandProperty properties |
Select-Object -ExpandProperty statuses
2. Allow your local identity to call the connection
OAuth consent authorizes the connection to call Office 365. A separate access policy authorizes your application to call the connection. This distinction is important: without the policy, the runtime call fails with HTTP 403 and a missing connection ACL message.
Add an access policy for the identity currently signed in to Azure CLI:
$userObjectId = az ad signed-in-user show --query id --output tsv
$tenantId = az account show --query tenantId --output tsv
$policy = @{
properties = @{
principal = @{
type = "ActiveDirectory"
identity = @{
objectId = $userObjectId
tenantId = $tenantId
}
}
}
} | ConvertTo-Json -Depth 6 -Compress
$tempFile = Join-Path $env:TEMP "connector-policy.json"
[System.IO.File]::WriteAllText($tempFile, $policy)
az rest --method PUT `
--uri "https://management.azure.com${nsId}/connections/${connectionName}/accessPolicies/local-dev?api-version=$apiVersion" `
--body "@$tempFile" `
--headers "Content-Type=application/json" `
--output none
Remove-Item $tempFile
Access-policy changes can take a few minutes to reach the connector runtime.
Finally, retrieve the connection runtime URL. Treat this value as application configuration rather than source code:
$connection = az rest --method GET `
--uri "https://management.azure.com${nsId}/connections/${connectionName}?api-version=$apiVersion" `
--output json | ConvertFrom-Json
$connectionRuntimeUrl = $connection.properties.connectionRuntimeUrl
3. Create the Azure function app
Create an isolated-worker function app with the current Core Tools template. Some Core Tools v4 versions do not offer net10.0 as a func init --target-framework option; use the .NET 9 template, then change the generated project's TargetFramework to net10.0 before building:
func init ConnectorsSdkOrderAlerts --worker-runtime dotnet-isolated --target-framework net9.0
Set-Location ConnectorsSdkOrderAlerts
In ConnectorsSdkOrderAlerts.csproj, set:
<TargetFramework>net10.0</TargetFramework>
Add the connector packages:
dotnet add package Azure.Connectors.Sdk --version 0.13.0-preview.1
dotnet add package Azure.Identity
dotnet add package Microsoft.Azure.Functions.Worker.Extensions.Connector --version 0.2.0-alpha
Register an Azure credential and only the connector client this function needs. DefaultAzureCredential can use your Azure CLI identity locally and the function app's managed identity in Azure:
using Azure.Connectors.Sdk;
using Azure.Core;
using Azure.Identity;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults()
.ConfigureServices((hostContext, services) =>
{
services.AddSingleton<TokenCredential>(new DefaultAzureCredential());
services.AddOffice365Client(
hostContext.Configuration.GetSection("Connectors:Office365"));
})
.Build();
host.Run();
Add the function. The Connector trigger binds the OnNewEmailV3 callback to a typed payload. Filter the subject again in code, HTML-encode untrusted email fields, and send the review message through the generated SendEmailInput model:
using System.Text.Encodings.Web;
using Azure.Connectors.Sdk.Office365;
using Azure.Connectors.Sdk.Office365.Models;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Extensions.Connector;
public sealed class OperationalAlertFunctions
{
private const string SubjectPrefix = "Order exception:";
private readonly Office365Client _office365Client;
public OperationalAlertFunctions(Office365Client office365Client)
{
this._office365Client = office365Client;
}
[Function("OnOrderExceptionEmail")]
public async Task OnOrderExceptionEmailAsync(
[ConnectorTrigger] Office365OnNewEmailTriggerPayload payload,
CancellationToken cancellationToken)
{
foreach (var message in payload.Body?.Value ?? [])
{
if (message?.Subject?.StartsWith(
OperationalAlertFunctions.SubjectPrefix,
StringComparison.OrdinalIgnoreCase) != true)
{
continue;
}
var orderId = message.Subject[OperationalAlertFunctions.SubjectPrefix.Length..].Trim();
if (string.IsNullOrWhiteSpace(orderId))
{
continue;
}
var email = new SendEmailInput
{
To = "operations@contoso.com",
Subject = $"Order {orderId} requires review",
Body = "<h2>Order review required</h2>" +
$"<p><strong>Order:</strong> {HtmlEncoder.Default.Encode(orderId)}</p>" +
$"<p><strong>From:</strong> {HtmlEncoder.Default.Encode(message.From ?? string.Empty)}</p>" +
$"<p><strong>Reason:</strong> {HtmlEncoder.Default.Encode(message.BodyPreview ?? string.Empty)}</p>"
};
await this._office365Client.SendEmailAsync(email, cancellationToken);
}
}
}
Use a monitored mailbox or folder separate from the operations inbox. Keep the outgoing subject different from the trigger's subject filter so the notification cannot trigger itself. For production workloads, account for repeated callbacks and partial failures within a batch before performing non-idempotent actions such as sending mail.
4. Deploy and register the Connector trigger
Keep the runtime URL out of source control. Set it for local development, then deploy the function app with a system-assigned managed identity and the same setting in its application configuration:
$env:Connectors__Office365__ConnectionRuntimeUrl = $connectionRuntimeUrl
The public Office 365 connector-trigger sample is a downloadable .NET 10 function app with deployment infrastructure, an OnNewEmail binding, and post-deploy trigger registration. Use its azd up workflow or deploy this function app through your existing pipeline. A locally running Functions host is not reachable by the Connector Namespace polling callback unless you provide a secure public callback endpoint.
Once the function app is deployed, add its managed identity to the connection's access policies, just as you added your CLI identity for local development. For a system-assigned identity, get its principal ID and use it in the access policy from step 2 instead of $userObjectId:
$functionAppName = "<function-app-name>"
$functionObjectId = az functionapp identity show `
--resource-group $resourceGroup --name $functionAppName `
--query principalId --output tsv
$policy = @{
properties = @{
principal = @{
type = "ActiveDirectory"
identity = @{
objectId = $functionObjectId
tenantId = $tenantId
}
}
}
} | ConvertTo-Json -Depth 6 -Compress
$tempFile = [System.IO.Path]::GetTempFileName()
try {
[System.IO.File]::WriteAllText($tempFile, $policy)
az rest --method PUT `
--uri "https://management.azure.com${nsId}/connections/${connectionName}/accessPolicies/order-alert-function?api-version=$apiVersion" `
--body "@$tempFile" `
--headers "Content-Type=application/json" `
--output none
}
finally {
Remove-Item $tempFile
}
Obtain the Connector extension's system key and the function app's actual default hostname, then construct the callback URL for the deployed function. Do not assume that the hostname is <function-app-name>.azurewebsites.net; the default hostname format can vary:
$connectorExtensionKey = az functionapp keys list `
--resource-group $resourceGroup --name $functionAppName `
--query "systemKeys.connector_extension" --output tsv
$functionAppHostname = az functionapp show `
--resource-group $resourceGroup --name $functionAppName `
--query "defaultHostName" --output tsv
$callbackUrl = "https://$functionAppHostname/runtime/webhooks/connector?functionName=OnOrderExceptionEmail&code=$connectorExtensionKey"
The system key is a secret. Do not log, publish, or commit the callback URL. Create the Office 365 polling trigger config using the same connection and a subject filter matching the incoming order messages:
$triggerConfig = @{
properties = @{
operationName = "OnNewEmailV3"
connectionDetails = @{
connectorName = "office365"
connectionName = $connectionName
}
notificationDetails = @{
callbackUrl = $callbackUrl
httpMethod = "Post"
}
parameters = @(
@{ name = "folderPath"; value = "Inbox" }
@{ name = "subjectFilter"; value = "Order exception:" }
)
metadata = @{
destinationType = "functionApp"
functionAppName = $functionAppName
functionAppResourceGroup = $resourceGroup
functionAppSubscriptionId = $subscriptionId
functionName = "OnOrderExceptionEmail"
recurrenceFrequency = "Minute"
recurrenceInterval = "5"
}
}
} | ConvertTo-Json -Depth 6 -Compress
$tempFile = [System.IO.Path]::GetTempFileName()
try {
[System.IO.File]::WriteAllText($tempFile, $triggerConfig)
az rest --method PUT `
--uri "https://management.azure.com${nsId}/triggerConfigs/order-exception-email?api-version=$apiVersion" `
--body "@$tempFile" `
--headers "Content-Type=application/json" `
--output none
}
finally {
Remove-Item $tempFile
}
Confirm that the trigger config reports Enabled. Send a test email to the monitored mailbox, and allow for the polling interval before checking the function logs and the operations inbox:
az rest --method GET `
--uri "https://management.azure.com${nsId}/triggerConfigs/order-exception-email?api-version=$apiVersion" `
--query "properties.{operation:operationName,state:state}" `
--output table
Confirm all three outcomes before considering the test complete:
- The trigger config is
Enabledand the function logs show the invocation. - The operations inbox receives a review email with the expected order ID and reason.
- Unrelated messages do not produce review emails.
From local development to Azure
For a deployed function app, use its managed identity instead of a developer identity:
- Enable a system-assigned or user-assigned managed identity on the function app.
- Add that identity as an access policy on the Connector Namespace connection.
- Register
DefaultAzureCredentialorManagedIdentityCredentialas theTokenCredential. - Store the connection runtime URL in function app configuration.
- Protect the Connector trigger callback with the Connector extension system key; use a stronger authorization model for production as appropriate.
The external-service credential remains in the connector connection. The function app presents its Azure identity when it calls the runtime URL. The Connector Namespace uses the callback URL and its system key to invoke the function.
Go beyond email
The order-alert example is intentionally small, but the programming model supports much broader integration scenarios:
- Microsoft 365: work with Outlook, SharePoint, Teams, OneDrive, Excel, Planner, Forms, and Microsoft Entra ID-backed operations.
- Azure services: connect to Blob Storage, queues, tables, Event Grid, Event Hubs, Service Bus, Key Vault, Azure Monitor Logs, and Azure Data Factory.
- Business applications: integrate with Salesforce, Dynamics 365, Jira, ServiceNow-style workflows, DocuSign, Zendesk, and other SaaS systems represented in the connector catalog.
- Event-driven applications: register polling triggers that call back to an Azure function app when connector events occur.
- Data-rich APIs: consume paginated operations, binary content, and operations whose input or output schema is resolved dynamically.
- Observable integrations: capture connector activity in distributed traces with OpenTelemetry.
Because connector clients are typed, developers can discover operations through IntelliSense and keep connector calls alongside the rest of their application code. The connection layer handles authorization to the external system, while Azure identity and access policies govern which application may use that connection.
Troubleshooting
The call returns 403 with “missing connection ACL.”
The external OAuth connection may be healthy, but the calling Azure identity is not authorized. Add an access policy for the Azure CLI user during local development or the workload managed identity after deployment. Allow time for the policy to propagate.
The connection remains in an error state.
Complete the OAuth consent flow and query the connection again. Make sure the account used for consent has access to the target service.
The client fails during startup because the runtime URL is missing.
Make sure Connectors__Office365__ConnectionRuntimeUrl is present in the process environment. In a larger application, register only the connector clients whose configuration is available.
Authentication works locally but fails in Azure.
The local Azure CLI user and the function app managed identity are different principals. Add a separate connection access policy for the function app identity and use a managed-identity-capable credential in the deployed host.
The email trigger does not fire.
Verify the trigger config is Enabled, its operation is OnNewEmailV3, its folderPath and subjectFilter match the test email, and its callback uses the deployed function's OnOrderExceptionEmail name and Connector extension system key. Polling is not instantaneous.
Get started
Explore the Azure Connectors SDK repository, try the samples, and tell us which connectors and application patterns would be most useful for your team.