Creating an Azure VM with an Empty Data Disk

I was trying to create an Azure virtual machine to run a Domino server online with the following features:

  • Use PowerShell only
  • Latest version of Windows Server
  • Set auto-shutdown
  • Set user credentials on Windows Server
  • Add an empty second disk
  • A virtual network
  • A network security group with predefined rules
  • A public IP address to connect to
  • A storage account for logging and other files
  • Add OMS ID and Key (just in case)
  • Everything in one resource group and location
  • Configuration settings at the top of the script
  • Add comments
  • Write to the screen during processing

I experienced a lot more issues than I ever planned for. I thought that a complete PowerShell script must be available online. However, I could not find one. Thus, I am publishing the one that I created.

The PowerShell Code

Login-AzureRmAccount
Get-AzureRmSubscription | Sort-Object subscriptionName | Select-Object SubscriptionName
Select-AzureRmSubscription -SubscriptionName Pay-As-You-Go

# Declare the variables
$resourceGroup = "myDominoRG1"
$location = "Central US"
$vmName = "myDominoVM1"
$subnetName = 'SubNetDomino1'
$vnetName = "VNetDomino1"
$nsgName = "NSGDomino1"
$VMSize = "Basic_A2"
$storageType = 'Premium_LRS'
$dataDiskName = $vmName + '_datadisk1'
$strNum = 128
[int]$diskSizeInGB = [convert]::ToInt32($strNum, 10)
# Storage Account Name (must be lowercase)
$myStorageName = "mydominostorage1"

# set autoshutdown time for VM
$shutdown_time = "1700"
$shutdown_timezone = "Central Standard Time"

# OMS ID and OMS key
# Leave as is if you do not have an OMS ID and OMS key
$omsId = ""
$omsKey = ""

# Create user object
Write-Host "Create user object"  -ForegroundColor Green
$cred = Get-Credential -Message "Enter a username and password for the virtual machine."

# Create a resource group
Write-Host "Create a resource group"  -ForegroundColor Green
New-AzureRmResourceGroup -Name $resourceGroup -Location $location

# Create a storage account for this resource group
Write-Host "Create a storage account"  -ForegroundColor Green 
New-AzureRMStorageAccount -ResourceGroupName $resourceGroup -Location $Location -AccountName $myStorageName -SkuName Standard_LRS

# Create a subnet configuration
Write-Host "Create a subnet configuration"  -ForegroundColor Green
$subnetConfig = New-AzureRmVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 192.168.1.0/24

# Create a virtual network
Write-Host "Create a virtual network"  -ForegroundColor Green
$vnet = New-AzureRmVirtualNetwork -ResourceGroupName $resourceGroup -Location $location `
  -Name $vnetName -AddressPrefix 192.168.0.0/16 -Subnet $subnetConfig

# Create a public IP address and specify a DNS name
Write-Host "Create a public IP address and specify a DNS name"  -ForegroundColor Green
$pip = New-AzureRmPublicIpAddress -ResourceGroupName $resourceGroup -Location $location `
  -Name "mypublicdns$(Get-Random)" -AllocationMethod Static -IdleTimeoutInMinutes 4

# Create an inbound network security group rule for port 3389
Write-Host "Create an inbound network security group rule for port 3389"  -ForegroundColor Green
$rdpRule = New-AzureRmNetworkSecurityRuleConfig -Name "myRDPRule" -Description "Allow RDP" `
    -Access "Allow" -Protocol "Tcp" -Direction "Inbound" -Priority "140" `
    -SourceAddressPrefix * -SourcePortRange * `
    -DestinationAddressPrefix * -DestinationPortRange 3389 

# Create an inbound network security group rule for port 80
Write-Host "Create an inbound network security group rule for port 80"  -ForegroundColor Green
$httprule = New-AzureRmNetworkSecurityRuleConfig -Name "myHTTPRule" -Description "Allow HTTP" `
    -Access "Allow" -Protocol "Tcp" -Direction "Inbound" -Priority "100" `
    -SourceAddressPrefix "Internet" -SourcePortRange * `
    -DestinationAddressPrefix * -DestinationPortRange 80

# Create an inbound network security group rule for port 1352
Write-Host "Create an inbound network security group rule for port 1352"  -ForegroundColor Green
$notesrule = New-AzureRmNetworkSecurityRuleConfig -Name "myIBMNotesRule" -Description "Allow IBM Notes" `
    -Access "Allow" -Protocol "Tcp" -Direction "Inbound" -Priority "120" `
    -SourceAddressPrefix "Internet" -SourcePortRange * `
    -DestinationAddressPrefix * -DestinationPortRange 1352

# Create a network security group
Write-Host "Create a network security group"  -ForegroundColor Green
$nsg = New-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroup -Location $location `
  -Name $nsgName -SecurityRules $rdpRule,$httprule,$notesrule

# Create a virtual network card and associate with public IP address and NSG
Write-Host "Create a virtual network card and associate with public IP address and NSG"  -ForegroundColor Green
$nic = New-AzureRmNetworkInterface -Name myNic -ResourceGroupName $resourceGroup -Location $location `
  -SubnetId $vnet.Subnets[0].Id -PublicIpAddressId $pip.Id -NetworkSecurityGroupId $nsg.Id

# Create a virtual machine configuration
Write-Host "Create a virtual machine configuration"  -ForegroundColor Green
$vmConfig = New-AzureRmVMConfig -VMName $vmName -VMSize $VMSize | `
Set-AzureRmVMOperatingSystem -Windows -ComputerName $vmName -Credential $cred | `
Set-AzureRmVMSourceImage -PublisherName MicrosoftWindowsServer -Offer WindowsServer -Skus 2016-Datacenter -Version latest | `
Add-AzureRmVMNetworkInterface -Id $nic.Id
Write-Host "Add an empty data disk to the virtual machine configuration"  -ForegroundColor Green
#$vmConfig = Add-AzureRmVMDataDisk -VM $vmConfig -Name $dataDiskName -CreateOption Empty -ManagedDiskId $dataDisk1.Id -Lun 1
$vmConfig = Add-AzureRmVMDataDisk -VM $vmConfig -Name $dataDiskName -DiskSizeInGB $diskSizeInGB -CreateOption Empty -Lun 1

# Create a virtual machine
Write-Host "Create a virtual machine using the virtual machine configuration"  -ForegroundColor Green
New-AzureRmVM -ResourceGroupName $resourceGroup -Location $location -VM $vmConfig

# Set the auto-shutdown time
Write-Host "Set the auto-shutdown time for the virtual machine"  -ForegroundColor Green
$properties = @{
    "status" = "Enabled";
    "taskType" = "ComputeVmShutdownTask";
    "dailyRecurrence" = @{"time" = $shutdown_time };
    "timeZoneId" = $shutdown_timezone;
    "notificationSettings" = @{
        "status" = "Disabled";
        "timeInMinutes" = 30
    }
    "targetResourceId" = (Get-AzureRmVM -ResourceGroupName $resourceGroup -Name $vmName).Id
}

New-AzureRmResource -ResourceId ("/subscriptions/{0}/resourceGroups/{1}/providers/microsoft.devtestlab/schedules/shutdown-computevm-{2}" -f (Get-AzureRmContext).Subscription.Id, $resourceGroup, $vmName) -Location (Get-AzureRmVM -ResourceGroupName $resourceGroup -Name $vmName).Location -Properties $properties -Force

# Setting up WinRM access

# Initialize the data disk

# Install and configure the OMS agent
If ($omsId -ne "") {
    Write-Host "Install and configure the OMS agent"  -ForegroundColor Green
    $PublicSettings = New-Object psobject | Add-Member -PassThru NoteProperty workspaceId $omsId | ConvertTo-Json
    $protectedSettings = New-Object psobject | Add-Member -PassThru NoteProperty workspaceKey $omsKey | ConvertTo-Json

    Set-AzureRmVMExtension -ExtensionName "OMS" -ResourceGroupName $resourceGroup -VMName $vmName `
        -Publisher "Microsoft.EnterpriseCloud.Monitoring" -ExtensionType "MicrosoftMonitoringAgent" `
        -TypeHandlerVersion 1.0 -SettingString $PublicSettings -ProtectedSettingString $protectedSettings `
        -Location $location
}
Write-Host "Finished!"  -ForegroundColor Green

Final Result

One resource group contains all of the resources created by the PowerShell script.

The network security group contains the correct security rules.

A public Internet address is configured.

The virtual machine is configured correctly and it started.

A second data disk was added to the virtual machine.

Update [July 11, 2018]: Follow the step-by-step instructions here to use the D: drive as a data drive on a Windows VM.

Resources

I referenced a number of resources to create this script. Below are a few of the important ones.

Create a fully configured virtual machine with PowerShell

https://docs.microsoft.com/en-us/azure/virtual-machines/scripts/virtual-machines-windows-powershell-sample-create-vm?toc=%2fpowershell%2fmodule%2ftoc.json

Create an Operations Management Suite monitored VM with PowerShell

https://docs.microsoft.com/en-us/azure/virtual-machines/scripts/virtual-machines-windows-powershell-sample-create-vm-oms?toc=%2fpowershell%2fmodule%2ftoc.json

Add-AzureRmVMDataDisk

https://docs.microsoft.com/en-us/powershell/module/azurerm.compute/add-azurermvmdatadisk

New-AzureRmVM

https://docs.microsoft.com/en-us/powershell/module/azurerm.compute/new-azurermvm?view=azurermps-6.3.0

Attach a data disk to a Windows VM using PowerShell

https://docs.microsoft.com/en-us/azure/virtual-machines/windows/attach-disk-ps

 

Next Steps

Initialize the data disk and install the Domino server software. As it is now, the second data disk can be used for any purpose.

I want to have a data disk in storage that has the Domino server software installed; but not configured. Then I can attach it to the VM. That would save time for multiple virtual machines.

I want to use a VPN connection to the virtual network. The public IP address should be VPN gateway. The virtual machines would not be exposed to the Internet directly. All connections would go through the VPN gateway.

I should be using an Azure Resource Manager (ARM) template. I want to deploy the resources consistently and repeatedly.

Using Microsoft Teams with WorkBoard

I’m finally getting back to blogging on Microsoft Teams. I had some computer issues and a daughter’s graduation party to contend with.

I’m interested in strategic execution. I hear many organizations talk about the importance of having a strategy; but very few execute it well. They usually get lost in daily and weekly fire-fighting. About 12 to 13 years ago, I was looking at a product from IBM called Workplace for Business Strategy Execution. It looked really good; but it was incredibly hard to install on WebSphere Portal 5.0. In fact, it was so hard that I thought that I was the only one in North America who could do it. I sent my step-by-step instructions to IBM at one point. Sadly, it appears that product never did well.

In this blog, I am looking at WorkBoard (https://www.workboard.com/) and how it integrates with Microsoft Teams. The WorkBoard website states that “Workboard’s solution helps organizations set, measure and execute strategic priorities faster”. You can read their website for up-to-date information. I will spend some time in the WorkBoard application. I want to create some content that I can then display in a conversation in Microsoft Teams. Then I want to see what I can do in Microsoft Teams.

Note: I am creating this blog post from within Word using a Blog Post template. I hope that it works out well.

Creating Accounts

I register one free accounts on workboard’s site: https://www.myworkboard.com. I send an invite to a two more team members during registration.

  • Megan Bowen – Marketing Manager
  • Isaiah Langer – Sales Rep
  • Emily Braun – Budget Analyst

Note: I entered the email address as all lower case.

Then I click on .

All three accounts received an email from WorkBoard, too. I quickly register the additional accounts by clicking on in the email. You can add more team members later by clicking on in the workspace.

Later, I can see who is on my team by clicking on . All three accounts are part of my team!

Key Terminology

It is helpful to have definitions of some key terms. I’m going to use the terminology that WorkBoard uses in their help documentation. https://workboard.zendesk.com/hc/en-us/articles/216294188-Overview-of-objectives-and-key-results

Set inspiring objectives for your team to get everyone aligned to one mission. Objectives should the drive work the team does, so the team doesn’t spend its time reacting to fire drills and emails.

Quantify success with fact-based key results for each objective. Key results define how you will measure success for your objective in a given time period.

The objective is what you want to achieve; key results are how you define and measure success.

Use workstreams to categorize and organize what the team needs to do to reach its objective and key results. That is, organize and plan work to hit the key results with workstreams.

Divide and conquer the work by assigning and scheduling action items.

The image below comes from the Elevate Business Performance with OKRs document published by Workboard Inc. I recommend that you read through this document to better understand OKRs. I am not planning to restate what WorkBoard has already provided.

Starting with WorkBoard

Workboard opens in my web browser with a pop-up screen displayed. I am using WorkBoard basic – free for up to 10 users. I read the screen and click on OK.

The left hand navigation displays what is important to me. It looks like I have three action items for today with 8 action items for this week. The good news is that none of my tasks are overdue!

The main window pane shows my action items in a calendar. Here I can see the action items for today and the week.

I want to add some Objectives. I click on . The Objectives workspace appears in the web browser.

I click on to set my first objective.

The workspace changes to …

I like the heat map! Green is good and red is bad.

I click on to create my first objective. I take content for marketing objectives from http://www.yourarticlelibrary.com/marketing/marketing-management/5-objectives-of-marketing-management/27961.

I need to align the objective later. I click to set a Key Result.

This is where more time needs to be spent. It’s one thing to set an objective; but now I am quantifying it with a Key Result. This objective is tough to measure; but I need to put something in.

Note: WorkBoard provides good examples for OKRs.

I save the result and click Next to Align It.

I do not have any dependencies defined yet; but there are built-in workstreams for Contoso Marketing! I select Campaign and Social Marketing and click Done.

I now have an objective displayed.

There is so much more that I can do here. I know that I am just barely touching the capabilities of WorkBoard. I will have to explore it later.

Microsoft Teams

It’s time to integrate the bot! I click on in Microsoft Teams.

I search for WorkBoard in the Store and click on the tile.

I select the X1050 Launch Team and keep both Yes settings. I click Install.

I select the Digital Assets Web channel and setup the Bot.

The Conversation screen for the Digital Assets Web channel in the X1050 Launch Team opens. “Workboard” appears in the chat.

Like many power users, I forgo training and just try it out. I type in “How am I doing?”. I get a response from WorkBoard. I have some starter messages that I can use with Wobot.

I click on Connect with Workboard.

Note: I had to disable blocking of pop-ups.

I log into WorkBoard.

I then pick my account.

I accept the next screen.

A window displaying all of my integration settings appears. There are many of them. I can see that the integration with Microsoft Teams is enabled.

There are also some sample chats displayed for me.

– How am I doing on my objectives? 
– Show my calendar 
– Show my 1on1s with Mary 
– Reschedule meetings for today 
– Get my Outlook calendar 
– Create an action item 
– Show my results 
– For more conversation starters, ask WoBot to “help me”, “help me with objectives” or “help me with meetings”! (And Workboard chatbot has a sense of humor — say “Tell me a joke” for a quick smile.)

Chatting with Wobot

I return to the conversation and enter “@Workboard How am I doing on my objectives?” in the chat. I get an immediate response.

I respond with “Yes”. The response is good for me! I am in the green! I know that is good since red would be bad.

There is the new Objective that I created.

I created a new action item using Wobot.

Wobot provides editing features for the action item.

Here is the action item in WorkBoard.

Now I will assign this action item to Isaiah Langer and update it.

That did feel good!

I log in as Isaiah Langer and see the action item listed in Requests for me.

What if I need help with WorkBoard objectives in Microsoft Teams?

What if I need help with WorkBoard workstreams in Microsoft Teams?

I can ask Wobot to list all of my workstreams. It displays them one after the other.

What I Have Not Tried Yet

I have not had time to:

  • try all of the features in WorkBoard
  • setup the Tab or Messaging with Microsoft Teams
  • show the WorkBoard mobile app
  • show content in the Microsoft Teams app
  • try more interaction between users in WorkBoard and Microsoft Teams
  • demonstrate what WorkBoard provides in reports in Microsoft Teams

Conclusion

I barely touched on what WorkBoard is and does. I think that I’m seeing only the beginning of Wobot’s integration with Microsoft Teams. Yet it looks good. Like many other tools and bots that integrate with Microsoft Teams, I can do the heavy work in WorkBoard and the light work in Microsoft Teams.

In my past blogs, I often refer to this as wanting to work across multiple Teams in one UI. In this case, I think WorkBoard is the UI that allows me to work on multiple teams. That is, teams that are using WorkBoard.

I think the challenge for Team administrators is knowing when to integrate with WorkBoard. The simple answer may be: integrate with WorkBoard when your team is working on a strategic initiative.