Publish a Bot created in Bot framework Composer using Azure CLI

420 views Asked by At

I created a bot in Bot framework Composer, it works fine locally and using Bot Framework emulator, and when I publish it using the Composer publish features it works fine. But I need to publish the bot using Azure CLI, I tried following the steps in this doc: https://learn.microsoft.com/en-us/azure/bot-service/provision-and-publish-a-bot?view=azure-bot-service-4.0&tabs=multitenant%2Ccsharp#create-resource-groups

I created an app registration, a web app and a bot. but when I try to access the bot using the "web chat" feature in the Azure portal I get error "There was an error sending this message to your bot: HTTP status code NotFound".

These are the commands I used to create the resources and publish the bot:

Create App registration and secret:

 az ad app create --display-name "test" --sign-in-audience "AzureADandPersonalMicrosoftAccount" 

 az ad app credential reset --id "<app_id>"

Create Web app:

 az deployment group create --resource-group "test" --template-file "C:\..\template-BotApp-with-rg.json" --parameters "@C:\..\parameters-for-template-BotApp-with-rg.json"

Create Azure Bot:

 az deployment group create --resource-group "test" --template-file "C:\..\template-AzureBot-with-rg.json" --parameters "@C:\..\parameters-for-template-AzureBot-with-rg.json"

Prepare deployment and publish to Azure bot:

 az bot prepare-deploy --lang Csharp --code-dir "C:\" --proj-file-path "C:\..\test.csproj"

 az webapp deployment source config-zip --resource-group "test" --name "test" --src "C:\..\test.zip"

I got the templates files from here: https://github.com/microsoft/botbuilder-dotnet/tree/main/generators/dotnet-templates/Microsoft.BotFramework.CSharp.EchoBot/content/DeploymentTemplates/DeployUseExistResourceGroup

I updated the appsettings.json with AppID and password, and I copied the .sln file to the root folder then zipped the root folder:

1

There are 1 answers

2
Tarun Krishna On
  • According to my research there are different way to deploy

enter image description here

  • As the above picture mansions User-assigned manage will Support Azure bot service C# JavaScript SDKs
  • The single-tenant will support Azure Bot and C# and JavaScript SDKs
  • The Multi-tenant Support Azure Bot Service, all frameworks SDK language, composer the Emulator and Ngok.

-Make sure you are using setting which are used for specific deployment in the document.

enter image description here

enter image description here

enter image description here

enter image description here