0

I'm working on managed application that should contain a bot for the teams application.

At the moment the bot resources look like this:

    {
        "type": "Microsoft.BotService/botServices",
        "name": "[concat(parameters('webAppName'), '-bs')]",
        "kind": "azurebot",
        "apiVersion": "2022-06-15-preview",
        "location": "global",
        "sku": {
            "name": "F0"
        },
        "dependsOn": [
            "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('userAssignedIdentityName'))]",
            "[resourceId('Microsoft.Web/sites', variables('webAppName'))]"
        ],
        "properties": {
            "displayName": "[parameters('webAppName')]",
            "msaAppType": "MultiTenant",
            "msaAppId": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('userAssignedIdentityName')), '2018-11-30').clientId]",
            "endpoint": "[concat('https://', parameters('webAppName'), '.azurewebsites.net', '/api/v1/messages')]"
        }
    },
    {
        "type": "Microsoft.BotService/botServices/channels",
        "apiVersion": "2022-06-15-preview",
        "name": "[concat(parameters('webAppName'), '-bs/', '-tc')]",
        "location": "global",
        "sku": {
            "name": "F0"
        },
        "kind": "azurebot",
        "properties": {
            "channelName": "MsTeamsChannel",
            "properties": {
                "isEnabled": true
            }
        },
        "dependsOn": [
            "[resourceId('Microsoft.BotService/botServices', concat(parameters('webAppName'), '-bs'))]"
        ]
    }

The Microsoft.BotService/botServices/channels part is causing the issue:

{
    "status": "Failed",
    "error": {
        "code": "ApplianceDeploymentFailed",
        "message": "The operation to create appliance failed. Please check operations of deployment 'olwa11119' under resource group '/subscriptions/19...truncated...14/resourceGroups/mrg-test_managed_medx_app-previ-20220924201448'. Error message: 'At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.'",
        "details": [
            {
                "code": "BadRequest",
                "message": "{\r\n  \"error\": {\r\n    \"code\": \"CHANNEL_NOT_SUPPORTED\",\r\n    \"message\": \"Channel is not supported\"\r\n  }\r\n}"
            }
        ]
    }
}

Any tips how can i fix this? Thanks in advance.

Oleksa
  • 594
  • 5
  • 19

1 Answers1

0

Eventually with the million tries and fails i have found out what's wrong with the template. To fix this you have to change the "name" of the "Microsoft.BotService/botServices/channels" to "MsTeamsChannel", same as "channelName" in "properties". It's not documented anywhere, even more, documentation is extremely misleading:

string (required)

Character limit: 2-64

Valid characters:
Alphanumerics, underscores, periods, and hyphens.

Start with alphanumeric.

So my working template now looks like this:

{
    "type": "Microsoft.BotService/botServices/channels",
    "apiVersion": "2022-06-15-preview",
    "name": "[concat(parameters('webAppName'), '-bs', '/', 'MsTeamsChannel')]",
    "location": "global",
    "sku": {
        "name": "F0"
    },
    "kind": "azurebot",
    "properties": {
        "channelName": "MsTeamsChannel",
        "properties": {
            "isEnabled": true,
            "acceptedTerms": true
        }
    },
    "dependsOn": [
        "[resourceId('Microsoft.BotService/botServices', concat(parameters('webAppName'), '-bs'))]"
    ]
}

Hope this is going to save lots of time to someone.

Oleksa
  • 594
  • 5
  • 19