Manage Azure Bot Service Resources
.NET management SDK for provisioning Azure Bot Service resources and configuring channels like Teams, DirectLine, and Slack.
Why it matters
Automate the provisioning and management of Azure Bot Service resources, including creating bots, configuring channels, and managing settings, all through code.
Outcomes
What it gets done
Create and update Azure Bot resources.
Configure DirectLine, Microsoft Teams, and Web Chat channels.
Manage bot properties and settings.
Delete Azure Bot resources.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-azure-mgmt-botservice-dotnet | bash Overview
Azure.ResourceManager.BotService (.NET)
.NET management SDK for Azure Bot Service, covering bot resource provisioning (kind, SKU, MSA app configuration), channel setup for DirectLine/Teams/Web Chat and six other channel types, key regeneration, and bot lifecycle management via Azure Resource Manager. Use when provisioning or automating Azure Bot Service resources - bot registrations and messaging channels - as infrastructure, separate from the bot's conversation logic.
What it does
This skill provisions and manages Azure Bot Service resources via Azure Resource Manager using Azure.ResourceManager.BotService (stable v1.1.1) plus Azure.Identity for DefaultAzureCredential auth through an ArmClient. The resource hierarchy is ArmClient → SubscriptionResource → ResourceGroupResource → BotResource, which owns BotChannelResources (DirectLine, Teams, Slack, etc.), BotConnectionSettingResources (OAuth connections), and private endpoint connections. Creating a bot (BotData) specifies a location, a BotServiceKind (Azurebot is recommended over the legacy Bot/Designer/Function/Sdk kinds), a BotServiceSku (F0 free tier or S1 standard), and BotProperties with a display name, messaging endpoint URL, MSA app ID, and BotMsaAppType (MultiTenant, SingleTenant, or UserAssignedMSI for production managed-identity bots). Channel configuration is shown for three of the nine supported channel types - DirectLine (with per-site settings: enabled, V1/V3 protocol version, secure-site enforcement), Microsoft Teams (enabled flag, calling support), and Web Chat (per-site enabled flag) - via BotChannelData keyed to a BotChannelName constant; the other six supported channels (Direct Line Speech, Slack, Facebook, Email, Telegram, Telephony) follow the same BotChannelData/channel-specific properties pattern. Operational workflows cover fetching a bot and listing its configured channels, regenerating DirectLine channel keys for a specific site, updating a bot's properties (display name, description) via a patch-style BotData update, and deleting a bot entirely. Error handling distinguishes a 409 (bot already exists) from other RequestFailedExceptions, surfacing the ARM error code and message. Best practices: always use DefaultAzureCredential for multi-method auth support, use WaitUntil.Completed for synchronous long-running operations, use the async (*Async) method variants throughout, store MSA app credentials in Key Vault rather than inline, use BotMsaAppType.UserAssignedMSI for production bots, and enable secure sites for DirectLine channels in production.
When to use - and when NOT to
Use this skill when provisioning or automating Azure Bot Service resources - creating a bot registration, wiring it to messaging channels like Teams/DirectLine/Slack/WebChat, rotating channel keys, or managing bot lifecycle (update/delete) via infrastructure-as-code or automation scripts. It is not the conversational bot-building SDK itself - actual message handling, dialogs, and bot logic belong to Microsoft.Bot.Builder and its ASP.NET Core integration package, which this management SDK complements rather than replaces.
Inputs and outputs
Input is bot configuration (display name, messaging endpoint, MSA app ID/type, SKU) and per-channel settings (site configuration, enabled flags). Output is provisioned BotResource/BotChannelResource objects, listed channel configurations, and regenerated DirectLine keys, with target subscription and service-principal details configured via AZURE_SUBSCRIPTION_ID, AZURE_TENANT_ID, AZURE_CLIENT_ID, and AZURE_CLIENT_SECRET.
Integrations
Built on Azure Resource Manager via Azure.ResourceManager.BotService, authenticated with Azure Identity's DefaultAzureCredential, complementary to Microsoft.Bot.Builder (the Bot Framework SDK) and its ASP.NET Core integration package for the actual bot conversation logic.
dotnet add package Azure.ResourceManager.BotService
Who it's for
.NET developers and platform teams provisioning and configuring Azure Bot Service resources - bot registrations, messaging channels, and connection settings - as infrastructure, separate from the conversational bot logic itself.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.