Todo application using NodeJS, Azure Cosmos DB & Azure App Service
- Create Cosmos DB, please refer this link for help in creation step of Cosmos
Once your Cosmos DB is created, keep note ofURI
&Primary Key
- Create Azure App Service with runtime stack as NodeJS, please refer this link for help
- In Azure App Service make sure you have enable Local GIT deployment method, please refer this link for help. Keep a note of your deployment username and password
Also, make note of git deployment URL
- Select the Cloud Shell button on the menu bar at the upper right in the Azure portal.
- Do a clone of our application repo
git clone https://github.com/webmagicinformatica/azure-cosmos-db-sql-api-nodejs-todo-app
- Here, we will need to setup our code to work with Cosmos DB created in Step 1
- Change directory to source code directory
cd /azure-cosmos-db-sql-api-nodejs-todo-app/src
- Edit
config.js
vim config.js
- Next edit two parameter in
config.js
file
- Now to application folder
cd ..
- Change directory to source code directory
- Now we are ready to deploy the application to Azure app service
- Commit the changes to cloud shell local git repo:
git add . git commit -m "Ready to do our 1st deployment"
- Now add remote repo of our Azure app service which we copied in Step 3
git remote add azure <deploymentLocalGitUrl-from-step-3>
- Lets push the code to our Azure App service
git push azure master
- And we are done with deployment
- Commit the changes to cloud shell local git repo:
- Lets check our application by visiting Azure app service URL
Enter some pending task of yours 😛 - Check the data is entered in DB or not