VM Deploy using ARM Template # json Template

… …

 Azure Resource Management Template -> ARM we use to make deployment faster and more repeatable.


Benefits of ARM Template.




ARM template takes care of your entire deployment for you, ARM template has a lot of benefits.

They improve consistency of deploying the resources so if you have to deploy the same resources again and again for a similar environment like Development, Quality to test production or testing environment, execute the code it does the deployment for the entire infrastructure stack for you. 

That means all your complex deployment or workout simply by ARM Template in JSON, Administrators are usually bombarded by deployment and multiple infrastructures related activity and it’s quite possible to for-gate to change some parameter on that Virtual machine or edit the property of that storage account.

ARM Template reduces the manual effort and reduces any types of mistakes and human error.


ARM template -:

What is Azure Resource Manager -: Azure Resource Manager allows you to provision your applications using a declarative template. In a single template, you can deploy multiple services along with their dependencies. You use the same template to repeatedly deploy your application during every stage of the application lifecycle.

Microsoft constantly adds new Resource groups into their repository.

ARM Templates will have certain Parameters and Variables.

To list out the template search for Azure QuickStart Templates in Google.


https://azure.microsoft.com/en-in/resources/templates/?cdn=disable 



Deploy VM using ARM template

Use the link below to open the template.

https://azure.microsoft.com/en-us/resources/templates/ 

Search for the VM template that you want to deploy (In my case I am deploying)

Deploy a simple Windows VM with tags

Click on Template Name -: Deploy a simple Windows VM with Tags

During the deployment you need to fill below parameter values.


Click Browse on GitHub -> Click DeploymentTemplate.json file 

In my case I am opening below marked json template.


Click Raw -> Copy all content and paste it notepad++ (In Notepad++ it is readable in proper format)




You can do modification in the template like which version do you want to deploy, what will be subnet mask, VMName



I am changing below two highlighted parameters.


Save this file in .json format


Now Launch PowerShell from windows PowerCli.


 


Login with Azure account to establish connection with Azure Portal.



Once Authentication done run below command

New-AzResourceGroupDeployment -name B2CRG -TemplateUri C:\Users\C5309368\Desktop\DeployeNewVMTemplate.json


Once you hit enter pop up will come to fill value.



Once you update all the parameters VM Deployment will start.


Now login to Azure Portal -> Click on Resource Group -> Deployment




Click to Resource -> Overview and you will see what is created and what is pending.


During the deployment, the first dependency will create. 


Once deployment will complete you will see New VM Inside the Virtual machines.
















Azure Resource Group # Resource create, delete, lock using PowerShell

 Azure Resource Group->  You can deploy, Manage and Monitor all the resources for your solution as a Group, rather than handling these resources individually.

You can repeatedly deploy your solution throughout the development lifecycle and have confidence your resources are deployed in a consistent state.

You can manage your infrastructure through declarative templates rather than scripts.

You can define the dependencies between resources so they are deployed in the correct order.

You can apply access control to all services in your resource group because Role based access control (RBAC) is natively integrated into the management platform.

You can apply tags to resources to logically organize all the resources in your subscription.

you can clarify your organization's billing by viewing costs for a group of resources sharing the same tag.

 Resource provider 

Microsoft has categorized resources and different categories.

Compute -> it will provide Images , Snapshots, Virtual Machines

Storage-> Storage provides Files, Strage Accounts, Blobs, Tables

SQL -> Tables, Structured 

Top categories is called Resource Provider and Subcategories is called Resource Type.


To check the list of resource provider login to Azure Portal and search for resource Explorer.


Click on provider and you will see a list of resource providers.

Once you expand the resource provider you will see resource type, like below.



Use below Command to Get Azure Resource Group list

Get-AzResourceGroup


Locking resource or resource Group using PowerShell

We lock resource groups, or resources to prevent other users in the organization from accidentally deleting or modifying critical resources. 

Use below Command to create AzResource group lock and protect Azure Resource Group.

New-AzResourceLock -Name "DoNotDelete" -LockLevel CanNotDelete -ResourceGroupName Resource_Powershell


“DoNotDelete” -> AzResource Group Lock name (Newly created)

Resource_PowerShell -> Resource Group Name that was earlier created using New-AzResourceGro***** Command.


How to check Azure Resource is locked or not using Azure portal.

Login to Azure Portal

Search for Resource Group -> You shall see a list of the resource created inside the Resource Group.


Select the resource group for which you applied lock level, in my case I applied on Resource_PowerShell.

Click on Lock ->

Lock Name is created, and lock type is set Delete. 

From the Azure Portal you can also lock your resource.

Login to Azure Portal

Search for Resource Group and inside the Resource Group search for resources.

Select the Resource that you want to lock -> Click Locks -> Add


Give the Lock Name 

Select Lock type

And press OK.


Now Try to check whether the resource is locked or not.

Use the below command to delete resources in PowerShell.

Remove-AzResourceGroup -Name Resource_Powershell


Command to get Azure resource lock ID

Get-AzResourceLock

Command to remove LockID from resource or resource group.

Remove-AzResourceLock -LockId /subscriptions/a02b1c64-6583-49b2-828f-eb5878d4fa75/resourceGroups/Resource_Powershell/providers/Microsoft.Authorization/locks/DoNotDelete

Resource “Resource_Powershell” is now not protected so you can now easily delete from resource group either using PowerCli or Azure Portal.

Command to remove Azure Resource Group

Remove-AzResourceGroup -Name Resource_Powershell




AWS L1 Interview question and answer

 

1).full form of AMI  -->amazon machine image

 

2).cheaper storage than S3?  -->Glaicer(s3 glacier)

 

3).max number of elastic ip's in aws? -->5

 

4).in aws which component collects the raw data?--->dynamodb

 

5).default max number of internet gateways? -->5,10,15,20----->5

 

6).which component does the backups and recovery in AWS?---->glacier(EBS)

 

7).VPC comes under the _____layer of OSI? -->networking

 

8).Default number of VPC versions?--->ipv4(doubt)

 

9).how can u make private subnets EC2 instances to access internet?---->through nat

 

10).Amazon route 53 allows by default_____ resource record set per hosted zone? ---->1(10,000)

 

11).Default vpc comes with _________-->subnet,gateway------>1

 

12).to set loosely coupled architecture ______------>ebs(Amazon SQS an SNS)

 

13).feature of simpledb  -->non relational

 

14).simpledb not good for______ ---->rawdata

 

15).Default VPC per region?---->1

 

16).which db stores raw data? -->dynamodb

 

17).max virtural private gateway per region?---->5

 

18).______ is used to distribute traffic from user to EC2 intance?  -->Elastic load balancer

 

19).VPC pricing depends on what---> Free

 

20).what type of database is simpledb?--->non relational

 

security group is statefull

acl is stateless

 

21).max number of elastic ip's------>5

 

22).Glacier is charged-------->yes both in and out

 

23).number of hosted zone per region------>500

 

24).to attach an ec2 to a subnet u need?------>vpc id

 

25).how many internet gateways per region------->5

 

26).how to extend the DC and have private connection to AWS?------>direct connect and hardware vpn

 

27).ip range of vpc------>ipv4(a /16 netmask (65,536 IP addresses) and /28 netmask (16 IP addresses))

 

28).route 53 in ipv6 uses------>forward AAAA and reverse PTR

 

29).number of db instances allowed in RDS----->40

 

30).which aws service is needed to start vpc----->network(ec2 console)

 

31).how many vpc can be create in single region------>5

 

32).when s3 bucket is linked with ec2 instance if the machine is terminated wt hapns---->no data loss

 

33).what amazon vpc will do----->to create a private cloud space(you can launch your resources like ec2 )

 

34).what amazon service used to scale according to the requirements------>autoscaling

 

35).which aws service used to monitor------>cloudwatch

 

36).to store logfiles and database what storage will be used------>ebs

 

37).with one route53 how many records can we create

              1000

              10000(ans)

              15000

              unlimited

 

38).portocol used by loadbalancing application

              tcp(ans)

              udp

              xml

              ss7

 

39).while creating new aws account what is the default option available

              ec2

              storage

              vpc(ans)

              loadbalancer

 

40).how much amazon charge to integrate a instance to vpc

              additional charge

              no additional charge(ans)

 

41).an ec2 instance that provide port translation protocol to a non eip instance to access intranet

via internet gateway

              nat instance(ans)

              router

              hardware vpn connection

              internet gateway

 

42).how many elastic ip associated with aws account----->5

 

43).essential element to create vpc----->name and cidr range

 

44).in aws schema is used as which type of database

              dynamo db

              rds(ans)

              simple db

              ebs

 

45).which connectivity is used in vpc

              internet

              interanet

              dc

              both a,c(ans)

 

46).spot instance is not good for _________

              testing

              batch processing

              transcoding

              transmiting(ans)

 

47).number of db instances per hosted zone

              10

              20(ans)

              30

              50

 

48).which db is not used in aws----->redshift

(amazon arora, mysql, mariadb, postgresql, oracle, sql server(ms sql)----->these are used by aws)

 

49).which aws service is loosely coupled

              ec2

              s3

              ebs(ans)

              elb

 

50).(ans:cloudwatch)____________with elb the load balancing can happen

 

51).which service is used for backup and restore

              (ans:ebs)

 

52).which operational process is used by aws for data security

              ans by google:decommanting of storage devices using industry- standard practices

 

53).to protect s3 form accidental deletion and overwriting

              ans:versioning

 

54).which has high storage capacity

              s3(ans)

              ebs

 

55).cidr(classless interdomain routing)

 

56).not the feature of simpleDB

              asynchronous access

              no schema

              automatic access(ans)

 

57).simpleDB is not good for

              testing

              robust transaction(ans)

              transcript

              batch policy

 

58).not default instance per region

              internet gateway

              vpc

              subnet

              ec2(ans)

 

59).y bucket policy necessary----->to give permission to access to s3 resources

60).what data consistency model does amazon s3 used?----->read after write consistancy(eventual)

61).default instance per region

              internet gateway

              vpc(ans)

              subnet

              ec2

 

62).For which database no need to predefine schema to add data----->dynamodb

 

63).which rds....... volumes for raw data and database .....> ans : s3

 

 

64).if AMI instance is stored in s3 which of the following is not true

              data persistance out of instance

              boot in minutes(ans)

              free i/o costs in root directory

              none of these

 

65).which storage is good to store long term data and with low cost------->glacier

 

66).A nosql database for small data persiste........--------->dynamodb

 

PowerShell Basic to Administrator

Run below command to get help

Get-Help Get-service -ShowWindow

 


To get the status of multiple services you can run below command.

Get-Service -Name BITS, wuauserv, W32Time

 


To get the status of multiple services starting with B, A,W you can run the below command.

Get-service -name B*, a*, W* 

You can also use short name of command or service to get status 

Get-Service bits 


gsv bits (GSV= Get-Service)

 


Command to check all Event log

Get-EventLog

Command to check System log

Get-EventLog -LogName System

Command to check last 3 system newly error related log

Get-EventLog -LogName System -Newest 3 -EntryType Error

 


Command to check last 3 system newly error related log of Remote Machines

Get-EventLog -LogName System -Newest 3 -EntryType Error -ComputerName comp1, comp2, comp3 

 

 

Use of Pipeline | in powershell ->

 

In PowerShell, the vertical bar ( | ) is the pipe symbol. This tells PowerShell that you want to take the output of one command and pass it as the input (or pipe it) to the next command.

From pipeline Left command output will be input for right command.

 


Get-Service -Name BITS, wuauserv, W32Time

Get-service -name B*, a*, W*

Get-Help Get-service -ShowWindow

Get-Service -DisplayName windows

Get-Service bits

gsv bits

Get-EventLog -LogName System -Newest 3 -EntryType Error -ComputerName comp1, comp2, comp3

Get-Module -ListAvailable 


Featured Post

HPE MSA 2040 configuration step by step

HPE MSA 2040 configuration Default IP range for HP SAN storage MSA 2040 is 10.0.0.1/2 You need to connect your laptop and storage with...