title | description | services | documentationcenter | author | manager | editor | ms.assetid | ms.service | ms.workload | pms.tgt_pltfrm | ms.devlang | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Configure the Azure Stack operator's PowerShell environment | Microsoft Docs |
Learn how to Configure the Azure Stack operator's PowerShell environment. |
azure-stack |
SnehaGunda |
byronr |
azure-stack |
na |
na |
na |
article |
10/23/2017 |
sngun |
Applies to: Azure Stack integrated systems and Azure Stack Development Kit
As an Azure Stack operator, you can configure your Azure Stack Development Kit's PowerShell environment. After you configure, you can use PowerShell to manage Azure Stack resources such as creating offers, plans, quotas, managing alerts, etc. This topic is scoped to use with the cloud operator environments only, if you want to set up PowerShell for the user environment, refer to Configure the Azure Stack user's PowerShell environment topic.
Run the following prerequisites either from the development kit, or from a Windows-based external client if you are connected through VPN:
- Install Azure Stack-compatible Azure PowerShell modules.
- Download the tools required to work with Azure Stack.
Based on the type of deployment (Azure AD or AD FS), run one of the following script to configure the Azure Stack operator environment with PowerShell (Make sure to replace the AAD tenantName, GraphAudience endpoint and ArmEndpoint values as per your environment configuration):
# Navigate to the downloaded folder and import the **Connect** PowerShell module
Set-ExecutionPolicy RemoteSigned
Import-Module .\Connect\AzureStack.Connect.psm1
# For Azure Stack development kit, this value is set to https://adminmanagement.local.azurestack.external. To get this value for Azure Stack integrated systems, contact your service provider.
$ArmEndpoint = "<Resource Manager endpoint for your environment>"
# For Azure Stack development kit, this value is adminvault.local.azurestack.external
$KeyvaultDnsSuffix = “<Keyvault DNS suffix for your environment>”
# Register an AzureRM environment that targets your Azure Stack instance
Add-AzureRMEnvironment `
-Name "AzureStackAdmin" `
-ArmEndpoint $ArmEndpoint
# Get the Active Directory tenantId that is used to deploy Azure Stack
$TenantID = Get-AzsDirectoryTenantId `
-AADTenantName "<myDirectoryTenantName>.onmicrosoft.com" `
-EnvironmentName "AzureStackAdmin"
# Sign in to your environment
Login-AzureRmAccount `
-EnvironmentName "AzureStackAdmin" `
-TenantId $TenantID
# Navigate to the downloaded folder and import the **Connect** PowerShell module
Set-ExecutionPolicy RemoteSigned
Import-Module .\Connect\AzureStack.Connect.psm1
# For Azure Stack development kit, this value is set to https://adminmanagement.local.azurestack.external. To get this value for Azure Stack integrated systems, contact your service provider.
$ArmEndpoint = "<Resource Manager endpoint for your environment>"
# For Azure Stack development kit, this value is adminvault.local.azurestack.external
$KeyvaultDnsSuffix = “<Keyvault DNS suffix for your environment>”
# Register an AzureRM environment that targets your Azure Stack instance
Add-AzureRMEnvironment `
-Name "AzureStackAdmin" `
-ArmEndpoint $ArmEndpoint
# Get the Active Directory tenantId that is used to deploy Azure Stack
$TenantID = Get-AzsDirectoryTenantId `
-ADFS `
-EnvironmentName "AzureStackAdmin"
# Sign in to your environment
Login-AzureRmAccount `
-EnvironmentName "AzureStackAdmin" `
-TenantId $TenantID
Now that we've got everything set up, let's use PowerShell to create resources within Azure Stack. For example, you can create a resource group for an application and add a virtual machine. Use the following command to create a resource group named "MyResourceGroup":
New-AzureRmResourceGroup -Name "MyResourceGroup" -Location "Local"