Aspire.Hosting.Azure.ConnectorNamespace
13.6.1-preview.1.26506.6
Prefix Reserved
dotnet add package Aspire.Hosting.Azure.ConnectorNamespace --version 13.6.1-preview.1.26506.6
NuGet\Install-Package Aspire.Hosting.Azure.ConnectorNamespace -Version 13.6.1-preview.1.26506.6
<PackageReference Include="Aspire.Hosting.Azure.ConnectorNamespace" Version="13.6.1-preview.1.26506.6" />
<PackageVersion Include="Aspire.Hosting.Azure.ConnectorNamespace" Version="13.6.1-preview.1.26506.6" />
<PackageReference Include="Aspire.Hosting.Azure.ConnectorNamespace" />
paket add Aspire.Hosting.Azure.ConnectorNamespace --version 13.6.1-preview.1.26506.6
#r "nuget: Aspire.Hosting.Azure.ConnectorNamespace, 13.6.1-preview.1.26506.6"
#:package Aspire.Hosting.Azure.ConnectorNamespace@13.6.1-preview.1.26506.6
#addin nuget:?package=Aspire.Hosting.Azure.ConnectorNamespace&version=13.6.1-preview.1.26506.6&prerelease
#tool nuget:?package=Aspire.Hosting.Azure.ConnectorNamespace&version=13.6.1-preview.1.26506.6&prerelease
Azure Connector Namespace hosting integration
Use this integration to model, configure, and orchestrate Azure Connector Namespace resources in an Aspire solution.
Getting started
Prerequisites
- An Azure subscription and region with Azure Connector Namespace preview access.
- Permission to create Connector Namespace resources, connections, MCP server configurations, and access policies.
- A user account authorized to complete any connector-specific OAuth or consent flow.
Add the integration
From your AppHost directory, add the Aspire.Hosting.Azure.ConnectorNamespace integration with the Aspire CLI:
aspire add Aspire.Hosting.Azure.ConnectorNamespace
Usage example
A Connector Namespace contains separately managed, reusable resources:
- A connection is an authenticated binding to an external service such as Office 365 or SharePoint.
- An MCP server configuration exposes selected connector operations as MCP tools.
WithConnectorlinks the MCP server configuration to the connection it uses. The current service preview supports one connector per managed MCP server configuration.
The following AppHost example adds a Connector Namespace with a connection and an allow-listed managed MCP server:
C#
var connectorNamespace = builder.AddAzureConnectorNamespace("connectors");
var outlook = connectorNamespace.AddConnection(
"outlook",
"office365",
new AzureConnectorNamespaceConnectionOptions
{
ConnectionName = "office365-outlook",
DisplayName = "Office 365 Outlook"
})
.WithAccessPolicy(
"worker-access",
new AzureConnectorNamespaceAccessPolicyOptions
{
ObjectId = "33333333-3333-3333-3333-333333333333",
TenantId = "22222222-2222-2222-2222-222222222222"
});
builder.AddProject<Projects.Worker>("worker")
.WithReference(outlook);
connectorNamespace.AddMcpServerConfig("outlook-mcp")
.WithConnector(
"office365",
outlook,
new AzureConnectorNamespaceMcpConnectorOptions
{
Operations =
[
new AzureConnectorNamespaceMcpOperationOptions
{
Name = "GetEmailsV3",
DisplayName = "Get emails"
}
]
})
.WithAccessPolicy(
"developer-access",
new AzureConnectorNamespaceMcpAccessPolicyOptions
{
ObjectId = "11111111-1111-1111-1111-111111111111",
TenantId = "22222222-2222-2222-2222-222222222222",
PrincipalType = AzureConnectorNamespaceMcpAccessPolicyPrincipalType.User
});
TypeScript
import { AzureConnectorNamespaceMcpAccessPolicyPrincipalType } from "./.aspire/modules/aspire.mjs";
const connectorNamespace = await builder.addAzureConnectorNamespace("connectors");
const outlook = await connectorNamespace.addConnection("outlook", "office365", {
connectionName: "office365-outlook",
displayName: "Office 365 Outlook"
});
await outlook.withAccessPolicy("worker-access", {
objectId: "33333333-3333-3333-3333-333333333333",
tenantId: "22222222-2222-2222-2222-222222222222"
});
const worker = await builder.addContainer(
"worker",
"mcr.microsoft.com/dotnet/runtime-deps:10.0"
);
await worker.withReference(outlook);
const outlookMcp = await connectorNamespace.addMcpServerConfig("outlook-mcp");
await outlookMcp.withConnector("office365", outlook, {
operations: [
{
name: "GetEmailsV3",
displayName: "Get emails"
}
]
});
await outlookMcp.withAccessPolicy("developer-access", {
objectId: "11111111-1111-1111-1111-111111111111",
tenantId: "22222222-2222-2222-2222-222222222222",
principalType: AzureConnectorNamespaceMcpAccessPolicyPrincipalType.User
});
Referencing outlook injects outlook__connectorGatewayName and outlook__connectionName into the workload for the Azure Connector SDK. It does not authorize the workload to use the connection. The connection access policy must identify the Microsoft Entra principal used by the deployed workload. Pass a connection-name override to WithReference when the consuming application uses a different configuration prefix.
After deployment, open https://connectors.azure.com/<subscription-id>/<resource-group>/<connector-namespace-name>/overview and authorize connections that require user consent. Aspire does not automate or store OAuth credentials.
Security and access
- MCP connector routes require an explicit operation allow-list. Expose only the operations the application needs.
WithAccessPolicygrants one explicitly identified Microsoft Entra principal access to a connection.WithIdentityAccessPolicygrants access to a user-assigned managed identity without hard-coding its principal ID.WithAccessPolicyon an MCP server configuration grants an Entra user or group permission to call its MCP endpoint. MCP access policies do not currently support managed identities or service principals.- Do not put credentials, tokens, or other secrets in MCP descriptions or operation metadata.
Aspire provisions Connector Namespace resources through incremental ARM deployments. Removing a connection, connection access policy, MCP access policy, or MCP server configuration from the AppHost does not delete a previously deployed Azure child resource. To revoke access or retire a connection or configuration, delete it explicitly in Azure or tear down the provisioning environment.
Existing Connector Namespace resources can be referenced with the standard Azure PublishAsExisting and AsExisting APIs. Existing connection and MCP server configuration children can be marked with AsExisting(). Existing resources are emitted as read-only Bicep references.
When adding a new access policy beneath an existing Connector Namespace, configure the Azure deployment location to match the existing namespace location. Bicep cannot read an existing resource's location early enough to assign the child resource location automatically.
Preview limitations
The package and service are preview features. The current integration does not support:
- Automating Connector Namespace OAuth or consent flows.
- Supplying secret-valued connection parameter sets. Create those connections outside Aspire or reference an existing connection.
- Connector triggers and event subscriptions.
- Hosted MCP servers or arbitrary MCP operation parameter schemas.
Connector names, operation IDs, and authentication requirements vary by connector and region. Verify them against the managed connector metadata before deployment.
Configure Azure Provisioning for local development
Adding Azure resources to the Aspire application model will automatically enable development-time provisioning for Azure resources so that you don't need to configure them manually. Provisioning requires a number of settings to be available via .NET configuration. The Aspire dashboard will prompt you to set these values if they are not already configured. See Local Azure Provisioning for more details.
Additional documentation
- https://aspire.dev/integrations/gallery/
- https://learn.microsoft.com/azure/connector-namespace/connector-namespace-overview
- https://learn.microsoft.com/azure/connector-namespace/create-connector-namespace-connection
Feedback & contributing
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Aspire.Hosting.Azure (>= 13.6.1)
- AspNetCore.HealthChecks.Uris (>= 9.0.0)
- Azure.Core (>= 1.62.0)
- Azure.Identity (>= 1.21.0)
- Azure.Provisioning (>= 1.6.0)
- Azure.Provisioning.KeyVault (>= 1.1.0)
- Azure.ResourceManager.Authorization (>= 1.1.7)
- Azure.ResourceManager.KeyVault (>= 1.4.0)
- Azure.ResourceManager.Resources.Deployments (>= 1.0.0)
- Azure.Security.KeyVault.Secrets (>= 4.11.1)
- Google.Protobuf (>= 3.36.1)
- Grpc.AspNetCore (>= 2.83.0)
- Grpc.Net.ClientFactory (>= 2.83.0)
- Grpc.Tools (>= 2.83.0)
- Hex1b (>= 0.168.0)
- KubernetesClient (>= 19.0.2)
- MessagePack (>= 2.5.302)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.31)
- Microsoft.Extensions.FileSystemGlobbing (>= 10.0.12)
- Microsoft.Extensions.Hosting (>= 10.0.12)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Http (>= 10.0.12)
- Microsoft.Extensions.Logging (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- Microsoft.Extensions.Primitives (>= 10.0.12)
- ModelContextProtocol (>= 1.4.1)
- Newtonsoft.Json (>= 13.0.4)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.17.0)
- OpenTelemetry.Extensions.Hosting (>= 1.17.0)
- Polly.Core (>= 8.7.0)
- Semver (>= 3.0.0)
- StreamJsonRpc (>= 2.25.29)
- System.IO.Hashing (>= 10.0.12)
- System.Text.Json (>= 10.0.12)
- YamlDotNet (>= 18.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 13.6.1-preview.1.26506.6 | 53 | 10/7/2026 |
| 13.6.0-preview.1.26479.8 | 84 | 9/29/2026 |