Saturday, March 11, 2017

Create a Resource group in Azure

Here I’m gonna talk about creating the Resource group by using PowerShell.

First you need to login into the Azure portal by using the subscription that you have.

image

Then give the correct credentials and remotely connect to your Azure portal.

To Deploy a resource  first you need to find the correct location. To find the a available  locations you can run Below Command,

Get-AzureRmLocation | sort DisplayName | Select DisplayName 

PS C: Get—AzureRmLocation 
Di spl ayName 
Australia East 
Australia Southeast 
Brazi I South 
Canada Central 
Canada East 
Central US 
East Asia 
East US 
East US 2 
Japan East 
J apan West 
North Central US 
North Europe 
South Central US 
Southeast Asia 
UK South 
UK West 
I sort DisplayName 
Sel ect 
Di spl 
West 
West 
West 
West 
Central US 
Europe

To Create a new Azure Resource group, you can try the following command. Here I have used the Resource group name as "SL_Resource_Group" and the location as "East Asia"

New-AzureRmResourceGroup -Name "SL_Resource_Group" -Location "East Asia"

PS C : New—AzureRmResourceGroup 
—Name 
" SL_Res our ce_Group" 
r'East Asia" 
—Location

You will get the confirmation as below,

Resour ceGroupName 
Locat i on 
Pr ovi si oni ngState 
Tags 
Resour celd 
SL_Resource_Group 
eastas i a 
. Succeeded 
. 'subscriptions/l 
/ r esour ceGr oups roup

Here I'm going to create a VM by using a already given script. Once you run that, It will  create the VM under the resource group which you have created earlier. This will prompt for username, Password, DNS name 

New-AzureRmResourceGroupDeployment -ResourceGroupName "SL_Resource_Group" -TemplateUri https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-simple-windows/azuredeploy.json

PS New—AzureRmResourceGroupDepIoyment —ResourceGroupName "SL_Resource_Group" 
cmdlet Nee—AzureRmResourceGroupDepIoyment at cormand pipeline position I 
-T ateUr 
"https : / [raw. gi 
Supply values for the following parameters: 
(Type !? for Help.) 
adminUsername: HemaIAdmi n 
cmdlet New AzureRmResourceGroupDepIoy... 
adminpassword 
adminpassword 
Running script/ selection. 
Press Ctrl*3reak to stop. Press Ctrl+3

No comments: