Wednesday, May 20, 2020

MS Build Developer Conference 2020. – Some important announcements

MS Build Developer Conference 2020. – Some important announcements

News 1#

Per the Azure portal, Microsoft has 58 Azure regions worldwide and available in 140 countries. As per MS Build 2020, it is announced that Microsoft has extended 3 more Azure regions which is a great leap in cloud computing. As per the latest announcement, the number has reached to 61. Wow…

It has officially left AWS and Google behind the race. As per MS-Build 2020 conference, the Azure alone has more regions than AWS and Google together. The below snapshot gives more clarity.


The Azure lovers would celebrate this for sure.

 

News 2#

Microsoft has announced, “Azure Static Web Apps” in this developer conference. This is an awesome service provided by Microsoft Azure team. It is a great work behind delivering this super cool service.

Microsoft Azure and GitHub came together and jointly given the privilege to developer community to automatically builds and deploys full-stack web apps to Azure from a GitHub repository.


The GitHub Actions workflow works in the background. When you create an Azure static web application, Azure sets-up a GitHub actions workflow in the application’s source code repository that looks at the code branch of developer’s wish. Whenever the developer commits any changes to the repository, the GitHub actions invokes and build the application and if successful then immediately deploys the application and its API to Azure. So cool… I’m sure, it would make the developers’ life super easy.

 

News 3#

Introducing Azure Synapse Link.

It is a cloud-native implementation of hybrid transaction analytical processing (HTAP). The background of innovation of Azure Synapse Link was the various boundaries in enterprise data warehousing and big data analytics which were first tried removing through the Azure Analytics in November 2019. But there were several other barriers carried forwarded which attracts the cost and complex HTAP implementation.

Azure Synapse Link has the capability to trash the barriers between Azure Operational Database services and Azure Synapse Analytics.


 

Key take-aways:

  • 1      Enable real-time data analytics
  • 2      No ETL required
  • 3      No performance impact on the database

Some other great announcements are:

  • a     Accelerating enterprise app development with Power Platform
  • b    Various enhancements in Visual Studio Code
  • c        Visual Studio Codespaces is coming to GitHub
  • d       .Net 5 Preview 4 released

And there are some more…

Hope you enjoyed the quick reference of the most important announcements by Microsoft.

Happy reading!

 Abhishek Maitrey

Twitter: @abhimaitrey


Sunday, May 17, 2020

Create Web App using ARM Template




Learn how to create a web app using ARM template in just 11 minutes. The primary focus is on using Parameters and Variable in ARM template.
https://www.youtube.com/watch?v=fIDnQoeKz4k


Crack Interview on git with hands-on exercises Part 1

Objective

The core objective of this article is to share the different ways of asking git related questions in the interviews. I have tried my best to cover basic to experienced level questions. I know covering all git topics are not possible in a single article, therefore, I decided to prepare a series of articles. I’m sure you shall understand git quite easily and it will be helpful for you to crack the git questions.

Please note: I’ve Microsoft Windows operation system in my computer therefore my practical examples will follow the Windows git command pattern.

Best of luck in advance…

What do you know about git? Or

Can you give a brief introduction of git? Or

Have you used git? If yes, what is that?

Explanation:

·        It is Distributed Version Control System

·        It is a Command-Line tool

·        It works in the terminal window and get integrated with PowerShell, Command Prompt terminal

·        Git basically takes an image of what all your files look like at that moment and stores a reference to that snapshot.

·        Though git works in distributed and disconnected mode (until you explicitly push the changes to remote), mostly it works locally.

How can we install git?

Explanation:

a.     Download git from its official site

Download the latest version of git according to the operating server you have in your computer.

https://git-scm.com

git is available for Windows, macOS, and Linux operating systems. The installation is quite straight forward. Just follow the Wizard instructions and do it.

b.     Install through package manager

git can also be installed through chocolatey package manager.

Follow the https://chocolatey.org/packages/git

To install Git, run the following command from the command line or from PowerShell:

 Screen1: Steps of git installation using Chocolatey

How to check the git version using CLI?

Using command prompt or PowerShell, the command is

git version

or

git –version

Both would return the same result.

Do we have git GUI tools for our operating systems?

Indeed, there are a variety of GUI tools are available for Windows, MacOS, and Linux for computer operating systems and few are for Android and iOS mobile operating systems. Though git is a Command-Line (CL) based utility there are various GUI available to use git.

I’ve worked upon the following very popular git GUIs and as per my preference of usage, I have kept these in chronological order.

GUI name

Supported OS

Link to download

Free/Paid

SourceTree

Windows, Mac

https://www.sourcetreeapp.com/

Free

GitKraken

Windows, Mac, Linux

https://www.gitkraken.com/

Free for non-commercial users else paid

GitHub Desktop

Windows, Mac

https://desktop.github.com/

Free

Tower

Windows, Mac

https://www.git-tower.com/windows

Paid

 

How to start working on git?

Before start using git, you must recall that git is a version control system and git has an additional privilege to keep version tracking locally and remotely. So, if you are configuring git, it will manage the repository locally. So, let get started…

I assume, currently, we don’t have anything linked with a remote repository and solely working LOCALLY.

Step 1: Go to your working directory. Initialize the git repository using the following command.

D:\Learning\git>git init LearningProject

This command will initialize the empty git repository in your current working directory.

Once successfully initialized, git will create a hidden directory in your working directory called “.git” and a new folder with your defined project name will be created. In our case it will be “LearningProject”.

Note: It is very very important to understand that the .git hidden folder is the real mechanism that manages all the git related operations on your repository. For a beginner, it is not really necessary to understand the .git folder in detail but for an experienced person, one should at least know some basics.

The .git hidden folder consists of various sub-folders and files. We may have a super quick look.

hooks: Git hooks folder consists of the scripts that are executed before or after the events

info: it contains the exclude file. We’ll discuss .gitignore sometime later.

objects: A much important folder that contains saved content as the hash value.

refs: contains references and tags information

config: This file contains all the configuration you would set for your project is saved permanently in this file like username, email, etc. 

description: this file contains the data about the repositories which can be seen on GitWeb only

HEAD: Head file contains the reference to the branch we are currently working on it.

Step 2:

Put the content in the project folder. Git does not bother what kind of project are you keeping under it.

This could be any type of files or a complete project irrespective of any programming language.

 

Stopping this article here and would come back in Part 2 article with followings:

·        Config git for global usage in your system

·        Create dot net project and apply git commands for version control

Thanks for reading. Happy learning!

 

Abhishek Maitrey

Twitter: @abhimaitrey

This article is also published on :

https://tutorialslink.com/Articles/Git-Interview-Questions-Answers-with-hands-on-exercises-Part-1/1423

 

 

 


Friday, May 15, 2020

Use of Variables In Terraform

StorageAccount using Azure ARM || Part-1 ||

Git Version Control Introduction

Learn Git quickly

Essentials to Create a Virtual Machine using PowerShell on Azure

Introduction

 
There are various options/parameters which would be used while creating a Virtual Machine either by using Azure Portal or by using Powershell AZ module
 
Prerequisites:
  • Powershell 6+
  • Az Module
In this section, we’ll discuss the following parameters:
  1. Resource Group Name
    It is a kind of virtual container. Each resource in Azure should be assigned to a Resource Group

  2. Virtual Machine Name
    That is the user’s choice. You can keep any name for your virtual machine.

  3. Location
    In which location do you want to spin-up your virtual machine? Azure has various regions across the globe. It is advised to read about latency and available services in different Azure regions beforehand.

  4. Virtual Network Name
    You can either create a new virtual network or assign the existing one to your virtual machine

  5. Subnet Name
    The subnet is an integral part of a virtual network. You can either create a new subnet or assign the existing subnet to your virtual machine

  6. Security Group Name
    The Network Security Group is also known as Firewall. It protects from direct access to your virtual machine. It could be directly assigned to a virtual machine or the subnet. That is a design choice.

  7. Public IP Address Name
    It is the address through which this machine could be accessed

  8. Open Ports
    If you want various options to allow your virtual machine to be accessed like HTTP, HTTPS, RDP, etc.

    Port 80 is for HTTP, Port 443 is for https (secure connection), Port 3389 for RDP access.

Create a VM using Powershell

 
Ensure you have 6.0.0 or above Powershell version installed and the AZ module installed before running the command on Powershell:
 
C:\> New-AzVM -ResourceGroupName “azrgdemo” -Name “azvmdemomachine” -Location “EastUS” -VirtualNetworkName “azvnetdemo” -SubnetName “default” -SecurityGroupName “azdemoNSG” -PublicIpAddressName “azdemoipaddr” -OpenPorts 80,3389,443
 
Though there are a couple of other optional parameters that you could also pass in the command, such as Tags, however, I have skipped this for this moment.
 
When you run the above command, the Powershell will ask for the credentials
 
Example
 
User: abhishekmaitrey
Password for user abhishekmaitrey: **********
 
Now the Powershell AZ module will execute this command and start the VM creation process. This activity may take some time. Once the command has executed successfully, you will be notified with some detailed information on a new virtual machine. You should see the following:
  • Virtual Machine Id – It is generally a hashed value like GUID
  • Fully Qualified Domain Name

Saturday, May 2, 2020

MS Visual Studio Online is now Visual Studio Codespaces


Microsoft is famous for rebranding its products timely. The Visual Studio Online was first announced in May 2019 as Private Preview and just after six months Microsoft announced it as Public Preview during Microsoft Ignite 2019 in the month of November.

Visual Studio Online could not receive the global market yet and Microsoft has announced the new name to the same product Visual Studio Codespaces on 30 April 2020.

There are various factors speculated behind this big decision. The technologies are gradually moving towards Big Data, AI enabled systems and there is demand of such solutions in development space too.

It is not only the browser-based version of Visual Studio but more of a cloud-based development environment. You can access Visual Studio Codespaces in remote environments from common templates, could be cloned from a GitHub repo, and also allow edit code in a browser.

The big news is the price drop of this rebranded service. I sense that this service would be a Pay As You Go model.

The below image and pricing details have been taken from Microsoft’s official blog.

The new pricing for each active Codespace breaks down like this:

Linux instance type
Price / hr (today)*
Price / hr (next week)*
Standard (4 cores, 8 GB RAM)
$0.45
$0.17
Premium (8 cores, 16 GB RAM)
$0.87
$0.34

Here’s the above pricing table repeated with the Basic instance type added in:

Linux instance type
Price / hr (today)*
Price / hr (next week)*
Basic (2 cores, 4 GB RAM)
$0.24
$0.08
Standard (4 cores, 8 GB RAM)
$0.45
$0.17
Premium (8 cores, 16 GB RAM)
$0.87
$0.34

Thanks for reading
Abhishek Maitrey
Twitter: @abhimaitrey

Friday, May 1, 2020

How to create a storage account using ARM template?


How to create a storage account using ARM template?

The easy steps guide.

Objective

The core objective of this article is to get you introduced an ARM template with step-by-step hands-on exercise. The basic introduction of ARM template has been included intentionally to get a quick understanding and revision.

Brief introduction of ARM template

·        Infrastructure as Code (IaC) – configuration of resources in form of code to skip the repetitive task and easily managed by Version Control
·        Declarative syntax in JSON file format
·        Used for automate deployment
·        Adopt agile development method

Tools to create ARM templates

·        Azure Portal
·        Any text editor like VS Code, Notepad++ etc.
·        Visual Studio
Additional useful tips
·        VS Code Extension for ARM
·        Readymade templates available on Github and Microsoft Azure Documentation
Notice, I’m using VS Code to create this example. Install Azure Resource Manager (ARM) Tools extension before proceeding further. This is very useful extension provided by Microsoft. Trust me, it will ease your life while creating ARM templates.

Snapshot 1: ARM template extension by Microsoft

Ways of deployment of the ARM templates

1.      PowerShell
·        Install AZ module using PowerShell. Please note: Az module commands will work on PowerShell version 6.0 and above.
·        You can install PowerShell using this link and follow the instructions as given in the document.
2.      CloudShell
3.      Azure Custom Deployment center
PowerShell and CloudShell are almost similar so I’ll explain the deployment through PowerShell in this article along with Azure deploy a custom template.
Format of ARM template
ARM template is written in JavaScript Object Notation (JSON) and the initial template has the following structure:

Snapshot 2: Basic ARM blank template

Explanation of template elements:

“$schema”: is a mandatory element. It has location of schema file. The version number could be different based on the what editor you are using and the scope of the deployment. So, the highlighted piece of information describes the version of schema version i.e. 2019-04-01.
Though there are various other schemas available and you are free to use any one of them but it also depends on deployment kind as mentioned earlier.
“contentVersion”:  is a mandatory element. It is mainly used for management of template version. You can pass any number sequence as per your convenience following the given format.
“resources”:  is a mandatory element. Any template meant to be created for provision/update and deploying at least one resource. The “resources” element receives an array of deployment resource(s) and their supportive elements.
Rest other elements are optional but very useful like “parameters”, “functions”, and “variables”
“parameters”: the custom values passed for deployment as parameters while executing the deployment script.
“variables”: the values are customized and used within template JSON file. It is used for simplifying the template file.
“functions”: you can pass user-defined methods within template file.
“output”: it holds the returned value after deployment.

A template for deployment [Example]

File name: 'storagetemplate.json’
{
  "$schema""https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion""1.0.0.0",
  "parameters": {
     "deploymentPrefix": {
     "type""string",
     "minLength"3,
     "maxLength"8
      },
    "storageAccountType": {
      "type""string",
      "defaultValue""Standard_GRS",
      "allowedValues": [
        "Standard_LRS",
        "Standard_GRS",
        "Standard_ZRS",
        "Premium_LRS"
      ],
      "metadata": {
        "description""Storage Account type"
      }
    },
    "location": {
      "type""string",
      "defaultValue": "[resourceGroup().location]",
      "metadata": {
        "description""Location for all resources."
      }}
  },
  "variables": {
   "uniqueSAName": "[concat(parameters('deploymentPrefix'),'-', uniqueString(resourceGroup().id))]"
 },
  "resources": [
    {
      "type""Microsoft.Storage/storageAccounts",
      "apiVersion""2019-04-01",
      "name": "[variables('uniqueSAName')]",
      "location": "[parameters('location')]",
      "tags"
          {
              "displayName""demo-storageacc01"
          }
      ,
      "sku": {
        "name": "[parameters('storageAccountType')]"
      },
      "kind""StorageV2",
      "properties": {}
    }
  ],
  "outputs": {
   
  }
}

Code snippet: Example template
Before deployment, let’s have a quick check through Azure portal.
·        Login to Azure Portal
·        Navigate to “Deploy a custom template”




Replace the above given template in the editor and immediately get the following result



There are 3 Parameters, 1 Variable, and 1 Resource identified in the template, which is correct and validated. Now the final step to deploy the above template. Which would come after the explanation of Parameters and Variable below.
Parameter 1

deploymentPrefix - for the environment name like Dev, QA, Staging, UAT or Prod, where to deploy or update. I have used this parameter in “variables” property within the current template.
Parameter 2

storageAccountType – is combination of Performance + Replication in the Azure portal.
allowedValues - restrict the users to choose any option out of given values
defaultValue – if no value for storageAccountType as parameter then the value given here would be accepted by default
metadata – it gives the (i) icon with a tiny popup for the explanation for user’s understanding.
Parameter 3

location – the region where to create the storage account.
defaultValue – we are using the same location as of resource group under which this account would be created.
metadata – it gives the (i) icon with a tiny popup for the explanation for user’s understanding.

Variable 1

Unique

Finally the usage of parameters and variable will be used in “resources” element.

How to deploy the template?

 Using Azure Portal >> Custom Deployment

Fill up the desired values in the given controls. Notice, these are the same parameters which have been declared in the template. The active subscription of your account will automatically get populated in Subscription dropdown.
You are free to use any existing Resource group or Create new here too. As per our template the Location dropdown will take the Resource group id by default otherwise you can choose any valid location from the dropdown.
Deployment Prefix will accept any string value minimum 3 but maximum 8 characters value as per declared in the sample template in this article.
Storage Account Type is prepopulated with the default value as per template. You are free to use any allowed value at this stage.


Once you are done with parameter values, tick the agreement and click the Purchase button as given in above snapshot.

Using PowerShell

First just ensure, you are using the PowerShell version 6.0 or above. For this article, I’m using Powershell version 7.0
How to confirm the PowerShell version?


Now you are ready to deploy the custom ARM template

·        Connect to Azure first using following command
PS D:\ azure> Connect-AzAccount
It would ask the Azure Portal credentials first for validation and then would allow you to perform any operation through command line.

·        Use the following command for deployment through PowerShell
PS D:\ azure> New-AzResourceGroupDeployment -Name 'demoforstorage' -ResourceGroupName 'demorg' -TemplateFile 'storagetemplate.json' 

> New-AzResourceGroupDeployment is the PowerShell command
> -Name parameter is given any name for the deployment
> -ResourceGroupName is given an existing Resource Group name which is ‘demorg’
> -TemplateFile is given the name of the template I have created above in this article.
Just hit the “enter” button and wait for 30-40 seconds. You’ll receive the output as Successful.
To cross-check, visit the Azure Portal > Resource Group > demorg

Please notice, there are two types of Deployment names mentioned in the below snapshot
1.      Microsoft.Template meaning I have deployed the ARM template using Deploy a custom template in Azure Portal.
2.      Demoforstoage meaning I have deployed the ARM template using PowerShell and given this name as parameter. Refer the deployment command given above.


I’ll discuss more detailed and relevant content regarding ARM template in another article.
Thanks
Abhishek Maitrey
Twitter: @abhimaitrey