Azure Stack: Adding the BGInfo extension to Azure Stack VM’s using Azure Stack PowerShell

A quick and simple blog about adding the BGInfo extension to an Azure Stack VM using PowerShell.  I decided to write this blog because I started getting confused which VM I was working in tonight. I am pretty sure I have seen some ARM Templates that will do something like this.  I know for sure there are ARM Templates that will install the Microsoft Monitoring Agent Extension for Windows.

First Task:  Install Azure Stack PowerShell

If you already have your management environment setup you can just skip on down to the BGInfo section.

This task is pretty simple and very well documented in the following Microsoft Docs website:

Install PowerShell for Azure Stack

Run the following from an elevated PowerShell session:

Register-PsRepository -Default
Set-PSRepository -Name “PSGallery” -InstallationPolicy Trusted
-Name PowerShellGet -ErrorAction Stop
Import-Module -Name PackageManagement -ErrorAction Stop
Get-PSRepository -Name “PSGallery”
Install-Module -Name AzureRm.BootStrapper
Use-AzureRmProfile -Profile 2017-03-09-profile -Force
Install-Module -Name AzureStack -RequiredVersion 1.3.0

Note:  If using anything older than 1804 make sure the -RequiredVersion is 1.2.11 and not 1.30

Second Task:  Configure the Azure Stack PowerShell environment

The following Microsoft Docs website is a good reference.

Configure the Azure Stack PowerShell environment

Run the following from an elevated PowerShell session:

$ArmEndpoint = “<Admin Resource Manager endpoint for your environment>”
Add-AzureRMEnvironment `
-Name “AzureStackAdmin” -ArmEndpoint $ArmEndpoint
Add-AzureRmAccount -EnvironmentName “AzureStackAdmin”

Note:  For Azure Stack development kit, the value for the $ArmEndPoint is set to https://adminmanagement.local.azurestack.external.  For an integrated system it will be different based off your configurations.  


Add BGInfo Extension to an Azure Stack VM

I Bing’d a few tries and came up with some old ways to add this extension.  However, none of the commands work.  I finally found the solution yet again on Microsoft Docs website.

I used the following to install the BGInfo Extension on a few machines I am currently working on. This works great for that one off type of solution.

Set-AzureRmVMBginfoExtension -vmname AzSDfwMgmt -ResourceGroupName azs.dfw.infrastructure -TypeHandlerVersion 2.2 -Location DFW

The -TypeHandlerVersion parameter is for the version of the extension.  Currently the BGInfo extension is version but all you need to add is 2.2 for it to work.

It will take a few minutes then it will return if it was successful or not.  If it was successful, log on the VM that the extension was deployed and log back on and you will now have your information on your Desktop.



Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s