Unable to publish my bot built with Bot Framework Composer
I'm using the Bot Framework Composer to build my first chatbot.
I've been able to build on the Composer and test on Emulator. But I could not find a way to publish it.
According to the guidance on how-to-publish-bot, I'm getting stuck on the 3rd step of creating resources. The error I got is shown in the image below.
Please help or give suggestions. Thank you!
To be more specific, I'm trying to publish the bot to Azure Web App
The command I use is as below:
node provisionComposer.js --subscriptionId=<YOUR AZURE SUBSCRIPTION ID> --name=<NAME OF YOUR RESOURCE GROUP> --appPassword=<APP PASSWORD> --environment=<NAME FOR ENVIRONMENT DEFAULT to dev>
name I've tried both my current resource group name. as well as a new resource group that I create separately. Both will lead to the same error.
environment here is set as
dev by default.
appPassword is a series of characters I created by my own following the password regulations.
@John To debug this issue, could you please check on Azure portal if the resource group and app is created? I think the provisioning and validation of your resources have failed and you can lookup the details of these activities in the activity from the Azure portal by clicking the notification icon which takes you to activity log to view more details of the failure.
Thanks for the reply.
Well, I have created my resource group and I can find my app on the LUIS portal, but no bot not can be found on azure portal. The app on LUIS portal is updated every time I make changes of my bot in the bot framework composer. And I can publish the app the on LUIS portal. but again, that is only applied to my app on LUIS web portal, not azure portal.
@John I have tried this provisioning scenario and it worked fine in this case. I think the problem with your setup could be that the DeploymentTemplates folder which has the ARM templates is unable to run or validate the deployment as it is failing at lookup the template file path which is file template-with-preexisting-rg.json inside DeploymentTemplates folder. Could you please cross check if all the files are available and access is setup and re-run the scenario?
Also, i dont see the tenant id in your message, which is shown when you actually login using https://microsoft.com/devicelogin and keyin the code displayed on the console. Please check if this step is also completed.
@John Using the login method from browser should work if you are not using any blockers on it. Since you have passed the tenant id directly the next step is to get the parameters passed from command line and validate them. You can add a logger at getDeploymentTemplateParam() to check the parameters along with validateDeployment() to give us more information.
Also, do you see any information in the activity log of your azure account? This would have more details of any errors from provisioning perspective like, restricted access to create resources in your subscription because this might not be handled by the script.
Thanks for the suggestion, I am able to log the error. I think I run into the error one step away from passing the parameters into getDeploymentTemplateParam(), I'm getting stuck at the step of creating a new resource group. But no matter what "name" parameter I write in the command, either an existing resource group or a virtual non-existed resource group, the result is the same.
As you can see in the screenshots, I added the highlighted code in the logger, and it shows the corresponding info in the terminal.
As for the activity log of my azure account, no activities logged so far.
@John Thanks for the details. Yes, since the authentication is not happening correctly the activity log is showing no detail. I am hoping you completed the web browser login with the code that is mentioned on screen before hitting enter on this console.
From the looks of it, I think this is a failing to instantiate the client by getting the credentials after you login from browser. The npm package @azure/arm-resources is used to authenticate and create the resource group first, If the package is not installed the error would be apparent on console. Could you please try a different browser to login and authenticate with the code given on a normal browser window without hardcoding the tenant id in the script?
Well, actually now I have deleted my hard-coded tenant id in the script, and it can properly use my tenant id, which was not the case before. Anyway, I used different browsers (Chrome/Safari/Firefox), but all failed at creating resource group stage...
I agree that there may be a failure to instantiate the client, but I check the npm, it is properly installed and its version is 6.14.6
Feeling weird and confused...
@John Is it possible to try this scenario from a different machine? I believe the user you login in with has all access to create resources.
I tried on my windows laptop yesterday, the wired thing happened, which is the "user not found" error happened again when I finished designing a new bot! When I copy my provisionComposer.js file from my Mac to my windows, that error disappeared, and it could correctly use my tenant ID, but the same error on my Mac happened, which cannot create a new resource group.
In a nutshell, I think there is something wrong with my provisionComposer.js I guess. If convenient, could you send me a copy of your provisionComposer.js which can successfully be implemented?
I am having the issue above too where it is not using my tenant ID. What is the solution?
Sign in to comment