[Azure Stack] Deploy an extension

February 5, 2016 at 2:32 pm in Azure Stack, Microsoft, TP1 by Florent

Like the new Azure version, it’s possible to deploy an extension like BGInfo, DSC, etc. The only problem is, that at this moment, the Add button doesn’t exist. You need to pass through PowerShell. To install BGIndo, execute the following command:

# Add the Microsoft Azure Stack environment
[net.mail.mailaddress]$AadFullMailAddress="florent@azurelabdvo.onmicrosoft.com"
$AadTenantId=(Invoke-WebRequest -Uri (‘https://login.windows.net/’+($AadFullMailAddress.Host)+’/.well-known/openid-configuration’) -UseBasicParsing|ConvertFrom-Json).token_endpoint.Split(‘/’)[3]

# Configure the environment with the Add-AzureRmEnvironment cmdlt
Add-AzureRmEnvironment -Name ‘Azure Stack’ `
    -ActiveDirectoryEndpoint ("https://login.windows.net/$AadTenantId/") `
    -ActiveDirectoryServiceEndpointResourceId "https://azurestack.local-api/"`
    -ResourceManagerEndpoint ("https://api.azurestack.local/") `
    -GalleryEndpoint ("https://gallery.azurestack.local/") `
    -GraphEndpoint "https://graph.windows.net/"

# Authenticate a user to the environment (you will be prompted during authentication)
$privateEnv = Get-AzureRmEnvironment ‘Azure Stack’
$privateAzure = Add-AzureRmAccount -Environment $privateEnv -Verbose
Select-AzureRmProfile -Profile $privateAzure

Set-AzureRmVMExtension -ExtensionName BGInfo -Publisher Microsoft.Compute -Version 2.1 -ExtensionType BGInfo -Location local -ResourceGroupName Compute -VMName W2012R2 -Verbose

image

And in the Azure Stack interface:

image

I tested the following extensions:

  • BGInfo
  • DSC
  • VMAccessAgent
  • CustomScriptExtension

You can find a list of extensions \\SOFS\CRP\GuestArtifactRepository. I don’t know if all of them work.