Articles → MICROSOFT BOT FRAMEWORK → Deploy Microsoft Bot In Azure

Deploy Microsoft Bot In Azure

Download The Bot

  1. Go to the bot.
  2. Click on the "Build" option.
  3. Picture showing the Build menu to download the bot code
    Click to Enlarge

  4. A window will be opened on the right-hand side. Click on the button "Download Bot source code".
  5. Picture showing the Download Bot Source Code for downloading the bot code
    Click to Enlarge

  6. The bot source code is downloaded as a zip file.
  7. Extract the code and open the code using visual studio.

Make Changes In The Bot

  1. Open the visual studio in the admin mode. Open the solution.
  2. Open the file "EchoBot.cs" inside the "Bot" folder.
  3. Change the message inside the "OnMembersAddedAsync" function.
  4. Picture showing the changes done in the OnMembersAddedAsync event
    Click to Enlarge

  5. Rebuild the solution.

Download The Publish Profile File

  1. In the details of the bot, go to the "All App service settings" menu option.
  2. Picture showing the All App service settings submenu inside the All App service settings
    Click to Enlarge

  3. On the right-hand side window, click on the "Get Publish profile" button.
  4. Picture showing the Get Profile Publish button to download the profile file in json format
    Click to Enlarge

  5. A file with the extension ".PublishSettings" will be downloaded. This file is the XML file that contains the Publish profile information.

Deploy The Code On Azure

  1. Open visual studio in the admin mode.
  2. Open bot project.
  3. Rebuild the project.
  4. Right-click on the project in the solution explorer of the visual studio and click on the "Publish.." option.
  5. Picture showing the Publish option in visual studio for publishing the code
    Click to Enlarge

  6. The publish window will open in the visual studio.
  7. A popup window will appear.
  8. Picture showing the popup window for selecting the publish target
    Click to Enlarge

  9. Click on the "Import Profile…" button and select the publish profile setting file that we have downloaded in the last section.
  10. The profile is imported.
  11. Picture showing the publish window once the profile downloaded from Azure is Imported
    Click to Enlarge

  12. From the dropdown, select web deploy instead of FTP.
  13. Picture showing changing the profile from FTP to web deploy
    Click to Enlarge

  14. Click on the "Edit" link. A popup window will appear.
  15. Go to the "Settings" tab and check the checkbox "Remove additional files at destination".
  16. Picture showing the settings tab of the Publish window
    Click to Enlarge

  17. Click on the "Save" button to close the window.
  18. Finally, click on the "Publish" button.
  19. Once the publish is completed, a browser window will appear for the confirmation.
  20. Picture showing the URL of the bot once it is published on Azure
    Click to Enlarge

Test The Deployed Changes

  1. Open the bot in the azure portal.
  2. Go to "Test in Web Chat".
  3. Picture showing the updated bot on Azure
    Click to Enlarge

Posted By  -  Karan Gupta
Posted On  -  Wednesday, February 10, 2021


Your Email Id  
Query/FeedbackCharacters remaining 250