Skip to main content
skill CX Codex

azure-mgmt-botservice-dotnet — Claude Code skill

azure-mgmt-botservice-dotnet — a skill for provisioning and configuring Azure Bot Service via Resource Manager API: bots, DirectLine and Teams channels, OAuth connections.

MIT ★ 3,232 updated 2026-10-23

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add microsoft/skills --skill azure-mgmt-botservice-dotnet -a claude-code
Open on GitHub

What azure-mgmt-botservice-dotnet does

The skill provides management operations for Azure bots: create BotResource, configure channels (DirectLine, Teams, Slack, Web Chat), attach OAuth connections. Uses .NET packages Azure.ResourceManager.BotService and Azure.Identity.

Includes workflows for bot provisioning, channel setup with parameters (V3, secure sites for DirectLine; calling for Teams), DirectLine key regeneration. Authentication via DefaultAzureCredential or a specific credential (managed identity, service principal). Requires AZURE_SUBSCRIPTION_ID; service principal auth needs tenant, client ID and secret as well.

Operates on the hierarchy: subscription → resource group → bot → channels. Each channel is configured with a dedicated object (DirectLineChannel, MsTeamsChannel). Deletion and description updates included.

What it helps with

  • provision Azure bot and set endpoint via Resource Manager API
  • attach DirectLine or Teams channel to an existing bot
  • regenerate DirectLine access keys for a site
  • list channels configured for a bot

Example prompts for the agent

  • Create Azure bot named MyBot, endpoint https://mybot.azurewebsites.net/api/messages, MSA App ID from environment
  • Configure DirectLine channel for bot myBotName, enable V3, disable V1, allow secure sites only
  • List all channels for bot myBotName and their status

How to install azure-mgmt-botservice-dotnet

1Skills CLI (Vercel)

npx skills add microsoft/skills --skill azure-mgmt-botservice-dotnet -a claude-code

2Manually: put the files in place

~/.claude/skills/azure-mgmt-botservice-dotnet/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/azure-mgmt-botservice-dotnet/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about azure-mgmt-botservice-dotnet

How to install azure-mgmt-botservice-dotnet in Claude Code?

Run npx skills add microsoft/skills --skill azure-mgmt-botservice-dotnet -a claude-code, then check ~/.claude/skills/azure-mgmt-botservice-dotnet/SKILL.md.

What does azure-mgmt-botservice-dotnet do?

The skill provisions and configures Azure Bot Service bots: create resources, attach channels (DirectLine, Teams, Slack), manage OAuth connections via Resource Manager API.

What environment variables does the skill require?

AZURE_SUBSCRIPTION_ID is required. For service principal auth, add AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET. For production with DefaultAzureCredential, set AZURE_TOKEN_CREDENTIALS=prod.

Source text

SKILL.md · MIT
---
name: azure-mgmt-botservice-dotnet
description: |
  Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings. Triggers: "Bot Service", "BotResource", "Azure Bot", "DirectLine channel", "Teams channel", "bot management .NET", "create bot".
license: MIT
metadata:
  author: Microsoft
  version: "1.0.0"
  package: Azure.ResourceManager.BotService
---

# Azure.ResourceManager.BotService (.NET)

Management plane SDK for provisioning and managing Azure Bot Service resources via Azure Resource Manager.

## Installation

```bash
dotnet add package Azure.ResourceManager.BotService
dotnet add package Azure.Identity
```

**Current Versions**: Stable v1.1.1, Preview v1.1.0-beta.1

## Environment Variables

```bash
AZURE_SUBSCRIPTION_ID=<your-subscription-id> # Required: Azure subscription ID
AZURE_TOKEN_CREDENTIALS=prod  # Required only if DefaultAzureCredential is used in production
AZURE_TENANT_ID=<tenant-id> # For service principal auth (optional)
AZURE_CLIENT_ID=<client-id> # For service principal auth (optional)
AZURE_CLIENT_SECRET=<client-secret> # For service principal auth (optional)
```

## Authentication

```csharp
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.BotService;

// Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
var credential = new DefaultAzureCredential(
    DefaultAzureCredential.DefaultEnvironmentVariableName
);
// Or use a specific credential directly in production:
// See https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#credential-classes
// var credential = new ManagedIdentityCredential();
ArmClient armClient = new ArmClient(credential);

// Get subscription and resource group
SubscriptionResource subscription = await armClient.GetDefaultSubscriptionAsync();
ResourceGroupResource resourceGroup = await subscription.GetResourceGroups().GetAsync("myResourceGroup");

// Access bot collection
BotCollection botCollection = resourceGroup.GetBots();
```

## Resource Hierarchy

```
ArmClient
└── SubscriptionResource
    └── ResourceGroupResource
        └── BotResource
            ├── BotChannelResource (DirectLine, Teams, Slack, etc.)
            ├── BotConnectionSettingResource (OAuth connections)
            └── BotServicePrivateEndpointConnectionResource
```

## Core Workflows

### 1. Create Bot Resource

```csharp
using Azure.ResourceManager.BotService;
using Azure.ResourceManager.BotService.Models;

// Create bot data
var botData = new BotData(AzureLocation.WestUS2)
{
    Kind = BotServiceKind.Azurebot,
    Sku = new BotServiceSku(BotServiceSkuName.F0),
    Properties = new BotProperties(
        displayName: "MyBot",
        endpoint: new Uri("https://mybot.azurewebsites.net/api/messages"),
        msaAppId: "<your-msa-app-id>")
    {
        Description = "My Azure Bot",
        MsaAppType = BotMsaAppType.MultiTenant
    }
};

// Create or update the bot
ArmOperation<BotResource> operation = await botCollection.CreateOrUpdateAsync(
    WaitUntil.Completed, 
    "myBotName", 
    botData);
    
BotResource bot = operation.Value;
Console.WriteLine($"Bot created: {bot.Data.Name}");
```

### 2. Configure DirectLine Channel

```csharp
// Get the bot
BotResource bot = await resourceGroup.GetBots().GetAsync("myBotName");

// Get channel collection
BotChannelCollection channels = bot.GetBotChannels();

// Create DirectLine channel configuration
var channelData = new BotChannelData(AzureLocation.WestUS2)
{
    Properties = new DirectLineChannel()
    {
        Properties = new DirectLineChannelProperties()
        {
            Sites = 
            {
                new DirectLineSite("Default Site")
                {
                    IsEnabled = true,
                    IsV1Enabled = false,
                    IsV3Enabled = true,
                    IsSecureSiteEnabled = true
                }
            }
        }
    }
};

// Create or update the channel
ArmOperation<BotChannelResource> channelOp = await channels.CreateOrUpdateAsync(
    WaitUntil.Completed,
    BotChannelName.DirectLineChannel,
    channelData);

Console.WriteLine("DirectLine channel configured");
```

### 3. Configure Microsoft Teams Channel

```csharp
var teamsChannelData = new BotChannelData(AzureLocation.WestUS2)
{
    Properties = new MsTeamsChannel()
    {
        Properties = new MsTeamsChannelProperties()
        {
            IsEnabled = true,
            EnableCalling = false
        }
    }
};

await channels.CreateOrUpdateAsync(
    WaitUntil.Completed,
    BotChannelName.MsTeamsChannel,
    teamsChannelData);
```

### 4. Configure Web Chat Channel

```csharp
var webChatChannelData = new BotChannelData(AzureLocation.WestUS2)
{
    Properties = new WebChatChannel()
    {
        Properties = new WebChatChannelProperties()
        {
            Sites =
            {
                new WebChatSite("Default Site")
                {
                    IsEnabled = true
                }
            }
        }
    }
};

await channels.CreateOrUpdateAsync(
    WaitUntil.Completed,
    BotChannelName.WebChatChannel,
    webChatChannelData);
```

### 5. Get Bot and List Channels

```csharp
// Get bot
BotResource bot = await botCollection.GetAsync("myBotName");
Console.WriteLine($"Bot: {bot.Data.Properties.DisplayName}");
Console.WriteLine($"Endpoint: {bot.Data.Properties.Endpoint}");

// List channels
await foreach (BotChannelResource channel in bot.GetBotChannels().GetAllAsync())
{
    Console.WriteLine($"Channel: {channel.Data.Name}");
}
```

### 6. Regenerate DirectLine Keys

```csharp
var regenerateRequest = new BotChannelRegenerateKeysContent(BotChannelName.DirectLineChannel)
{
    SiteName = "Default Site"
};

BotChannelResource channelWithKeys = await bot.GetBotChannelWithRegenerateKeysAsync(regenerateRequest);
```

### 7. Update Bot

```csharp
BotResource bot = await botCollection.GetAsync("myBotName");

// Update using patch
var updateData = new BotData(bot.Data.Location)
{
    Properties = new BotProperties(
        displayName: "Updated Bot Name",
        endpoint: bot.Data.Properties.Endpoint,
        msaAppId: bot.Data.Properties.MsaAppId)
    {
        Description = "Updated description"
    }
};

await bot.UpdateAsync(updateData);
```

### 8. Delete Bot

```csharp
BotResource bot = await botCollection.GetAsync("myBotName");
await bot.DeleteAsync(WaitUntil.Completed);
```

## Supported Channel Types

| Channel | Constant | Class |
|---------|----------|-------|
| Direct Line | `BotChannelName.DirectLineChannel` | `DirectLineChannel` |
| Direct Line Speech | `BotChannelName.DirectLineSpeechChannel` | `DirectLineSpeechChannel` |
| Microsoft Teams | `BotChannelName.MsTeamsChannel` | `MsTeamsChannel` |
| Web Chat | `BotChannelName.WebChatChannel` | `WebChatChannel` |
| Slack | `BotChannelName.SlackChannel` | `SlackChannel` |
| Facebook | `BotChannelName.FacebookChannel` | `FacebookChannel` |
| Email | `BotChannelName.EmailChannel` | `EmailChannel` |
| Telegram | `BotChannelName.TelegramChannel` | `TelegramChannel` |
| Telephony | `BotChannelName.TelephonyChannel` | `TelephonyChannel` |

## Key Types Reference

| Type | Purpose |
|------|---------|
| `ArmClient` | Entry point for all ARM operations |
| `BotResource` | Represents an Azure Bot resource |
| `BotCollection` | Collection for bot CRUD |
| `BotData` | Bot resource definition |
| `BotProperties` | Bot configuration properties |
| `BotChannelResource` | Channel configuration |
| `BotChannelCollection` | Collection of channels |
| `BotChannelData` | Channel configuration data |
| `BotConnectionSettingResource` | OAuth connection settings |

## BotServiceKind Values

| Value | Description |
|-------|-------------|
| `BotServiceKind.Azurebot` | Azure Bot (recommended) |
| `BotServiceKind.Bot` | Legacy Bot Framework bot |
| `BotServiceKind.Designer` | Composer bot |
| `BotServiceKind.Function` | Function bot |
| `BotServiceKind.Sdk` | SDK bot |

## BotServiceSkuName Values

| Value | Description |
|-------|-------------|
| `BotServiceSkuName.F0` | Free tier |
| `BotServiceSkuName.S1` | Standard tier |

## BotMsaAppType Values

| Value | Description |
|-------|-------------|
| `BotMsaAppType.MultiTenant` | Multi-tenant app |
| `BotMsaAppType.SingleTenant` | Single-tenant app |
| `BotMsaAppType.UserAssignedMSI` | User-assigned managed identity |

## Best Practices

1. **Use `DefaultAzureCredential`** — supports multiple auth methods
2. **Use `WaitUntil.Completed`** for synchronous operations
3. **Handle `RequestFailedException`** for API errors
4. **Use async methods** (`*Async`) for all operations
5. **Store MSA App credentials securely** — use Key Vault for secrets
6. **Use managed identity** (`BotMsaAppType.UserAssignedMSI`) for production bots
7. **Enable secure sites** for DirectLine channels in production

## Error Handling

```csharp
using Azure;

try
{
    var operation = await botCollection.CreateOrUpdateAsync(
        WaitUntil.Completed, 
        botName, 
        botData);
}
catch (RequestFailedException ex) when (ex.Status == 409)
{
    Console.WriteLine("Bot already exists");
}
catch (RequestFailedException ex)
{
    Console.WriteLine($"ARM Error: {ex.Status} - {ex.ErrorCode}: {ex.Message}");
}
```

## Related SDKs

| SDK | Purpose | Install |
|-----|---------|---------|
| `Azure.ResourceManager.BotService` | Bot management (this SDK) | `dotnet add package Azure.ResourceManager.BotService` |
| `Microsoft.Bot.Builder` | Bot Framework SDK | `dotnet add package Microsoft.Bot.Builder` |
| `Microsoft.Bot.Builder.Integration.AspNet.Core` | ASP.NET Core integration | `dotnet add package Microsoft.Bot.Builder.Integration.AspNet.Core` |

## Reference Links

| Resource | URL |
|----------|-----|
| NuGet Package | https://www.nuget.org/packages/Azure.ResourceManager.BotService |
| API Reference | https://learn.microsoft.com/dotnet/api/azure.resourcemanager.botservice |
| GitHub Source | https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/botservice/Azure.ResourceManager.BotService |
| Azure Bot Service Docs | https://learn.microsoft.com/azure/bot-service/ |

© Microsoft · MIT · microsoft/skills

Similar skills

All skills for Cloud: AWS, Azure, GCP →

From the same set250

The whole set →
azure-resource-manager-durabletask-dotnet azure-resource-manager-durabletask-dotnet guides the agent in provisioning Azure Durable Task Schedulers, Task Hubs, and retention rules via the .NET ARM SDK. Fits infrastructure automation workflows. CX Codex +1 ★ 3,232repo stars azure-mgmt-weightsandbiases-dotnet azure-mgmt-weightsandbiases-dotnet — a skill that walks the agent through deploying and managing Weights & Biases instances in Azure, including Entra ID single sign-on. CX Codex +1 ★ 3,232repo stars azure-mgmt-mongodbatlas-dotnet azure-mgmt-mongodbatlas-dotnet guides .NET development with Azure.ResourceManager.MongoDBAtlas to manage MongoDB Atlas organizations as Azure ARM resources with unified billing. CX Codex +1 ★ 3,232repo stars azure-mgmt-fabric-dotnet The azure-mgmt-fabric-dotnet skill guides .NET code for managing Microsoft Fabric capacities through Azure Resource Manager. Use it when provisioning capacity, changing its SKU, or suspending and resuming it. CX Codex +1 ★ 3,232repo stars azure-mgmt-arizeaiobservabilityeval-dotnet The azure-mgmt-arizeaiobservabilityeval-dotnet skill guides AI agents in using the Azure.ResourceManager.ArizeAIObservabilityEval .NET SDK to manage Arize AI organizations and Marketplace plans in Azure. CX Codex +1 ★ 3,232repo stars azure-mgmt-applicationinsights-dotnet azure-mgmt-applicationinsights-dotnet — a skill for managing Azure Application Insights resources from .NET code. Creates components, web tests, workbooks, API keys, and retrieves connection strings. CX Codex +1 ★ 3,232repo stars azure-mgmt-apimanagement-dotnet azure-mgmt-apimanagement-dotnet is a Claude Code and GitHub Copilot skill for provisioning Azure API Management with the .NET SDK through Azure Resource Manager. CX Codex +1 ★ 3,232repo stars azure-mgmt-apicenter-dotnet azure-mgmt-apicenter-dotnet equips AI coding agents to write .NET code for Azure API Center using the official Azure.ResourceManager.ApiCenter management SDK. CX Codex +1 ★ 3,232repo stars

Project sponsors

Companies that keep this analytics open