I've deployed a bot framework chatbot as an app service. Everything is working fine. I was able to connect it bot framework emulator using ngrok. But when I'm trying to use the test in the web chat option it shows nothing. What causing this problem? Do I need to configure tunneling on azure chat bot as well?
I have configured appsettings.json by providing the required values. And I have created a secret key using key vault and added as the password as well.
Deployment method:
Created an app service and deployed directly from the vs code.
Update: I have checked the logs on the azure bot service.It shows the error as There was an error sending this message to your bot: HTTP status code InternalServerError.
I have deployed a sample Weather bot to azure using below steps
This worked in my local system as below.
Now we need to deploy from the Bot to the Azure portal. To do this, follow these steps:
On the left corner -> Click Publish and select manage profile as below.
Select Add new as below.
Click on Crate new resource and then click on Next as below.
Give all the details as below and click on Next.
After creating the manage profile and select the name of the app which you have created in the above steps as below.
Select the app you have created and select the bot as below and click on publish selected bots.
After deploying the Bot App navigate to Bot App which you have deployed in your selected resource Group -> Click on Test in web Chat as below.
Related
I have created a Blazor WebAssembly app with a server backend using Identity Server out-of-box (from the template).
I want to publish it to Azure but I don't get it working with loading the certificate from Azure KeyVault.
I have used the wizards in Visual Studio to generate the boilerplate code. Everything has been configured too.
And I read this guide too: https://learn.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/hosted-with-identity-server?view=aspnetcore-5.0&tabs=visual-studio#host-in-azure-app-service-with-a-custom-domain
And I have created a certificate in the Key Vault named IdentityServerSigning with CN=IdentityServerSigning.
When I then run the app I get 500.30.
Opening the Web-based Console from the Portal, I launch the app and get that it could not find a valid certificate 'CN=IdentityServerSigning' on the 'CurrentUser/My'.
What am I missing?
I guess you may forget to add application setting on portal, if your code has no problem.
We need to give Azure App Service permission to use the newly uploaded certificate. For that:
Go to Configuration in the menu of your Azure App Service
Click on New application setting
In Name, put: WEBSITE_LOAD_CERTIFICATES
In Value, put the Thumbprint that you copied from the previous section.
Click Ok, and don’t forget to click Save
If it doesn't work, pls read below blogs, you will find out the issues.
Suggestion
You can refer to this blogs to check the steps, I believe it will useful to you.
Blazor: Using a Self-Signed Certificate for IdentityServer4 in Azure App Service
To load the cert from Azure Key Vault in IdentityServer 4, you can use ActiveLogin:(https://github.com/ActiveLogin/ActiveLogin.Authentication)
More here: https://github.com/IdentityServer/IdentityServer4/issues/2705
I dont want to use "Azure bot service".
I have host bot application to azure, after that got hosted url https://something.azurewebsites.net then registered a bot in bot framework https://dev.botframework.com/bots/new with https://something.azurewebsites.net/api/messages endpoint url, microsoft id and password.
I got microsoft Id and password when I create a new registration in app registration on azure portal,
Then I used that same Microsoft Id and password in visual studio code and republished.
But while testing on bot framework test emulator it shows "Sorry, my bot code is having an issue." and when I am trying on local bot framework emulator with microsoft app Id and password it shows "Cannot post activity. Unauthorized. POST401directline.postActivity"
I am using "bot framework" : 3.9 and ".net framework": 4.6
Test on bot framework
Test on emulator
Setting
App registartion
V3 of Bot Framework SDK is deprecated. It is recommended to use V4.
https://github.com/microsoft/BotBuilder-V3/blob/master/README.md
Regarding this:
then registered a bot in bot framework
https://dev.botframework.com/bots/new with
https://something.azurewebsites.net/api/messages endpoint url,
microsoft id and password.
and
I got microsoft Id and password when I create a new registration in
app registration on azure portal
These are redundant steps. Really, what you should be doing is creating a Bot Channels Registration in the Azure portal or using az bot CLI.
I dont want to use "Azure bot service
This does not make sense. Can you further explain what you mean by this? Those two steps you did above are doing exactly that; creating a Bot Channels Registration. "Typical" bots are two parts; a Bot Channels Registration (to allow connection to your bot from multiple places, take care of authentication, etc) and a web application (your bot code). Which one do you not want to use?
Regarding the emulator/authentication configuration:
I'm sure you know this, but I wanted to confirm that you are aware of the behavior of appid/password in a bot. Also for the benefit of others that might not be.
You can test with the emulator against a localhost running bot or a deployed bot. When testing with a localhost bot, you can test with appid/password or without. If you test without, you must make sure that they are not configured in the appsettings.json (in v4. other versions, etc. may use different configuration types) and not supplied in launching the bot in emulator. If you test with; you must configure in the appsettings.json and supply them when launching the bot in emulator.
Now let's move on to testing the online/deployed bot. In a deployed bot, it will either pick up the appid/password in the appsettings.json or from configuration in the Web App/App Service's settings. These settings must be titled MicrosoftAppId and MicrosoftAppPassword.
So...all this being said, my assumption is that you created two applications (AAD app), and might be mixing up the appid/password. Either that, or it is not quite configured correctly in the Web app (https://something.azurewebsites.net); either in configuration file or in configuration settings in Azure.
I do hope this helps.
I have been following the directions at https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-authentication?view=azure-bot-service-4.0&tabs=csharp to add authentication to my bot (x). So far, I have done the following:
Created AD V1 application
Created AD V2 application
Successfully configured OAuth Connection Settings called "XAuth" to my bot (x) and used AD V1 (AppId, AppPassword). The test connection returns positive response.
Configured the sample bot application at https://github.com/Microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/18.bot-authentication, changed the connectionName to XAuth, added AppId and AppPassword from my bot (x)
Published bot application to Azure https://X.azurewebsites.net/
Configured Emulator for both development and production
Both Development and production are responding to help, logout commands in the emulator without prompting for signin dialog.
Since the sample project entrance has calls to WaterfallDialog(authDialog), I am expecting an automatic prompt. However, both environments do not prompt for user login. The .bot file has configuration for both production and development with appId and password. I couple of questions to understand the scenario better.
What do I need to do to get the prompt in Emulator?
What is the expected behavior in production? Am I supposed to get prompted when I test my bot (x)?
what happens if I have more than one OAuth configuration in my bot (x)? Which one will be in effect? How do I control that behavior?
Was faced with the problem specified at https://github.com/Microsoft/BotBuilder/issues/4632
Microsoft's Azure Mobile Web Services lets you download a .NET or JavaScript Service and a client that talks to the Service. These are written in C#, or JavaScript. I chose to get one in C#. There is are several parts in the generated solution
A Windows 8.1 desktop client (yourname.Windows)
A windows mobile client (yourname.WindowsPhone)
A Azure Mobile Web Service (yournameService)
A shared .net assembly named (yourname.Shared)
You can right click on yournameService and click Publish and it takes you through a wizard which publishes your application directly from Visual Studio to an Azure server. At some point in the wizard it establishes automatically some rather complex credentials (because you have already logged into an Azure web subscription). Generally you can just click Next, Next, and get it published.
Now you have a webservice, which opens up in your web browser, but which requires you to log in. What I want to know is, how do you know the user name and password used for this login?
http://yourapp123.azure-mobile.net/help
Then you click "Try it out", and a web browser authentication dialog pops up.
Why is this a problem? So far as a user I have input:
My Visual Studio login credentials,
My connection to Azure (perhaps same, perhaps different as visual studio login)
During wizard I've determined login credentials to publish to Azure, using values I have no idea where they came from, and so I left them alone. These seem to be the only credentials I had any opportunity to enter, and any change from the defaults renders the wizard inoperable, so I'm sure that's not where I enter my user and password.
I created a username and password when I created the Mobile WebService, and these do NOT work when I try to log in.
Leave the user name blank. And put in your application key as password. You can find your application key from your Azure portal > Mobile service > manage keys.
The reason being is that AMS uses a Zumo header to decide proper authentication. Which is what the application key is used for. So it's making sure only people or applications which has the application key can access the web service. Hope this helps.
I created a program and deployed it into the Windows Azure Portal but now I want to change the account that it is associated with but it won't let me. Is this possible and if it is could someone point out how to do it because I can't find a way so far. I created a web service that held data that is consumed by a client and I want to change the associated Windows Azure Account but it keeps trying to publish the service onto the account I used to begin with instead of the new one, even when I sign into my new windows azure account. Using VS to publish the service to the portal
Thanks.