SaaS

Getting Started local development with Azure Cosmos DB services – Part 2

May 29, 2017 .NET, .NET Core 1.0, .NET Core 1.0.1, .NET Framework, ASP.NET, Azure, Azure SDK Tools, Azure Tools, Cloud Computing, CodeSnippets, CosmosDB, Document DB, Microsoft, PaaS, SaaS, Visual Studio 2015, Visual Studio 2015 Update 3, Visual Studio 2017, VisualStudio, VS2015, VS2017, Windows, Windows 10, Windows Azure Development, Windowz Azure No comments

In my previous article we discussed about setting local development environment using Cosmos DB Emulator for Windows. With this part 2 of the article, we will cover developing, debugging and integration related aspects of using Cosmos DB Emulator.

Developing with Cosmos DB Emulator

Once you have Cosmos DB emulator installed and running on your machine, you can use any supported Cosmos DB SDK or Cosmos DB REST API to interact with emulator. This process is same as you are using a Cosmos DB cloud service.

Cosmos DB Emulator also provides a build-in visual explorer through which you can view,create and edit collections and documents.

image

Before you integrate Cosmos DB SDK or Cosmos DB REST API you would need to generate master key for authentication. Unlike cloud service, Cosmos DB emulator only support single fixed account and master key.  You would not be able to communicate with Emulator without this master key.

Default Master Key:

Account name: localhost:<port>

Account key: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==

PS: This key is only to be used in Emulator. You cannot use the same key for Production(Cosmos DB Cloud Service).

Furthermore, if you want to set your own key. You can go to command line references and run DocumentDB.Emulator.exe with sufficient command switch to set your own key. Remember it should meet the key security requirements. See command-line tool reference for more information.

The Azure Cosmos DB Emulator is installed by default to the C:\Program Files\Azure Cosmos DB Emulator  or C:\Program Files\DocumentDB Emulator  directory.

Once you have account name and key, you are good to go with development and debugging using Azure Cosmos DB emulator.

Let us start looking at how to use CosmosDB SDK. Once you add Cosmos DB SDK for .NET from NUGET sources. You would need to import the following namespaces to reference necessary classes.

 using Microsoft.Azure.Documents;
   
 using Microsoft.Azure.Documents.Client;
   
 using Microsoft.Azure.Documents.Linq;

Simple code to establish connection:

// Connect to the Azure Cosmos DB Emulator running locally use DocumentClient class in : 
DocumentClient client = new DocumentClient(
    new Uri("https://localhost:8081"), 
    "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==");

In the above code block we are directly embedding endpoint, key in the source code.But as a suggested approch keeping in mind to easily point to production service would be maintain the key in Web.config appSettings.

   <add value="https://localhost:8081/" key="endpoint"/>
    <add value="C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" key="authKey"/>
 

Add NuGet reference to Microsoft.Azure.DocumentDB  (always use the latest version of the library)

image

For the ease of this article, I am going to use the existing ToDoList sample from DocumentDB Samples provided by Microsoft. You can originally find the same source from C:\Program Files\DocumentDB Emulator\Packages\DataExplorer\quickstart.

image

Copy and Unzip DocumentDB-Quickstart-DotNet.zip and open todo.sln in Visual Studio 2017 and your solution structure will look like below:

image

Now run the application in your Visual Studio.

1. You will see an initial screen:

image

2. Click on Create New:

image

3. New record will be added to your Azure Cosmos DB Emulator:

image

4. To verify in Cosmos DB emulator now open Cosmos DB explorer, click on Collections and Select ToDoList

image

5.Expand Documents and select item with id:da305da3-c1dc-4e34-94d9-fd7f82d26c58

image

Hope this article was helpful for you with initial development.  Share your feedback through comments and share this to your friends and colleagues.

Useful Links:

Azure in Germany–a complete EU cloud computing solution

May 18, 2017 .NET, Analytics, AppFabric, Azure, Azure in Germany, Azure IoT Suite, Cloud Computing, Cloud Services, Cloud Strategy, Cognitive Services, Computing, Data Analytics, Data Governance, Data Hubs, Data Warehouse, Emerging Technologies, Event Hubs, IaaS, Intelligent Edge, Internet of Things, IoT, IoT Central, IoT Hub, Machine Learning(ML), Media Services, Media Services & CDN, Messaging, Microsoft, Mobile Services, PaaS, SaaS, SQL Azure, Storage, Backup & Recovery, Stream Analytics, Virtual Machines, Windowz Azure No comments

With my earlier article Azure in China, it came in to my interest to look for any other country/region specific independent cloud data center requirements.  I came across Azure for US Govt(Similar to Amazon Govt Cloud) instance and Azure Germany data center.  For this article context I will be covering only Azure in Germany.

What is Azure Germany?

Just like regional regulatory requirements in China, Germany also wanted a completely locally owned/managed Azure Data Center for EU/EFTA/UK requirements. This is also to ensure stricter access control and data access policy measurements. This  approach is to enable organizations doing business in EU/EFTA and UK can better harness the power of cloud computing.

  • All customer data and related applications and hardware reside in Germany
  • Geo-replication between datacenters in Germany to support  business continuity
  • Highly secured datacenters provide 24×7 monitoring
  • It meets all Public sector or restricted industry requirements
  • Follows all Compliance requirements for EU/EFTA and UK.
  • Lower cost, locally accessible  within your business locations in Germany/EU.

“ Azure Germany is an isolated Azure instance in Germany, independent from other public clouds.”

Who controls it?

An independent data trustee controls access to all customer data in the Azure Germany datacenters. T-Systems International GmbH, a subsidiary of Deutsche Telekom and an experienced, well-respected IT provider incorporated in Germany, serves as trustee, protecting disclosure of data to third parties except as the customer directs or as required by German law.

** Even Microsoft does not have access to customer data or the datacenters without approval from and supervision by the German data trustee.

What Compliance?

Azure Germany has an ongoing commitment to maintaining the strictest data protection measures, so organizations can store and manage customer data in compliance with applicable German laws and regulations, as well as key international standards. Additional compliance standards and controls that address the unique role of the German data trustee will be audited over time. Refer to: Microsoft Trust Center compliance.

[Source : Microsoft Azure]

Useful Links:

IoT Central–Microsoft’s SaaS solution for IoT

April 25, 2017 AMQP, Analytics, Azure, Azure IoT Suite, Cloud Computing, Cloud Services, Cloud to Device, Communication Protocols, Connected, Connectivity, Device to Cloud, Emerging Technologies, HTTP 1.1, Identity of Things (IDoT), Intelligent Cloud, Intelligent Edge, Internet of Things, IoT, IoT Central, IoT Devices, IoT Edge, IoT Hub, IoT Privacy, IoT Security, Machines, MQTT, PaaS, SaaS, Stream Analytics No comments

Microsoft has today released their IoT SaaS offering for customers and partners called as “Microsoft IoT Central”.  IoT Central enables powerful IoT scenarios without requiring cloud solution expertise and also simplifies the development process and makes customers to make quick time to market solutions, making digital transformation more accessible to everyone without overhead of implement solutions end to end.

As per Microsoft :

“IoT Central provides an easier way to create connected products that propel digital business. Take the complexity out of the Internet of Things (IoT) with a true, end-to-end IoT software as a service (SaaS) solution in the cloud that helps you build, use, and maintain smart products.”

Benefits of IoT Central:

  • Proven platform and technology with enterprise grade security.
  • Reduced complexities of setting up and maintaining IoT infrastructure and solutions.
  • Building smart connected products with lesser cost  and lesser overhead would ensure higher customer satisfaction.
  • Quickly adapt to changing environments.

For those would need control on implementing end to end can still choose the PaaS solution Azure IoT Suite.

Below is a picture from @JanakiramMSV’s article from forbes.com, to help you have a high level look at all the IoT offerings from Microsoft.

az-iot

Sources:

All you need to know about Microsoft Azure Stack(Azure on On-Premises

May 20, 2015 Azure, Azure Stack, Cloud Computing, Cloud Services, IaaS, Microsoft, PaaS, SaaS, Storage, Backup & Recovery, Virtual Machines, Windows Azure Development, Windowz Azure No comments

Typically it is a hype among people that if a product comes from Microsoft, it needs to be criticized and thinking Microsoft would only be promoting their products with Azure. That’s not right and I would say we are being judgmental without even looking at the capabilities on Microsoft Azure.

Microsoft Azure the prime competitor to Amazon AWS offerings, has improved a lot and focus is more on providing cloud computing capabilities available for everyone.

azurestack1

What is Microsoft Azure Stack?

Simply it paves a way to engaging your data-center with On-premise – Private/Hybrid cloud computing capabilities.

Azure Stack is a combined solution consisting of Windows Server 2016, Azure Pack and Azure Service Fabric.

  1. Azure Pack is an arrangement of Azure features that Microsoft makes accessible to its facilitating hosting service providers and bigger business clients as a download that can keep running on top of Windows Server and Systems Center. 
  2. Service Fabric is the new infrastructure management technology Microsoft is integrating in to Azure and Windows Server that will empower applications to be developer, deployed and oversaw in micro-service structure.
  3. Windows Server 2016 is an upcoming server operating system developed by Microsoft as part of the Windows NT family of operating systems, developed concurrently with Windows 10 expected to be released in Q3, 2016 and is currently under Technical Preview.

Here’s a simplified view of the Azure Stack Architecture(Sourced from Microsoft Azure Stack Documentation):

    azurestack2
    What it takes to have Azure Stack – on your data-center?

    Read through this link for hardware requirements:

https://www.theregister.co.uk/2015/12/22/azure_stack_hardware_specs/

http://www.theregister.co.uk/2015/05/18/azure_stack_versus_azure_pack_whats_the_difference/