This article shows you how to [task] by using Azure and Azure Resource Manager module commands. This is intended to help you learn the new commands and migrate existing scripts to the new commands.
If you still need to do so, install at least the [version number] version of Azure PowerShell on your local computer. Using an earlier version will have different Azure Resource Manager cmdlets described in this article. For details, see:
- How to install and configure Azure PowerShell for instructions on setting up Azure PowerShell.
- Using Windows PowerShell with Resource Manager for basics on using Resource Manager.
Note
Most tasks require you to use an administrator-level Azure PowerShell command prompt.
This [table | section] shows the command syntax.
These command examples use the following variables:
$FriendlyName"<Describe value>"
Service Management | Resource Manager |
---|---|
syntax |
syntax |
[Short intro sentence about the command. Omit if there's nothing to say. But if it uses approaches such as the pipeline, explain that]:
[command string]
Here's an example that uses [cmdlet names)] to [task]. It includes commands that:
- [short verb, uses, has, is, etc.]
- [following short verb]
- [variable 1]
- [variable 2]
$family="Windows Server 2012 R2 Datacenter"
$image=Get-AzureVMImage | where { $_.ImageFamily -eq $family } | sort PublishedDate -Descending | select -ExpandProperty ImageName -First 1
$vmname="AZDC1"
$vmsize="Medium"
$vm1=New-AzureVMConfig -Name $vmname -InstanceSize $vmsize -ImageName $image
$cred=Get-Credential -Message "Type the name and password of the local administrator account."
$vm1 | Add-AzureProvisioningConfig -Windows -AdminUsername $cred.GetNetworkCredential().Username -Password $cred.GetNetworkCredential().Password
$vm1 | Set-AzureSubnet -SubnetNames "BackEnd"
$vm1 | Set-AzureStaticVNetIP -IPAddress 192.168.244.4
$disksize=20
$disklabel="DCData"
$lun=0
$hcaching="None"
$vm1 | Add-AzureDataDisk -CreateNew -DiskSizeInGB $disksize -DiskLabel $disklabel -LUN $lun -HostCaching $hcaching
$svcname="Azure-TailspinToys"
$vnetname="AZDatacenter"
New-AzureVM –ServiceName $svcname -VMs $vm1 -VNetName $vnetname