During Public Preview you can use the Team plan for free, and get an early-adopter discount at GA. Sign in
Using Locally with Azure PowerShell
Azure PowerShell is a set of PowerShell modules (Az) for managing Azure resources. Azure PowerShell supports Automatic Configuration - if you launch PowerShell via locally run, any cmdlets you run within that session will run against Locally.
This guide was tested using the following module versions, but newer versions should work too:
-
Az-v16.3.0 -
Microsoft.Entra-v1.3.0
Provisioning a Resource Group
In this example we're going to provision a Resource Group within the First Subscription. If you haven't already installed the Az modules, from within a PowerShell session run:
$
Install-Module -Name Az -Force
If Locally isn't already running, we'll need to start it by running:
$
locally build
We can then launch PowerShell via locally run:
$
locally run pwsh
Or on Windows:
$
locally run pwsh.exe
Any cmdlets run within this session will run against Locally - for example, to create a Resource Group:
$
New-AzResourceGroup -Name "hello-powershell" -Location "berlin"
Whilst this example creates a Resource Group, you can use any cmdlets where the Resource Provider and API Version are available in Locally. Note that PowerShell needs to be launched on its own via locally run - to run a script, launch PowerShell first and then run the script from within that session.
Microsoft Entra
The Microsoft.Entra modules work the same way - within a locally run session, Entra cmdlets run against the Directory (Entra) Emulator rather than a real tenant. If you haven't already installed them, from within a PowerShell session run:
$
Install-Module -Name Microsoft.Entra -Force
For example, to list the Users within your local tenant:
$
Get-EntraUser
Next steps
The Examples include more Azure PowerShell scripts, and Subscriptions, Tenants & Credentials covers the Subscriptions, users and service principals Locally sets up for you.
Should you encounter any issues, please take a look at the troubleshooting section, reach out in our Discord or open an issue and we'll take a look.
During Public Preview you can use the Team plan for free, and get an early-adopter discount at GA. Sign in