{"id":13165,"date":"2018-08-06T08:15:17","date_gmt":"2018-08-06T15:15:17","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/azuregov\/?p=13165"},"modified":"2018-08-06T08:15:17","modified_gmt":"2018-08-06T15:15:17","slug":"bots-in-azure-government","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/azuregov\/bots-in-azure-government\/","title":{"rendered":"Bots in Azure Government"},"content":{"rendered":"<p>This blog was contributed by guest author<strong> Russ Williams<\/strong>, Cloud Solution Architect<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"margin: 0px;font-family: 'Segoe UI Light',sans-serif;font-size: 11pt\"><span style=\"color: #000000\">So you&#8217;ve heard the buzz about bots and <\/span><span><a href=\"https:\/\/www.youtube.com\/watch?v=rDLkKN8e8rA&amp;feature=youtu.be&amp;t=2870\">&#8220;conversational AI&#8221; at Microsoft&#8217;s Build 2018 Conference<\/a><\/span><span style=\"color: #000000\">. You&#8217;re starting to get excited about ideas you have for bots in your organization.<span>\u00a0 <\/span>But then you learn that Azure Government doesn&#8217;t support the Azure Bot Service yet, so you start to think your ideas will have to be put on hold\u2026 or do they?<span>\u00a0 <\/span>Turns out, there is a way to begin exploring bots in Azure Government that&#8217;s really easy! The approach does require that you have access to both Azure Commercial and Azure Government subscriptions but you could create a <\/span><span><a href=\"https:\/\/azure.microsoft.com\/en-us\/free\/\">trial Azure Commercial subscription<\/a><\/span><span style=\"color: #000000\"> if you&#8217;re eager to begin exploring the potential of Conversational AI in your organization.<span> <\/span><\/span><\/span><\/p>\n<p><span style=\"margin: 0px;font-family: 'Segoe UI Light',sans-serif;font-size: 11pt\"><span style=\"color: #000000\">The <a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/bot-service\/\">Azure Bot Service<\/a> helps you build, connect, deploy, and manage intelligent bots to interact naturally with your users on websites, apps, Cortana, Microsoft Teams, Skype, Slack, Facebook Messenger, and more.<\/span><\/span><\/p>\n<p><span style=\"margin: 0px;font-family: 'Segoe UI Light',sans-serif;font-size: 11pt\"><span style=\"color: #000000\">Now\u2019s the time to get started so your bot will be ready to go when the Bot Service becomes available in Azure Government. In this post I&#8217;ll explain how this works and show you how to use the Azure Bot Service to deploy a bot in Azure Government<\/span><\/span><\/p>\n<p><span style=\"margin: 0px;font-family: 'Segoe UI Light',sans-serif;font-size: 11pt\"><span style=\"color: #000000\">Let&#8217;s begin with a high-level overview of what we are about to do. You\u2019ll first build an intelligent platform to develop a conversational bot, then connect this to messaging clients. Connecting your bot to messaging clients requires a Bot Channels Registration (Connector Service in the diagram below) which isn&#8217;t yet available in Azure Government, so we&#8217;ll set that up in Azure Commercial and point it to the Azure Government bot. So it\u2019s just the Connector Service that\u2019s hosted in Azure Commercial, the bot itself will be hosted in Azure Government.<\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/MicrosoftBotFramework.png\"><img decoding=\"async\" width=\"612\" height=\"347\" class=\"alignnone wp-image-13135\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/MicrosoftBotFramework-1024x580.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/MicrosoftBotFramework-1024x580.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/MicrosoftBotFramework-300x170.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/MicrosoftBotFramework-768x435.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/MicrosoftBotFramework.png 1218w\" sizes=\"(max-width: 612px) 100vw, 612px\" \/><\/a><\/p>\n<p>So, these are the two primary tasks I&#8217;ll explain in this post:\n1. How to build and deploy your bot to Azure Government\n2. How to connect your bot to messaging clients like Facebook Messenger, Slack, SMS, etc.<\/p>\n<h3><strong>Task 1 &#8211; Build and Deploy to Azure Government<\/strong><\/h3>\n<p>The first task can be carried out entirely in Visual Studio 2017 (earlier versions of Visual Studio could be used but the steps will be slightly different). Here are the steps:<\/p>\n<p>1. If you have Visual Studio version 15.6.4 or later, the Azure Environment Selector is no longer necessary and you can skip to step 3, otherwise, download and install the <em>Azure Environment Selector<\/em> which you can find <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=SteveMichelotti.AzureEnvironmentSelector\">here<\/a>\n2. In Visual Studio 2017, select <strong>Tools | Azure Environment Selector<\/strong> and then choose <strong>Azure Government<\/strong> in the dropdown and click <strong>Restart.<\/strong><\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ConnectAzureCommercial.png\"><img decoding=\"async\" width=\"373\" height=\"146\" class=\"alignnone wp-image-13125\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ConnectAzureCommercial.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ConnectAzureCommercial.png 1018w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ConnectAzureCommercial-300x117.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ConnectAzureCommercial-768x300.png 768w\" sizes=\"(max-width: 373px) 100vw, 373px\" \/><\/a><\/p>\n<p>3. Now create the bot project by selecting <strong>File | New | Project<\/strong> and in the <em>New Project<\/em> dialog select the <strong>Visual C#<\/strong> template folder and then scroll down a bit and select the <strong>Bot Application<\/strong> template. Give you bot a <strong>Name<\/strong> and <strong>Location<\/strong> and then click <strong>OK.<\/strong><\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/NewProjectBotImage.png\"><img decoding=\"async\" width=\"686\" height=\"476\" class=\"alignnone wp-image-13115\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/NewProjectBotImage-1024x710.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/NewProjectBotImage-1024x710.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/NewProjectBotImage-300x208.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/NewProjectBotImage-768x533.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/NewProjectBotImage.png 1893w\" sizes=\"(max-width: 686px) 100vw, 686px\" \/><\/a>\n4. Next press <strong>F6<\/strong> to Build the solution<\/p>\n<p>5. In the <em>Solution Explorer<\/em>, right-click the project and select <strong>Publish.<\/strong><\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/publish.png\"><img decoding=\"async\" width=\"306\" height=\"260\" class=\"alignnone wp-image-13015\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/publish.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/publish.png 754w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/publish-300x255.png 300w\" sizes=\"(max-width: 306px) 100vw, 306px\" \/><\/a><\/p>\n<p>6. On the publishing dialog, make sure <strong>App Service<\/strong> target is selected and choose the <strong>Create New<\/strong> option and then click <strong>Publish.<\/strong><\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/PickPublishTarget.png\"><img decoding=\"async\" width=\"442\" height=\"331\" class=\"alignnone wp-image-13235\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/PickPublishTarget-1024x767.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/PickPublishTarget-1024x767.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/PickPublishTarget-300x225.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/PickPublishTarget-768x575.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/PickPublishTarget.png 1601w\" sizes=\"(max-width: 442px) 100vw, 442px\" \/><\/a><\/p>\n<p>7. On the <em>Create App Service<\/em> dialog, make sure you have selected your Azure Government subscription and then enter an <em>App Name<\/em>. Next, click <strong>New<\/strong> to create a new <em>Resource Group<\/em> to hold your bot. To keep things clean for the demo bot, let&#8217;s click <strong>New<\/strong> and create a new Hosting Plan (see Step 8). Lastly, click <strong>Create<\/strong>.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CreateAppService.png\"><img decoding=\"async\" width=\"447\" height=\"336\" class=\"alignnone wp-image-13105\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CreateAppService-1024x768.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CreateAppService-1024x768.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CreateAppService-300x225.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CreateAppService-768x576.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CreateAppService.png 1601w\" sizes=\"(max-width: 447px) 100vw, 447px\" \/><\/a><\/p>\n<p>8. If you did choose to create a new service plan, you&#8217;ll see the dialog below. Provide a name for your App Service Plan and choose the Location where you want your bot to run and click <strong>OK.<\/strong><\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/Configure-Hosting-Plan.png\"><img decoding=\"async\" width=\"297\" height=\"334\" class=\"alignnone wp-image-13095\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/Configure-Hosting-Plan-911x1024.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/Configure-Hosting-Plan-911x1024.png 911w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/Configure-Hosting-Plan-267x300.png 267w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/Configure-Hosting-Plan-768x864.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/Configure-Hosting-Plan.png 965w\" sizes=\"(max-width: 297px) 100vw, 297px\" \/><\/a><\/p>\n<p>9. When publishing finishes, the default bot webpage will pop up in the browser. Copy and URL from browser and paste into something like Notepad and make the following edits to it:\n\u2022 Change <strong>http<\/strong> to <strong>https<\/strong>\n\u2022 Append &#8220;<strong>\/api\/messages<\/strong>&#8221; to the end so it looks like https:\/\/helloworldbotrhw.azurewebsites.us\/api\/messages\n\u2022 Of course, you&#8217;ll replace &#8220;<strong>helloworldbotrhw<\/strong>&#8221; with the <em>App Name<\/em> you specified in Step 7\n\u2022 This is the bot messaging endpoint you&#8217;ll need later when you create your Bot Channels Registration in Task 2<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/HelloWorldBot.png\"><img decoding=\"async\" width=\"421\" height=\"176\" class=\"alignnone wp-image-13085\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/HelloWorldBot-1024x428.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/HelloWorldBot-1024x428.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/HelloWorldBot-300x125.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/HelloWorldBot-768x321.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/HelloWorldBot.png 1196w\" sizes=\"(max-width: 421px) 100vw, 421px\" \/>\n<\/a><\/p>\n<h3><strong>Task 2 &#8211; Connect You Bot to Messaging Clients<\/strong><\/h3>\n<p>1. Now browse to commercial portal (<a href=\"https:\/\/portal.azure.com\">https:\/\/portal.azure.com<\/a>) and <strong>Create a New Resource<\/strong> and type in &#8220;bot channels registration&#8221; into <strong>Search<\/strong> field and hit enter and then choose <strong>Bot Channels Registration<\/strong> and click <strong>Create<\/strong> on the Create blade that pops up.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ConnectBotMessagingClients.png\"><img decoding=\"async\" width=\"541\" height=\"211\" class=\"alignnone wp-image-13075\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ConnectBotMessagingClients-1024x400.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ConnectBotMessagingClients-1024x400.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ConnectBotMessagingClients-300x117.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ConnectBotMessagingClients-768x300.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ConnectBotMessagingClients.png 1319w\" sizes=\"(max-width: 541px) 100vw, 541px\" \/><\/a><\/p>\n<p>2. On the <em>Channels Registration<\/em> blade, give your bot a globally unique name. You can use the same name that you provided for <em>App Name<\/em> back in Step 7 in Task 1. Choose the correct subscription and select <strong>Create New<\/strong> for <em>Resource Group<\/em>. Select the <em>Location<\/em> where the new channel registration should live and then paste in the Messaging Endpoint that you crafted back in Step 9 in Task 1. Next, click <strong>Auto create App ID and password<\/strong> which will open the <em>Create App ID blade<\/em>. Click the <strong>Create New<\/strong> and then click the <strong>Create App ID in the App Registration Portal<\/strong>. This will open the App Registration portal in a new browser tab and ask you to sign in. Use the same identity you use to sign in to the Azure Commercial portal.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ChannelsRegistration.png\"><img decoding=\"async\" width=\"680\" height=\"661\" class=\"alignnone wp-image-13065\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ChannelsRegistration-1024x996.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ChannelsRegistration-1024x996.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ChannelsRegistration-300x292.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ChannelsRegistration-768x747.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/ChannelsRegistration.png 1765w\" sizes=\"(max-width: 680px) 100vw, 680px\" \/><\/a>\n3. In the App Registration portal, click the <strong>Generate an app password to continue<\/strong> button.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GenerateAppID.png\"><img decoding=\"async\" width=\"414\" height=\"236\" class=\"alignnone wp-image-13055\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GenerateAppID-1024x585.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GenerateAppID-1024x585.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GenerateAppID-300x171.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GenerateAppID-768x438.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GenerateAppID.png 1529w\" sizes=\"(max-width: 414px) 100vw, 414px\" \/><\/a><\/p>\n<p>4. You&#8217;ll need to copy and save this password for use later and then click <strong>OK.<\/strong><\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/PasswordGenerated.png\"><img decoding=\"async\" width=\"418\" height=\"240\" class=\"alignnone wp-image-13045\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/PasswordGenerated-1024x588.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/PasswordGenerated-1024x588.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/PasswordGenerated-300x172.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/PasswordGenerated-768x441.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/PasswordGenerated.png 1794w\" sizes=\"(max-width: 418px) 100vw, 418px\" \/><\/a><\/p>\n<p>5. You also need to copy and save the App ID since we&#8217;ll need it in the next step too. The <strong>Finish and go back to Bot Framework<\/strong> button does not work so you&#8217;ll have to manually flip back to Azure Commercial portal tab in your browser.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CopyPassword.png\"><img decoding=\"async\" width=\"419\" height=\"279\" class=\"alignnone wp-image-13035\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CopyPassword-1024x683.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CopyPassword-1024x683.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CopyPassword-300x200.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CopyPassword-768x512.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CopyPassword.png 1530w\" sizes=\"(max-width: 419px) 100vw, 419px\" \/><\/a><\/p>\n<p>6. After you flip back to the Azure Commercial portal, paste the <strong>App ID<\/strong> and <strong>Password<\/strong> you saved from the previous steps into their respective fields and then click <strong>OK<\/strong> and, finally, click <strong>Create<\/strong>.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CreateAppService-2.png\"><img decoding=\"async\" width=\"687\" height=\"678\" class=\"alignnone wp-image-13025\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CreateAppService-2-1024x1011.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CreateAppService-2-1024x1011.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CreateAppService-2-300x296.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CreateAppService-2-768x758.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CreateAppService-2.png 1767w\" sizes=\"(max-width: 687px) 100vw, 687px\" \/><\/a><\/p>\n<p>7. Now, switch back to Visual Studio and copy and paste App ID and password from the previous step and paste them into web.config file as shown below:\n&lt;appSettings&gt;\n&lt;!&#8211; update these with your BotId, Microsoft App Id and your Microsoft App Password&#8211;&gt;\n&lt;add key=&#8221;BotId&#8221; value=&#8221;&#8221; \/&gt;\n&lt;add key=&#8221;MicrosoftAppId&#8221; value=&#8221;<strong>0beb9658-b215-4bd5-bd46-aeee1ae651c8<\/strong>&#8221; \/&gt;\n&lt;add key=&#8221;MicrosoftAppPassword&#8221; value=&#8221;<strong>xcWJR29+!hiyinGECS318%~<\/strong>&#8221; \/&gt;\n&lt;\/appSettings&gt;<\/p>\n<p><strong>Note: You should never store the app password in the web.config for production applications and instead store it in Azure Key Vault so the password is safe and then write code to retrieve it from Azure Key Vault.<\/strong><\/p>\n<p>8. Since we updated the web.config we&#8217;ll need to right-click the project in the Solution Explorer and select <strong>Publish<\/strong> to re-publish the app. Since we\u2019ve already published once we can just click the <strong>Publish<\/strong> button on the<em> Publishing<\/em> page to start the re-publishing process.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/publish.png\"><img decoding=\"async\" width=\"314\" height=\"267\" class=\"alignnone wp-image-13015\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/publish.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/publish.png 754w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/publish-300x255.png 300w\" sizes=\"(max-width: 314px) 100vw, 314px\" \/><\/a><\/p>\n<p>9. Switch back to the Azure Commercial portal and click the <strong>&#8220;Bell&#8221; icon<\/strong> in upper right portion of screen and when the creation process is finished, you\u2019ll see a <strong>Go to Resource<\/strong> button that you can click.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GoToResource.png\"><img decoding=\"async\" width=\"645\" height=\"411\" class=\"alignnone wp-image-13005\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GoToResource-1024x652.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GoToResource-1024x652.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GoToResource-300x191.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GoToResource-768x489.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GoToResource.png 1320w\" sizes=\"(max-width: 645px) 100vw, 645px\" \/><\/a><\/p>\n<p>10. Click <strong>Test in Web Chat<\/strong> from left hand menu in the blade and type &#8220;hello&#8221; at bottom of test windows and hit Enter and you should see what you typed echoed back to you with a word count.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/TestInChat.png\"><img decoding=\"async\" width=\"691\" height=\"441\" class=\"alignnone wp-image-12995\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/TestInChat-1024x654.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/TestInChat-1024x654.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/TestInChat-300x192.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/TestInChat-768x490.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/TestInChat.png 1320w\" sizes=\"(max-width: 691px) 100vw, 691px\" \/><\/a><\/p>\n<p>11. Now that we&#8217;ve used the portal to prove the Bot Channel Registration is working, let&#8217;s create a real messaging client and use it to send messages to your bot. To do this, click <strong>Channels<\/strong> from left hand menu in the blade and then click <strong>Get bot embeded codes<\/strong>.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GetBotEmbededCodes.png\"><img decoding=\"async\" width=\"688\" height=\"441\" class=\"alignnone wp-image-12985\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GetBotEmbededCodes-1024x656.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GetBotEmbededCodes-1024x656.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GetBotEmbededCodes-300x192.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GetBotEmbededCodes-768x492.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/GetBotEmbededCodes.png 1320w\" sizes=\"(max-width: 688px) 100vw, 688px\" \/><\/a><\/p>\n<p>12. In the <em>Bot embed code <\/em>dialog, click <strong>Click here to open the Web Chat configuration page<\/strong> link.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/BotEmbedCode.png\"><img decoding=\"async\" width=\"341\" height=\"131\" class=\"alignnone wp-image-12975\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/BotEmbedCode.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/BotEmbedCode.png 1008w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/BotEmbedCode-300x115.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/BotEmbedCode-768x295.png 768w\" sizes=\"(max-width: 341px) 100vw, 341px\" \/><\/a><\/p>\n<p>13. Now click the <strong>Show<\/strong> button next to the Secret Keys entry field and then click in the <em>Secret key<\/em> entry field and enter <strong>Control-A<\/strong> and then <strong>Control-C<\/strong> to copy the secret key and save it somewhere. Next, click <strong>Copy<\/strong> next to the Embed Code and save it somewhere and then click <strong>Done<\/strong>.<\/p>\n<p>14. Edit the Embed Code (i.e. the &lt;<strong>iFrame \/<\/strong>&gt; you just saved) and replace <strong>YOUR_SECRET_HERE<\/strong> with the secret key you saved in the previous step and then add <strong>width=&#8221;400&#8243; height=&#8221;500&#8243;<\/strong> so it looks something like this: <strong>&lt;iframe width=&#8221;400&#8243; height=&#8221;500&#8243; src=&#8217;https:\/\/webchat.botframework.com\/embed\/HelloWorldBotRHW?s=DVTCKZb7erw.cwA.YTg.hqzSNljbjzdxw9uYlj4TiqyBVJO0qC4F1ZYMedJYltM&#8217;&gt;&lt;\/iframe&gt;<\/strong><\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/iFrame.png\"><img decoding=\"async\" width=\"658\" height=\"419\" class=\"alignnone wp-image-12965\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/iFrame-1024x652.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/iFrame-1024x652.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/iFrame-300x191.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/iFrame-768x489.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/iFrame.png 1320w\" sizes=\"(max-width: 658px) 100vw, 658px\" \/><\/a><\/p>\n<p>15. Now copy the &lt;<strong>iFrame \/<\/strong>&gt; string you edited in the previous step and switch to Visual Studio and open <strong>default.htm<\/strong> and paste it in somewhere reasonable.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CopyIframeString.png\"><img decoding=\"async\" width=\"659\" height=\"416\" class=\"alignnone wp-image-12955\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CopyIframeString-1024x646.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CopyIframeString-1024x646.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CopyIframeString-300x189.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CopyIframeString-768x484.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/CopyIframeString.png 1319w\" sizes=\"(max-width: 659px) 100vw, 659px\" \/><\/a><\/p>\n<p>16. Hit <strong>F5<\/strong> to run the app and test it out by typing in <strong>Hello<\/strong> and hitting Enter key. When you have proven that the Web Chat Channel is working locally, you can republish the bot by repeating Step 8 in Task 2 so the world can try out your new bot!<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/TryNewBot.png\"><img decoding=\"async\" width=\"363\" height=\"206\" class=\"alignnone wp-image-12945\" alt=\"\" src=\"http:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/TryNewBot-1024x581.png\" srcset=\"https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/TryNewBot-1024x581.png 1024w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/TryNewBot-300x170.png 300w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/TryNewBot-768x436.png 768w, https:\/\/devblogs.microsoft.com\/azuregov\/wp-content\/uploads\/sites\/43\/2018\/06\/TryNewBot.png 1319w\" sizes=\"(max-width: 363px) 100vw, 363px\" \/><\/a><\/p>\n<p><strong>Next Steps<\/strong>\nNow that you have the foundation of the Microsoft Bot Framework working, you can enable any of the other channels you see on the Channels blade from Step 11 on Task 2. You can then expand your exploration by incorporating <a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/cognitive-services\/language-understanding-intelligent-service\/\">LUIS<\/a>, <a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/cognitive-services\/qna-maker\/\">QnA Maker<\/a>, and other <a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/cognitive-services\/\">Cognitive Services<\/a> to build solutions that truly unlock the power of Conversational AI.<\/p>\n<p>&nbsp;<\/p>\n<p><span>We welcome your comments and suggestions to help us improve your Azure Government experience. To stay up to date on all things Azure Government, be sure to subscribe to our <a href=\"https:\/\/blogs.msdn.microsoft.com\/azuregov\/feed\/\">RSS feed<\/a> and to receive emails by clicking \u201cSubscribe by Email!\u201d on the <a href=\"https:\/\/blogs.msdn.microsoft.com\/azuregov\/\">Azure Government Blog<\/a>.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog was contributed by guest author Russ Williams, Cloud Solution Architect &nbsp; So you&#8217;ve heard the buzz about bots and &#8220;conversational AI&#8221; at Microsoft&#8217;s Build 2018 Conference. You&#8217;re starting to get excited about ideas you have for bots in your organization.\u00a0 But then you learn that Azure Government doesn&#8217;t support the Azure Bot Service [&hellip;]<\/p>\n","protected":false},"author":1804,"featured_media":20423,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14],"tags":[81,95,199],"class_list":["post-13165","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learning","tag-azure-bot-service","tag-azure-government","tag-conversational-ai"],"acf":[],"blog_post_summary":"<p>This blog was contributed by guest author Russ Williams, Cloud Solution Architect &nbsp; So you&#8217;ve heard the buzz about bots and &#8220;conversational AI&#8221; at Microsoft&#8217;s Build 2018 Conference. You&#8217;re starting to get excited about ideas you have for bots in your organization.\u00a0 But then you learn that Azure Government doesn&#8217;t support the Azure Bot Service [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/posts\/13165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/users\/1804"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/comments?post=13165"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/posts\/13165\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/media\/20423"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/media?parent=13165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/categories?post=13165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/tags?post=13165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}