Aspire.Hosting.Azure.ConnectorNamespace 13.6.1-preview.1.26506.6

Prefix Reserved
This is a prerelease version of Aspire.Hosting.Azure.ConnectorNamespace.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Aspire.Hosting.Azure.ConnectorNamespace" Version="13.6.1-preview.1.26506.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aspire.Hosting.Azure.ConnectorNamespace" Version="13.6.1-preview.1.26506.6" />
                    
Directory.Packages.props
<PackageReference Include="Aspire.Hosting.Azure.ConnectorNamespace" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
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"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Aspire.Hosting.Azure.ConnectorNamespace@13.6.1-preview.1.26506.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Aspire.Hosting.Azure.ConnectorNamespace&version=13.6.1-preview.1.26506.6&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Aspire.Hosting.Azure.ConnectorNamespace&version=13.6.1-preview.1.26506.6&prerelease
                    
Install as a Cake Tool

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.
  • WithConnector links 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.
  • WithAccessPolicy grants one explicitly identified Microsoft Entra principal access to a connection.
  • WithIdentityAccessPolicy grants access to a user-assigned managed identity without hard-coding its principal ID.
  • WithAccessPolicy on 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

Feedback & contributing

https://github.com/microsoft/aspire

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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