Custom Script Extension

The custom script extension opens up opportunities to automate PowerShell and Bash scripts at scale for both cloud and on prem servers.

Introduction

Many of you will be familiar with the custom script extension, and will be pleased to hear that these are also supported on your Windows and linux Arc-enabled servers.

Storage account

Create a storage account for custom scripts.

sa=arcpilotsa$uniq
az storage account create --name $sa --sku Standard_LRS --resource-group arc_pilot --location westeurope

Add a couple of containers.

az storage container create --account-name $sa --name powershell --public-access blob
az storage container create --account-name $sa --name bash       --public-access blob

Portal

Use the extension via the portal to add some software to one of the Windows servers.

  • Copy the example custom script
  • Add adobereader to the list of chocolatey packages
  • Add to your arcpilotsa<uniq> storage account
    • container: powershell
    • blob: custom_script_windows.ps1
  • Run the Custom Script Extension on win-01 via the portal

Troubleshooting

  • Where can you see the version of the extension?
  • Where is the installation logging?
  • Where would you check for script errors?
  • Where was the script downloaded to?
  • Where would you check the status?

Automated

  • use a PowerShell, CLI command or ARM template to run the script on win02 and win03

Resources

Next

You’re on the home straight! Just managed identities to go, and that is a guided lab.


Help us improve

Azure Citadel is a community site built on GitHub, please contribute and send a pull request

 Make a change