In this section we will prepare the services in Azure to run our Bot. If you do not have a Visual Studio Subscription (including credits) register through (my.visualstudio.com)[https://my.visualstudio.com] for a free Visual Studio Dev Essentials Subscription. When you're finished you're able to claim a free Credit for Azure Resources.
All related resources for our Bot will be inside a so called "Azure Resource Group". It's a logical unit which summarizes the service of your application. It also allows you to create ARM-Templates to easily redeploy or automate installation of your service. It's free and provides you some management tasks to gather Metrics, Lock Resources or Tag them.
To create a new resource group you simply click "Resource groups" from the left menu.
Now Azure will open the so called "Resource Groups"-Blade. You will experience, that whenever you "drill-down" into your Resources, new Blades will be stacked to the right of the current blade. This allows you to navigate up and down in your resource hiarchy. To create a new Resource Group simply click the Add Button on the top.
which will lead you to the following blade:
You are free to choose what ever Name you like for your Resource Group. And Subscription should be prefilled with your current active Subscription (which will be billed). Please choose as Resource Group Location "West Europe" - for this whole training we will choose as location "West Europe" to address some location specific Problems you will face in the real world.
After you click the "Create"-Button on the bottom of the Blade you should see something familiar to this:
Now you have created your first Azure Resource Group - congratz. Let's move on to create our first and most important service. The "Bot Service".
While still in the Resource Group Blade, click on the "Add"-Button. This will lead us to the Azure Marketplace, where we will be able to create/purchase new Services. Keep in mind, we had been in the Kontext of the Resource Group, while moving to the Azure Marketplace. New Services will be added into the just created Resource Group.
After you clicked the "Add"-Button a search will appear. To quickly find the right Service, just enter "Bot Service" into the search field and you should see something like this:
Click on the "Bot Service (preview)"-Entry in the list and you will get the Creation Blade again. Only this time, you will need to provide different Inputs.
Let me go a bit more into detail about those values this time. First of all the "App name" - which needs to be a unique sub-domain for .azurewebsites.net. This means every website hosted in an Azure App Services needs its own unique name. Also that our "Bot Service" is "Website" as well. Based on the simple Fact, that our Bot Service consists of an Web API Controller extended by a Framework called the Microsoft Bot Framework. The Framework allows handling of special Message Formats and supports several Channels which allows you to attach your Bot to Facebook, Slack, Skype, etc. very easily.
Since we initiated the creating of our Bot Service from our freshly created Resource Group - this Blade should be already pre-filled by it.
But the last two values are the most Important. Hosting Plan consits (at time of training creation) of two values:
- Consumption Plan
Running the Bot Service inside a consumption Plan indicates, that you want to run the Bot inside a so called "serverless Code Environment". Technically it only means you run your code as an Azure Function which is like an abstraction of the Machine behind it. You do not care if it may be a Linux, Windows or completly different System. You just want to execute your code and will be charged by how often and how long your code is executed. The more your Bot calls your Web Api Controller - the more you pay.
- App Service Plan
On the other Hand you have the traditional approach, to run your code inside an App Service Plan. In context of Azure this is a new Resource and can be imagined as representation of a virtual Machine running in Azure providing all applications assigned to the App Service Plan. But since the virtual Machine is running 24/7 you pay for the service even if its not used. It might be a bit more cheaper overall - but this is strongly dependend on the size of the Machine.
Last but not least - choose the Region West Europe. Otherwise some steps will not apply to you and you might not be able to follow this Training. After you did so, press Create and wait some seconds until the Notifications tell you, your service had been created. Navigate to your newly created Bot Service and you will find yourself in the next Part - setting up the Bot Service.
After you navigated to your new Service you will find the following:
we go for Basic for learning purposes as well as for reasons to reduce Problems you may experience. Especially for those Service Kinds, where external Services are included I experienced and chaning and troublesome behaviour every time I used it. But no worries - we will still use those services and learn what the Wizard would provide as an template.
Now that we set up our App Service - or Infrastructure - we have everything to deploy our application to the cloud.
Now our Bot Service is running inside Azure and available worldwide