Automatic deployment of bot service on azure using C# - c#

I need to be able to deploy bot framework solution fully automatically from a .net web app.
The resources I am able to create with ease (using Microsoft.Azure.Management.Fluent) are:
app service plan
Web App with bot backend
azure storage
The resources that I want (and can't) are:
"Wab App Bot"
"Cognitive Service" with LUIS (this one is optional for know, but it would be really great if I can also create this kind of resource from code)
I have configured service principal with necessary rights.

You can find the code samples to create Azure app bot and Cognitive Service under the SDKs.
Azure app bot https://github.com/Azure/azure-sdk-for-net/tree/psSdkJson6/src/SDKs/BotService
Azure Cognitive Service https://github.com/Azure/azure-sdk-for-net/tree/psSdkJson6/src/SDKs/CognitiveServices

My though on this to enable the continious deployment for the bt code using GitHub or AzureDevOps, following link will help you set up the CD for the bot
https://learn.microsoft.com/en-us/azure/bot-service/bot-service-build-continuous-deployment?view=azure-bot-service-4.0
As for the LUIS application, what I end up doing is to use PowerShell / C# app to deploy the LUIS app definition using the LUIS REST api https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c2f

Related

Authentication to SharePoint Online from InTune MDM Xamarin.Android device

I am working on Xamarin.Android app that needs to download documents from SharePoint Online (SPO) in the background thread (using SPO REST API right now). Users should be using an app, while it is quietly retrieving documents from SPO.
I have no experience working with Intune MDM or MSAL library for authentication. Android device is corporate-owned (COD) and enrolled in MS InTune. Is there a way to pick enrolled on-device user details and pass them with requests to SPO?
Options that I am investigating are:
Integrate InTune SDK into app
Use MSAL library with the app registration in Azure portal for authentication
I am trying to avoid using WebView/browser for SSO if possible at all.
It looks like there are no experts here in this field, so after a lot of research and trials I worked out the solution. InTune SDK integration is not required if an Android mobile device is enrolled through InTune MDM, because Microsoft Authentication Library (MSAL.NET) can use Intune Company Portal app (or Microsoft Authenticator) as a broker. Your Xamarn.Android app needs to be registered in Azure portal following these steps https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app and adopting steps in this https://learn.microsoft.com/en-us/azure/active-directory/develop/msal-android-single-sign-on tutorial to Xamarin.Android makes authentication work.
One point to note is that you need to specify and give admin consent for Graph and Sharepoint permissions to read User, Sites and Files.

Is it possible to use azure cognitive service on a webapp?

I am a novice in Azure and I am trying to create a web app with a text-to-speech agent using azure resources. So far I have the web app and separatly the voice agent. Do you know if it is possible to bind both so that when I click a button on the web app, the voice agent says something (anything would work for now).
If it is possible, what steps would you follow to achieve that?
I'm using .NET core and C#.
Thanks in advance for the time.
Yes, You can use the Speech Services REST API or SDK. Here are reference docs.
As well as the API reference document: Cognitive Services APIs Reference (microsoft.com)

"There was an error sending this message to your bot: HTTP status code NotFound"

I created a bot with C# and deployed it and I keep getting error code NotFound or when tested in emulator 404.
The bot works perfectly fine locally when tested but when deployed it fails.
I've created a bot with composer and it does same thing, works locally, but then fails when deployed to Azure.
Bot config :
Bot working locally:
Bot failing remotely:
and
I have faced the same issue while creating "Web App Bot" with custom password option, sometimes this option will fail. So you can try with auto generated password option in "Web App BOT".
Please verify the following authentication details:
Microsoft AppId -> Should be use same App Id in both application & azure portal.
Microsoft Password -> Should be use same Password in both application & azure portal.
Directline Token -> Verify this token if you are connecting from front-end framework.
Messaging endpoint -> Verify this endpoint
Web App Bot is help to create all necessary service automatically for chatbot implementation and we can create the same process in another way. Please check the following steps.
Create an app service in azure ( host your chatbot application )
Create azure bot channel registration.
Link App service & bot channel registration using app service endpoint.
Validate all of the authentication details.
Note : You can test your app in azure bot emulator "Test in WebChat" section.
Reference :Azure Chatbot & Bot Framework Composer
What solved my problem was changing the Protocol Setting of the App Service. If you've deployed your bot using Bot Composer, in the resource group you will find 2 App Services - one with a 'qna' suffix and the other without. Choose the one without the 'qna' suffix.
Select the App Service --> TLS/SSL settings --> HTTPS Only --> On
ok so I found the solution:
Error (502) Bad Gateway: When trying to access chatbot deployed on Azure using WebChat channel
apparently if you deploy your bot to azure it doesn't work. But if you create a bot on azure, then deploy the bot you created to that appservice it works. The way the answer in the link describes is a little vague and not complete. To resolve my issue I created a bot in azure, and that automatically creates an app service with it. I then published the bot I created in visual studio by selecting the resource group and the appservice as my target of the bot I created in Azure. The bot I want to host then replaces the first bot, and somehow that magically fixes network issues. Apparently if you create bot in visual studio or composer and publish it as is just doesn't work, this is an issue they need microsoft needs to work on.

Telegram bot Deployment on Azure

I use ASP.NET Core
Actually I published my Bot to Created WebApp via Azure and took necessary things (URL, password etc).
Now I have no idea how to test it before registration.
Also will be glad to get more information about working principle of the deployed on Azure bot

Accessing bot in azure in android

I have deployed a bot in azure. Bot is written in C# using microsoft bot framework.
I am able to communicate with it using Microsoft Bot Framework Emulator after providing the azure URL, App Id and App Secret.
How to communicate with the bot from android?
Is there a URL to communicate with it like a REST Api?
If you use a bot registered to BotFramework, you can try to configure the Web Chat channel :
Log in to Bot Framework
Go to "your bots"
Click on the bot you've registered
Click on "Edit" next to “Web Chat” in the Channels
Generate your Web Chat Secrets (a blue button)
Tick "enable this bot on web chat"
Take note of the secret and embed tag
Then, take out the link from the iframe, (you'll get something like this : https://webchat.botframework.com/embed/YourBotID?s=YOUR_SECRET_HERE )
Replace YOUR_SECRET_HERE with the secret you previously took
Then, browse the final link from your phone / anywhere.
#SandeepMenon, There is a blog which introduces how to integate Azure Logic Apps with a Bot Web App using Bot Framework API hosted on Azure and supply the sample project on GitHub.
I think you can try to refer to the blog and use the Azure Logic App as callable endpoint, then to communicate with bot from android is only implementation for calling the http endpoints from android.

Categories