App Deployment
Let's now deploy Chatbot FrontEnd and BackEnd to Azure App Service.
In order to deploy the Chatbot to Azure, you need to have 2 App Services
. Go back to Azure Deployment
step and follow Option 2: Deploy App Service Only
to create resources if you skip the step earlier.
Deploy Chatbot BackEnd API to Azure App Service
-
Open repo in VS code.
-
Install
Azure App Service
extension in Vs Code. If you are using GitHub Codespaces, extension is already installed. -
Sign in to Azure in the Azure tab
-
Expand
App Services
node in yourSubscription
-
Right click
App Service
name and select 'Deploy to Web App..` -
Select Browse in the dropdownlist and locate
apps\api
folder and click ok. -
Select
Deploy
if below popup shows. Check the progress in VS Code'sAzure
tab -
Once completed, you can find api app url in your Azure Portal under the
App Service
infoThe VS Code deployment only uploads code to
App Service
, there will be additional build activity running in the server side. Check progress inDeployment Center
. -
Open the Url in browser and add path
\docs
to access the swagger. for example: https://arg-syd-aiapp1day-api.azurewebsites.net/docs
Deploy Chatbot FrontEnd to Azure App Service
-
Update frontend chatbot's
BACKEND_URI
inapps\chatbot\.env
file. Replace theBACKEND_URI
with the actual Azure App service url of backend from last step, similar to below.BACKEND_URI=https://arg-syd-aiapp1day-api.azurewebsites.net
-
Repeat above steps and deploy
apps\chatbot
folder -
Once completed, you can find chatbot app url in your Azure Portal under the
App Service
. for example, https://arg-syd-aiapp1day-chat.azurewebsites.net/ -
Open the chatbot url in your browser and try out the prompts.
infoIf you see an error in the chatbot, switch to
developer tools
in the browser. Check if you have the backend API url configured correctly. -
Now, you have deployed your chatbot to Azure! Congrat !!
infoForget to mention, there would also be a CORS error. Please try and find the commented line that configures CORS in the API. :p
-
Now, you have successfully deployed your chatbot to Azure! Congrat !!