Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Azure PowerShell

Azure PowerShell can be used to create and configure new virtual machines and networks in Azure. Azure PowerShell can be used from within both Windows Powershell , and from Azure Cloud Shell

...

Code Block
languagepowershell
PS C:\WINDOWS\system32> Install-Module -Name AzureRM -AllowClobber

PS C:\WINDOWS\system32> Get-Module -ListAvailable AzureRM


    Directory: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands                                                                                                                    
---------- -------    ----                                ----------------                                                                                                                    
Script     6.9.0      AzureRM                                                                                                                                                                 


PS C:\WINDOWS\system32> Set-ExecutionPolicy AllSigned -Scope Process

PS C:\WINDOWS\system32> Import-Module AzureRM

PS C:\WINDOWS\system32> Connect-AzureRmAccount


Account          : jonathan.bailey@034gc.onmicrosoft.com
SubscriptionName : TC-DevTest-UC
SubscriptionId   : fde9cf97-7bf0-4373-9fbd-eba18c6e0dfc
TenantId         : 2008ffa9-c9b2-4d97-9ad9-4ace25386be7
Environment      : AzureCloud


PS C:\WINDOWS\system32> New-AzureRmVm `
    -ResourceGroupName "TC-DevTest-ArcGIS-RG" `
    -Name "TC-EGIS-DSC-3" `
    -Location "Canada Central" `
    -VirtualNetworkName "TCDevTestArcGISRGvnet776" `
    -SubnetName "default" `
    -SecurityGroupName "TC-EGIS-DSC-3" `
    -PublicIpAddressName "tc-egis-dsc-3" `
    -OpenPorts 3389
cmdlet New-AzureRmVM at command pipeline position 1
Supply values for the following parameters:


ResourceGroupName        : TC-DevTest-ArcGIS-RG
Id                       : /subscriptions/fde9cf97-7bf0-4373-9fbd-eba18c6e0dfc/resourceGroups/TC-DevTest-ArcGIS-RG/providers/Microsoft.Compute/virtualMachines/TC-EGIS-DSC-3
VmId                     : 3a2de909-8d66-4d26-8df6-ac809f41fdb0
Name                     : TC-EGIS-DSC-3
Type                     : Microsoft.Compute/virtualMachines
Location                 : canadacentral
Tags                     : {}
HardwareProfile          : {VmSize}
NetworkProfile           : {NetworkInterfaces}
OSProfile                : {ComputerName, AdminUsername, WindowsConfiguration, Secrets, AllowExtensionOperations}
ProvisioningState        : Succeeded
StorageProfile           : {ImageReference, OsDisk, DataDisks}
FullyQualifiedDomainName : tc-egis-dsc-3-f29f98.Canada Central.cloudapp.azure.com


PS C:\WINDOWS\system32> 

PowerShell DSC

PowerShell DSC (Desired State Configuration) can be used to configure Windows VMs once they are created. Esri provides documentation and sample configurations for installing and configuring ArcGIS Entperprise using PowerShell DSC.

...