Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1242407%22%20slang%3D%22en-US%22%3EAzure%20PowerShell%20Docker%20image%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1242407%22%20slang%3D%22en-US%22%3E%3CP%3EWith%20Azure%20constantly%20evolving%20and%20a%20new%20version%20of%20the%20Azure%20PowerShell%20modules%20every%20three%20weeks%2C%20it%20becomes%20quickly%20very%20challenging%20to%20maintain%20a%20production%20or%20development%20environment%20up%20to%20date%20and%20ensuring%20the%20smooth%20execution%20of%20scripts.%3C%2FP%3E%0A%3CP%3EIn%20order%20to%20facilitate%20this%20mission%2C%20we%20are%20excited%20to%20announce%20the%20first%20availability%20of%20the%20%3CSTRONG%3EAzure%20PowerShell%20Docker%20image%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22docker-hub.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F178513i333E04DC9492430E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22docker-hub.png%22%20alt%3D%22Azure%20PowerShell%20on%20docker%20hub%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EAzure%20PowerShell%20on%20docker%20hub%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1384079716%22%20id%3D%22toc-hId--1384078756%22%20id%3D%22toc-hId--1384078756%22%3EScenarios%3C%2FH2%3E%0A%3CP%3EThe%20Azure%20PowerShell%20docker%20image%20provides%20a%20contained%20environment%20with%20PowerShell%20and%20the%20Az%20module%20pre-installed%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EOn%20the%20same%20machine%20you%20can%20run%20scripts%20that%20are%20using%20different%20version%20of%20Az%20with%20no%20conflicts.%3C%2FLI%3E%0A%3CLI%3EYou%20can%20test%20a%20script%20against%20a%20different%20version%20of%20Az%20with%20no%20risks.%3C%2FLI%3E%0A%3CLI%3EYou%20can%20run%20interactively%20the%20latest%20image%20with%20the%20following%20command%3A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EYou%20can%20run%20interactively%20the%20latest%20image%20with%20the%20following%20command%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3Edocker%20run%20-it%20mcr.microsoft.com%2Fazure-powershell%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22docker-powershell-interactive.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F178517iD43AAE9C63B06AC2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22docker-powershell-interactive.png%22%20alt%3D%22Running%20PowerShell%20interactively%20in%20docker%20container%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ERunning%20PowerShell%20interactively%20in%20docker%20container%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20is%20possible%20to%20run%20a%20script%20targeting%20a%20specific%20version%20of%20Az%3A%3C%2FP%3E%0A%3CPRE%3Edocker%20run%20-it%20-v%20C%3A%5CUsers%5Cdcaro%5Csrc%3A%2Fsrc%20mcr.microsoft.com%2Fazure-powershell%3A3.6.1-ubuntu-18.04%20pwsh%20-file%20%2Fsrc%2Fscript.ps1%3C%2FPRE%3E%0A%3CP%3EThe%20following%20screenshot%20shows%20the%20same%20script%20being%20executed%20against%20two%20versions%20of%20Az.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22runscripts-different-images.png%22%20style%3D%22width%3A%20883px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F178518iCA98A91BAB6D5F69%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22runscripts-different-images.png%22%20alt%3D%22Running%20the%20sane%20script%20against%20different%20version%20of%20Azure%20PowerShell%20Container%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ERunning%20the%20sane%20script%20against%20different%20version%20of%20Azure%20PowerShell%20Container%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENote%3A%3C%2FSTRONG%3E%20For%20windows-based%20systems%2C%20you%20must%20share%20with%20the%20docker%20daemon%20the%20location%20on%20the%20host%20where%20the%20script%20is%20located.%20More%20information%20here%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.docker.com%2Fdocker-for-windows%2F%23file-sharing%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.docker.com%2Fdocker-for-windows%2F%23file-sharing%3C%2FA%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1103433117%22%20id%3D%22toc-hId-1103434077%22%20id%3D%22toc-hId-1103434077%22%3ESupported%20versions%3C%2FH2%3E%0A%3CP%3EThe%20latest%20container%20image%20contains%20the%20latest%20version%20of%20PowerShell%20and%20the%20latest%20Azure%20PowerShell%20modules%20supported%20with%20the%20Az%20module.%3C%2FP%3E%0A%3CP%3EFor%20each%20new%20release%20of%20the%20Az%20module%20we%20are%20releasing%20an%20image%20for%20the%20following%20operating%20systems%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EUbuntu%2018.04%20(default)%3C%2FLI%3E%0A%3CLI%3EDebian%209%3C%2FLI%3E%0A%3CLI%3ECentOs%207%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20id%3D%22toc-hId--704021346%22%20id%3D%22toc-hId--704020386%22%20id%3D%22toc-hId--704020386%22%3ERoadmap%3C%2FH2%3E%0A%3CP%3EWhile%20we%20are%20excited%20about%20this%20initial%20release%2C%20we%20want%20to%20share%20some%20plans%2C%20including%20but%20not%20limited%20to%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAdd%20modules%20in%20preview%3C%2FLI%3E%0A%3CLI%3EAdd%20support%20for%20Windows%20based%20containers%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EPlease%20share%20your%20feedback%20and%20let%20us%20know%20what%20you%E2%80%99d%20like%20to%20see%20added%20to%20the%20list!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20Azure%20PowerShell%20team%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1242407%22%20slang%3D%22en-US%22%3E%3CP%3ERunning%20simultaneously%20different%20scripts%20using%20different%20versions%20of%20Azure%20PowerShell%2C%20testing%20a%20script%20against%20a%20new%20version%20of%20Azure%20PowerShell%20modules%2C%20locking%20a%20script%20with%20a%20known%20version%20of%20Azure%20PowerShell%20is%20now%20possible%20with%20the%20first%20availability%20of%20the%20%3CSTRONG%3EAzure%20PowerShell%20Docker%20image%3C%2FSTRONG%3E.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1242407%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eazure%20powershell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1243393%22%20slang%3D%22en-US%22%3ERe%3A%20Azure%20PowerShell%20Docker%20image%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1243393%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20Sharing%20with%20the%20Community%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Fhtml%2Fimages%2Femoticons%2Fcool_40x40.gif%22%20alt%3D%22%3Acool%3A%22%20title%3D%22%3Acool%3A%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

With Azure constantly evolving and a new version of the Azure PowerShell modules every three weeks, it becomes quickly very challenging to maintain a production or development environment up to date and ensuring the smooth execution of scripts.

In order to facilitate this mission, we are excited to announce the first availability of the Azure PowerShell Docker image.

 

Azure PowerShell on docker hubAzure PowerShell on docker hub

Scenarios

The Azure PowerShell docker image provides a contained environment with PowerShell and the Az module pre-installed:

  • On the same machine you can run scripts that are using different version of Az with no conflicts.
  • You can test a script against a different version of Az with no risks.
  • You can run interactively the latest image with the following command:

You can run interactively the latest image with the following command:

 

docker run -it mcr.microsoft.com/azure-powershell

 

Running PowerShell interactively in docker containerRunning PowerShell interactively in docker container

 

It is possible to run a script targeting a specific version of Az:

docker run -it -v C:\Users\dcaro\src:/src mcr.microsoft.com/azure-powershell:3.6.1-ubuntu-18.04 pwsh -file /src/script.ps1

The following screenshot shows the same script being executed against two versions of Az.

 

Running the sane script against different version of Azure PowerShell ContainerRunning the sane script against different version of Azure PowerShell Container

 

Note: For windows-based systems, you must share with the docker daemon the location on the host where the script is located. More information here: https://docs.docker.com/docker-for-windows/#file-sharing

Supported versions

The latest container image contains the latest version of PowerShell and the latest Azure PowerShell modules supported with the Az module.

For each new release of the Az module we are releasing an image for the following operating systems:

  • Ubuntu 18.04 (default)
  • Debian 9
  • CentOs 7

Roadmap

While we are excited about this initial release, we want to share some plans, including but not limited to:

  • Add modules in preview
  • Add support for Windows based containers

Please share your feedback and let us know what you’d like to see added to the list!

 

The Azure PowerShell team

 

1 Comment

Thanks for Sharing with the Community :cool: