Azure CosmosDB – Quick Start Demo App

So one of the hottest thing in Azure these days is without doubt CosmosDB, Cosmos DB is

A database for extremely low latency and massively scalable applications anywhere in the world, with native support for NoSQL

To get started with your very first Azure CosmosDB

  • go into the portal and click ass on Azure CosmosDB
  • give your new database an id
  • choose an API from the options available
    • SQL
    • MongoDB
    • Casandra
    • Azure Table
    • Gremlin (graph)
  • select your Subscription
  • select a resource group / create a new one
  • choose a location
  • optionally turn on geo-redundancy
  • click pin to pin this to your dashboard

For this blog post I chose the SQL API and left geo-redundancy off.

Ok so once you’ve done this click on Quick Start


Now you’ll see that you can download a sample app using .Net, .Net Core, Xamarin, Java, node.js and Python which will download code for you to play around with and create a to-do app.

I chose .Net and downloaded the code to my machine and opened it up with Visual Studio, run the code and you have a working to-do application hitting your newly created Azure CosmosDB up in Azure.

Time to go play with Azure CosmosDB, enjoy.


Azure Learning Resources

The following is a list of learning resources for your (and my) benefit, this list will be a work in progress and continually updated the more good stuff I come across.

Azure overview, lists ALL of the Azure services
Create your first Azure Function using Visual Studio 2017
Great link with lots of awesome content

Azure Examples on Github


Blogs on Azure

Twitter Accounts to follow

  • @AzureFunctions – The Official account of the Azure Functions Product Team

Azure Functions

So I have really gotten into Azure Functions of late and reading about some very clever usages of them, more on that later in another blog post coming soon.

I have also just completed a demo order pipeline using Azure Functions which I learned about from a Pluralsight course by Mark Heath called Azure Functions Fundamentals (highly recommended).

During this you build an order pipeline so you use Postman to send an example order in JSON to your azure function(s) which does a number of things, over the course you’ll add an order to Azure Table Storage, add the order to an Azure Storage Queue, generate a license file using Azure Blob Storage and the generate an email and send the license file using SendGrid a 3rd party email provider.

Then you can use the Azure Table Storage Explorer tool to look into what you’ve managed to create within your tables in Azure Storage.

What I like about this Pluralsight course is that I’m learning and also getting to see great demos of how to go about creating azure functions and using them for real scenarios all be it the code isn’t obviously production ready but its all about the learning at the moment.

I haven’t finished this course yet but I will soon and more blog posts will follow, off the back of this course I am hoping to do a talk on FaaS and Azure Functions at work this coming March.

What have I learned so far with Azure?

So I have been getting my hands on Azure recently and just wanted to blog about what I have learned so far so here goes (condensed version as wanting to get back to learning way more)


App Service Plans

  • What the different levels are Basic, Standard and Premium and what the differences are.
  • App service plans govern how you pay for it
  • Scale out – beef up the VM or the server
  • Scale up – run more than one instance etc.
  • You can have staging environments and automated backups
  • Consumption plan – only pay for what u use

What is Serverless?

  • There are still servers of course – you delegate the management of them to third party offerings
  • Use third party Paas wherever possible (for example documentDB)
  • Run your custom code on Azure Functions
    – respond to events
    – let the framework work out how many servers you need
    – Functions as a Service (FaaS)

Benefits of Azure functions?

  • Rapid and simple development module
  • Code it within the portal
  • Eliminate boilerplate
  • Extremely reach feature set
  • CI, Kudu, Easy Auth, Certs, Custom Domains, Settings etc. all included
  • Cost effective pricing – only pay for what you use
  • No servers to maintain
  • Automatic scaling

Next up is Azure Functions…