New to Claude Skills? Learn how to install them →

Asickn33 on GitHub

Azure Bot Service SDK

Free

Manage Azure Bot resources seamlessly in .NET.

Get this skill

Free · Opens the source repo

What Azure Bot Service SDK does

The Azure.ResourceManager.BotService SDK for .NET provides a management plane for provisioning and managing Azure Bot Service resources through Azure Resource Manager. This SDK enables developers to create, update, and delete bot resources and configure channels such as Microsoft Teams, DirectLine, and Slack. It simplifies the process of managing bot connections and settings, allowing for a more streamlined development experience.

To get started, you can install the SDK using the .NET package manager. The SDK requires authentication via Azure credentials, which can be set up using environment variables. Once authenticated, developers can easily access their Azure subscriptions and resource groups to manage bots and their associated channels. The hierarchical structure of resources allows for organized management of bots and their configurations.

Key workflows supported by the SDK include creating bot resources, configuring various channels, listing existing channels, and updating or deleting bots. Each operation is straightforward, with clear examples provided for common tasks. This makes it an excellent choice for developers looking to integrate Azure Bot Service into their applications efficiently.

This SDK is particularly beneficial for developers and teams working with Azure to build conversational AI applications. It abstracts the complexities of directly interfacing with Azure's REST APIs, allowing for a more intuitive programming experience.

When to use it

Use this SDK when you need to manage Azure Bot Service resources programmatically in a .NET application.

When not to use it

This SDK is not suitable for non-.NET environments or for users who require a graphical interface for managing Azure resources.

What you can build with it

Creating a New Bot

Use the SDK to programmatically create a new bot resource with specified settings and properties.

Configuring Channels for a Bot

Easily set up various communication channels for your bot, such as DirectLine or Microsoft Teams.

Updating Existing Bots

Modify the properties of existing bot resources to reflect changes in functionality or branding.

How to install Azure Bot Service SDK

View source

1. Install with the skills CLI

npx skills add sickn33/agentic-awesome-skills/azure-mgmt-botservice-dotnet --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by sickn33

Azure.ResourceManager.BotService (.NET)

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

Installation

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

AZURE_SUBSCRIPTION_ID=<your-subscription-id>
# For service principal auth (optional)
AZURE_TENANT_ID=<tenant-id>
AZURE_CLIENT_ID=<client-id>
AZURE_CLIENT_SECRET=<client-secret>

Authentication

using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.BotService;

// Authenticate using DefaultAzureCredential
var credential = new DefaultAzureCredential();
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

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

// 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

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

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

// 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

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

BotChannelResource channelWithKeys = await bot.GetBotChannelWithRegenerateKeysAsync(regenerateRequest);

7. Update Bot

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

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

Supported Channel Types

ChannelConstantClass
Direct LineBotChannelName.DirectLineChannelDirectLineChannel
Direct Line SpeechBotChannelName.DirectLineSpeechChannelDirectLineSpeechChannel
Microsoft TeamsBotChannelName.MsTeamsChannelMsTeamsChannel
Web ChatBotChannelName.WebChatChannelWebChatChannel
SlackBotChannelName.SlackChannelSlackChannel
FacebookBotChannelName.FacebookChannelFacebookChannel
EmailBotChannelName.EmailChannelEmailChannel
TelegramBotChannelName.TelegramChannelTelegramChannel
TelephonyBotChannelName.TelephonyChannelTelephonyChannel

Key Types Reference

TypePurpose
ArmClientEntry point for all ARM operations
BotResourceRepresents an Azure Bot resource
BotCollectionCollection for bot CRUD
BotDataBot resource definition
BotPropertiesBot configuration properties
BotChannelResourceChannel configuration
BotChannelCollectionCollection of channels
BotChannelDataChannel configuration data
BotConnectionSettingResourceOAuth connection settings

BotServiceKind Values

ValueDescription
BotServiceKind.AzurebotAzure Bot (recommended)
BotServiceKind.BotLegacy Bot Framework bot
BotServiceKind.DesignerComposer bot
BotServiceKind.FunctionFunction bot
BotServiceKind.SdkSDK bot

BotServiceSkuName Values

ValueDescription
BotServiceSkuName.F0Free tier
BotServiceSkuName.S1Standard tier

BotMsaAppType Values

ValueDescription
BotMsaAppType.MultiTenantMulti-tenant app
BotMsaAppType.SingleTenantSingle-tenant app
BotMsaAppType.UserAssignedMSIUser-assigned managed identity

Best Practices

  1. Always 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

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

SDKPurposeInstall
Azure.ResourceManager.BotServiceBot management (this SDK)dotnet add package Azure.ResourceManager.BotService
Microsoft.Bot.BuilderBot Framework SDKdotnet add package Microsoft.Bot.Builder
Microsoft.Bot.Builder.Integration.AspNet.CoreASP.NET Core integrationdotnet add package Microsoft.Bot.Builder.Integration.AspNet.Core

Reference Links

ResourceURL
NuGet Packagehttps://www.nuget.org/packages/Azure.ResourceManager.BotService
API Referencehttps://learn.microsoft.com/dotnet/api/azure.resourcemanager.botservice
GitHub Sourcehttps://github.com/Azure/azure-sdk-for-net/tree/main/sdk/botservice/Azure.ResourceManager.BotService
Azure Bot Service Docshttps://learn.microsoft.com/azure/bot-service/

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Frequently asked questions about Azure Bot Service SDK

Similar skills