Azure Cosmos DB is the globally distributed, multi-model database service for building planet scale apps. You can easily build globally-distributed applications without the hassle of complex, multiple-datacenter configurations. Cosmos DB automatically replicates all of your data to any number of regions of your choice, for fast, responsive access. Cosmos DB guarantees 99.99% high availability.
Only Cosmos DB allows you to use key-value, graph, and document data in one service.
One of the APIs Azure Cosmos DB supports is the SQL (DocumentDB) API.
https://azure.microsoft.com/en-in/blog/dear-documentdb-customers-welcome-to-azure-cosmos-db/ is a good link to read further.
To build always-on, scalable, distributed applications in azure from your development machine, you need to ensure right tools are already installed.
This blog is to install tools for VS 2017.
While installing or modifying VS 2017 on your development machine ensure option ‘Azure development’ is checked on.
Apart from this you need Microsoft Azure Service Fabric SDK on your machine. The SDK gets installed using Web installer 5.0. The link for SDK is:
Visual studio is now ready to allow you create service fabric applications.
Choose the service you want to create:
The purpose of this blog is to get the dev aware of how the PowerShell can be used to connect to MySQL db and insert a sample record.
With the increase of automation in industry, powershell is made responsible for doing many more things including inserting a new record in MySQL database.
The script flow start at line 28 by setting bthe username/ password/ database name, server name of the MYSQL database. By Default the port to connect db is 3306.
$query parameter of powershell need to be set for correct insert DML statement.
Next is Powershell function call which takes username, password, server, database, query as parameter. Line 1 to 26 is PowerShell function which handles this.
For this function to work perfectly it necessary for[reflection.assembly]::LoadFrom(“C:\abc\MySql.Data.dll”)
Statement to execute with success. What this statement do is load MySQL.data.dll assembly in script.
Its >net and MySQL connector Dll. You can get this dll by creating a new project in .Net Visual studio and add a new package by searching ‘MySQL’. Make sure you correctly set this DLL path in script.
This function takes care of establishing the connection with MySQL, Open the connection, execute the SQL DML query and return the response.
I tested this script in Windows 10, Powershell 4 and MySQL 8.4.5 and works fine.
By default when you install Vs2015 ( Enterprise or Community), .Net code is not installed. You need to manually install it by following the below link:
string assemblyPath = @”<exe/ dll path>”;
var assembly = Assembly.LoadFrom(assemblyPath);
var customAttributes = assembly.GetCustomAttributesData();
var dotnetFramework = customAttributes.FirstOrDefault(attr => attr.AttributeType.Equals(typeof(TargetFrameworkAttribute)));
var frameworkVersion = string.Empty;
if (null != dotnetFramework)
// first argument is the name of the framework.
frameworkVersion = (string)dotnetFramework.ConstructorArguments.Value;
Console.WriteLine(“Framework Version: “ + frameworkVersion);
This code will give you the .Net framework version the dll/exe was created in.
I tested it for 4.5, 4.6.1 , 4.5.2 and gives the correct info.
The code in this article talks about how to read multiple information in PE header, machine, no of sections, check for bit ( 32 or 64) etc..
Must read article if you want to know the intricacies of what .DLL and .exe files contain.