[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-3126af4f-0281-464a-9b6a-6fa8f65e5e51":3,"$fqN_3i9KzvIus0NYyTPquALhOstZxzTn948_jc5l7H7s":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"3126af4f-0281-464a-9b6a-6fa8f65e5e51","azure-mgmt-botservice-dotnet","Azure Bot Service的.NET资源管理器SDK。用于创建和管理Azure Bot资源、通道（团队、DirectLine、Slack）以及连接设置的托管平面操作。","cat_coding_devops","mod_coding","sickn33,coding","---\nname: azure-mgmt-botservice-dotnet\ndescription: 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.\nrisk: unknown\nsource: community\ndate_added: '2026-02-27'\n---\n\n# Azure.ResourceManager.BotService (.NET)\n\nManagement plane SDK for provisioning and managing Azure Bot Service resources via Azure Resource Manager.\n\n## Installation\n\n```bash\ndotnet add package Azure.ResourceManager.BotService\ndotnet add package Azure.Identity\n```\n\n**Current Versions**: Stable v1.1.1, Preview v1.1.0-beta.1\n\n## Environment Variables\n\n```bash\nAZURE_SUBSCRIPTION_ID=\u003Cyour-subscription-id>\n# For service principal auth (optional)\nAZURE_TENANT_ID=\u003Ctenant-id>\nAZURE_CLIENT_ID=\u003Cclient-id>\nAZURE_CLIENT_SECRET=\u003Cclient-secret>\n```\n\n## Authentication\n\n```csharp\nusing Azure.Identity;\nusing Azure.ResourceManager;\nusing Azure.ResourceManager.BotService;\n\n\u002F\u002F Authenticate using DefaultAzureCredential\nvar credential = new DefaultAzureCredential();\nArmClient armClient = new ArmClient(credential);\n\n\u002F\u002F Get subscription and resource group\nSubscriptionResource subscription = await armClient.GetDefaultSubscriptionAsync();\nResourceGroupResource resourceGroup = await subscription.GetResourceGroups().GetAsync(\"myResourceGroup\");\n\n\u002F\u002F Access bot collection\nBotCollection botCollection = resourceGroup.GetBots();\n```\n\n## Resource Hierarchy\n\n```\nArmClient\n└── SubscriptionResource\n    └── ResourceGroupResource\n        └── BotResource\n            ├── BotChannelResource (DirectLine, Teams, Slack, etc.)\n            ├── BotConnectionSettingResource (OAuth connections)\n            └── BotServicePrivateEndpointConnectionResource\n```\n\n## Core Workflows\n\n### 1. Create Bot Resource\n\n```csharp\nusing Azure.ResourceManager.BotService;\nusing Azure.ResourceManager.BotService.Models;\n\n\u002F\u002F Create bot data\nvar botData = new BotData(AzureLocation.WestUS2)\n{\n    Kind = BotServiceKind.Azurebot,\n    Sku = new BotServiceSku(BotServiceSkuName.F0),\n    Properties = new BotProperties(\n        displayName: \"MyBot\",\n        endpoint: new Uri(\"https:\u002F\u002Fmybot.azurewebsites.net\u002Fapi\u002Fmessages\"),\n        msaAppId: \"\u003Cyour-msa-app-id>\")\n    {\n        Description = \"My Azure Bot\",\n        MsaAppType = BotMsaAppType.MultiTenant\n    }\n};\n\n\u002F\u002F Create or update the bot\nArmOperation\u003CBotResource> operation = await botCollection.CreateOrUpdateAsync(\n    WaitUntil.Completed, \n    \"myBotName\", \n    botData);\n    \nBotResource bot = operation.Value;\nConsole.WriteLine($\"Bot created: {bot.Data.Name}\");\n```\n\n### 2. Configure DirectLine Channel\n\n```csharp\n\u002F\u002F Get the bot\nBotResource bot = await resourceGroup.GetBots().GetAsync(\"myBotName\");\n\n\u002F\u002F Get channel collection\nBotChannelCollection channels = bot.GetBotChannels();\n\n\u002F\u002F Create DirectLine channel configuration\nvar channelData = new BotChannelData(AzureLocation.WestUS2)\n{\n    Properties = new DirectLineChannel()\n    {\n        Properties = new DirectLineChannelProperties()\n        {\n            Sites = \n            {\n                new DirectLineSite(\"Default Site\")\n                {\n                    IsEnabled = true,\n                    IsV1Enabled = false,\n                    IsV3Enabled = true,\n                    IsSecureSiteEnabled = true\n                }\n            }\n        }\n    }\n};\n\n\u002F\u002F Create or update the channel\nArmOperation\u003CBotChannelResource> channelOp = await channels.CreateOrUpdateAsync(\n    WaitUntil.Completed,\n    BotChannelName.DirectLineChannel,\n    channelData);\n\nConsole.WriteLine(\"DirectLine channel configured\");\n```\n\n### 3. Configure Microsoft Teams Channel\n\n```csharp\nvar teamsChannelData = new BotChannelData(AzureLocation.WestUS2)\n{\n    Properties = new MsTeamsChannel()\n    {\n        Properties = new MsTeamsChannelProperties()\n        {\n            IsEnabled = true,\n            EnableCalling = false\n        }\n    }\n};\n\nawait channels.CreateOrUpdateAsync(\n    WaitUntil.Completed,\n    BotChannelName.MsTeamsChannel,\n    teamsChannelData);\n```\n\n### 4. Configure Web Chat Channel\n\n```csharp\nvar webChatChannelData = new BotChannelData(AzureLocation.WestUS2)\n{\n    Properties = new WebChatChannel()\n    {\n        Properties = new WebChatChannelProperties()\n        {\n            Sites =\n            {\n                new WebChatSite(\"Default Site\")\n                {\n                    IsEnabled = true\n                }\n            }\n        }\n    }\n};\n\nawait channels.CreateOrUpdateAsync(\n    WaitUntil.Completed,\n    BotChannelName.WebChatChannel,\n    webChatChannelData);\n```\n\n### 5. Get Bot and List Channels\n\n```csharp\n\u002F\u002F Get bot\nBotResource bot = await botCollection.GetAsync(\"myBotName\");\nConsole.WriteLine($\"Bot: {bot.Data.Properties.DisplayName}\");\nConsole.WriteLine($\"Endpoint: {bot.Data.Properties.Endpoint}\");\n\n\u002F\u002F List channels\nawait foreach (BotChannelResource channel in bot.GetBotChannels().GetAllAsync())\n{\n    Console.WriteLine($\"Channel: {channel.Data.Name}\");\n}\n```\n\n### 6. Regenerate DirectLine Keys\n\n```csharp\nvar regenerateRequest = new BotChannelRegenerateKeysContent(BotChannelName.DirectLineChannel)\n{\n    SiteName = \"Default Site\"\n};\n\nBotChannelResource channelWithKeys = await bot.GetBotChannelWithRegenerateKeysAsync(regenerateRequest);\n```\n\n### 7. Update Bot\n\n```csharp\nBotResource bot = await botCollection.GetAsync(\"myBotName\");\n\n\u002F\u002F Update using patch\nvar updateData = new BotData(bot.Data.Location)\n{\n    Properties = new BotProperties(\n        displayName: \"Updated Bot Name\",\n        endpoint: bot.Data.Properties.Endpoint,\n        msaAppId: bot.Data.Properties.MsaAppId)\n    {\n        Description = \"Updated description\"\n    }\n};\n\nawait bot.UpdateAsync(updateData);\n```\n\n### 8. Delete Bot\n\n```csharp\nBotResource bot = await botCollection.GetAsync(\"myBotName\");\nawait bot.DeleteAsync(WaitUntil.Completed);\n```\n\n## Supported Channel Types\n\n| Channel | Constant | Class |\n|---------|----------|-------|\n| Direct Line | `BotChannelName.DirectLineChannel` | `DirectLineChannel` |\n| Direct Line Speech | `BotChannelName.DirectLineSpeechChannel` | `DirectLineSpeechChannel` |\n| Microsoft Teams | `BotChannelName.MsTeamsChannel` | `MsTeamsChannel` |\n| Web Chat | `BotChannelName.WebChatChannel` | `WebChatChannel` |\n| Slack | `BotChannelName.SlackChannel` | `SlackChannel` |\n| Facebook | `BotChannelName.FacebookChannel` | `FacebookChannel` |\n| Email | `BotChannelName.EmailChannel` | `EmailChannel` |\n| Telegram | `BotChannelName.TelegramChannel` | `TelegramChannel` |\n| Telephony | `BotChannelName.TelephonyChannel` | `TelephonyChannel` |\n\n## Key Types Reference\n\n| Type | Purpose |\n|------|---------|\n| `ArmClient` | Entry point for all ARM operations |\n| `BotResource` | Represents an Azure Bot resource |\n| `BotCollection` | Collection for bot CRUD |\n| `BotData` | Bot resource definition |\n| `BotProperties` | Bot configuration properties |\n| `BotChannelResource` | Channel configuration |\n| `BotChannelCollection` | Collection of channels |\n| `BotChannelData` | Channel configuration data |\n| `BotConnectionSettingResource` | OAuth connection settings |\n\n## BotServiceKind Values\n\n| Value | Description |\n|-------|-------------|\n| `BotServiceKind.Azurebot` | Azure Bot (recommended) |\n| `BotServiceKind.Bot` | Legacy Bot Framework bot |\n| `BotServiceKind.Designer` | Composer bot |\n| `BotServiceKind.Function` | Function bot |\n| `BotServiceKind.Sdk` | SDK bot |\n\n## BotServiceSkuName Values\n\n| Value | Description |\n|-------|-------------|\n| `BotServiceSkuName.F0` | Free tier |\n| `BotServiceSkuName.S1` | Standard tier |\n\n## BotMsaAppType Values\n\n| Value | Description |\n|-------|-------------|\n| `BotMsaAppType.MultiTenant` | Multi-tenant app |\n| `BotMsaAppType.SingleTenant` | Single-tenant app |\n| `BotMsaAppType.UserAssignedMSI` | User-assigned managed identity |\n\n## Best Practices\n\n1. **Always use `DefaultAzureCredential`** — supports multiple auth methods\n2. **Use `WaitUntil.Completed`** for synchronous operations\n3. **Handle `RequestFailedException`** for API errors\n4. **Use async methods** (`*Async`) for all operations\n5. **Store MSA App credentials securely** — use Key Vault for secrets\n6. **Use managed identity** (`BotMsaAppType.UserAssignedMSI`) for production bots\n7. **Enable secure sites** for DirectLine channels in production\n\n## Error Handling\n\n```csharp\nusing Azure;\n\ntry\n{\n    var operation = await botCollection.CreateOrUpdateAsync(\n        WaitUntil.Completed, \n        botName, \n        botData);\n}\ncatch (RequestFailedException ex) when (ex.Status == 409)\n{\n    Console.WriteLine(\"Bot already exists\");\n}\ncatch (RequestFailedException ex)\n{\n    Console.WriteLine($\"ARM Error: {ex.Status} - {ex.ErrorCode}: {ex.Message}\");\n}\n```\n\n## Related SDKs\n\n| SDK | Purpose | Install |\n|-----|---------|---------|\n| `Azure.ResourceManager.BotService` | Bot management (this SDK) | `dotnet add package Azure.ResourceManager.BotService` |\n| `Microsoft.Bot.Builder` | Bot Framework SDK | `dotnet add package Microsoft.Bot.Builder` |\n| `Microsoft.Bot.Builder.Integration.AspNet.Core` | ASP.NET Core integration | `dotnet add package Microsoft.Bot.Builder.Integration.AspNet.Core` |\n\n## Reference Links\n\n| Resource | URL |\n|----------|-----|\n| NuGet Package | https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FAzure.ResourceManager.BotService |\n| API Reference | https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fapi\u002Fazure.resourcemanager.botservice |\n| GitHub Source | https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-net\u002Ftree\u002Fmain\u002Fsdk\u002Fbotservice\u002FAzure.ResourceManager.BotService |\n| Azure Bot Service Docs | https:\u002F\u002Flearn.microsoft.com\u002Fazure\u002Fbot-service\u002F |\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,232,1415,"2026-05-16 13:07:01",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"DevOps","devops","mdi-cog-outline","CI\u002FCD、容器化、部署运维",3,162,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"79f9486d-444e-4182-ba93-8b42d23b9b32","1.0.0","azure-mgmt-botservice-dotnet.zip",3135,"uploads\u002Fskills\u002F3126af4f-0281-464a-9b6a-6fa8f65e5e51\u002Fazure-mgmt-botservice-dotnet.zip","fcc365ca9da14e1536b334138c9b29fd6c01eed3d08d8e98f4bf78522f84a85a","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":10002}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]