Documentation forSecurity Event Manager

Deploy from PowerShell (Windows)

Scripts are not supported under any SolarWinds support program or service. Scripts are provided AS IS without warranty of any kind. SolarWinds further disclaims all warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The risk arising out of the use or performance of the scripts and documentation stays with you. In no event shall SolarWinds or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the scripts or documentation.

PowerShell is a command-line interface that is installed by default on newer Microsoft systems. Find more information here (© Microsoft 2020, available at docs.microsoft.com, retrieved October 5, 2020).

Lines starting with the # character are comments. The back quote (`) character on the end of lines indicates multi-line commands.

  1. From a command line (Windows Command Prompt or PowerShell), run the az login command.

    Log in with any authentication option. Running the az login command is recommended. For more details and other options, see Sign in with Azure CLI 2.0 (© Microsoft 2020, available at docs.microsoft.com, retrieved October 5, 2020).

  2. When the browser launches prompting you to log in, sign in to Microsoft Azure with your account credentials.

  3. Create your script. The following script is a template: you will need to fill in the variables for your Azure VM environment. The script will run, upload your two VHD files, and then create your VM in the Azure Portal. You can also download the script from SolarWinds using this link.
    <#
    Scripts are not supported under any SolarWinds support program or service. Scripts are provided 
    AS IS without warranty of any kind. SolarWinds further disclaims all warranties including, 
    without limitation, any implied warranties of merchantability or of fitness for a particular 
    purpose. The risk arising out of the use or performance of the scripts and documentation stays
    with you. In no event shall SolarWinds or anyone else involved in the creation, production, 
    or delivery of the scripts be liable for any damages whatsoever(including, without limitation, 
    damages for loss of business profits, business interruption, loss of business information, or other
    pecuniary loss) arising out of the use of or inability to use the scripts or documentation.
    #>
    # How to use:
    # copy script to folder that contains azure disks
    # change <USERNAME>, <SEM_VERSION>, <STORAGE_ACCOUNT>, <ACCESS_KEY>, <RESOURCE_GROUP>, <VM_LOCATION>
    # log in to azure (az login)
    # run script
    #
    ############################################
    $username=<USERNAME>
    $semVersion=<SEM_VERSION>
    Write-Host "SEM version: $semVersion" -foreground Green
    # storage account and key set to ENV to avoid typing it to each command
    $env:AZURE_STORAGE_ACCOUNT=<STORAGE_ACCOUNT>
    $env:AZURE_STORAGE_ACCESS_KEY=<ACCESS_KEY>
    $disk1Filename="SolarWinds-SEM-Azure-$semVersion-disk1-system.vhd"
    $disk2Filename="SolarWinds-SEM-Azure-$semVersion-disk2-data.vhd"
    $sku="Standard_LRS"
    $vmSize="Standard_B1s"
    $resourceGroup=<RESOURCE_GROUP>
    $vmLocation=<VM_LOCATION>
    $vmName="$username-sem-$semVersion"
    $disk1Name="$vmName-disk1.vhd"
    $disk2Name="$vmName-disk2.vhd"
    # check for presence of files
    if (!((Test-Path $disk1Filename) -and (Test-Path $disk2Filename)))
      {Write-Host "Couldn't find .vhd files" -foreground Red; break}
    # upload system and data disks
    az storage blob upload --container-name vhds-built --type page --file $disk1Filename --name $disk1Name
    az storage blob upload --container-name vhds-built --type page --file $disk2Filename --name $disk2Name
    # get blob urls
    $blobUrlDisk1=az storage blob url --container-name vhds-built --name $disk1Name
    $blobUrlDisk2=az storage blob url --container-name vhds-built --name $disk2Name
    # create system and data disks
    az disk create --resource-group $resourceGroup --sku $sku --name $disk1Name --source $blobUrlDisk1
    az disk create --resource-group $resourceGroup --size-gb "250" --sku $sku --name $disk2Name
     --source $blobUrlDisk2
    # create a machine and enable boot diagnosticsaz vm create --resource-group 
     $resourceGroup --size $vmSize --public-ip-sku "Basic" --location $vmLocation 
     --name $vmName --os-type "linux" --attach-os-disk $disk1Name --attach-data-disks $disk2Name
    az vm boot-diagnostics enable --name $vmName --resource-group $resourceGroup --storage $env:AZURE_STORAGE_ACCOUNT
           
  1. Launch PowerShell.
    Change the directory (cd) in PowerShell to the directory where the VHD files reside on your local system.

  2. Paste your script into PowerShell, and then press Enter.

    You can monitor the progress as the script is running. If the script encounters an error, such as a typo in your script, simply correct the error, and rerun the script.

    Upon completion, you can access your new VM in the Azure Portal under Home > Virtual machines.