Add-AzureEnvironment
Creates an Azure environment.
Note
The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.
The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.
Syntax
Add-AzureEnvironment
-Name <String>
[-PublishSettingsFileUrl <String>]
[-ServiceEndpoint <String>]
[-ManagementPortalUrl <String>]
[-StorageEndpoint <String>]
[-ActiveDirectoryEndpoint <String>]
[-ResourceManagerEndpoint <String>]
[-GalleryEndpoint <String>]
[-ActiveDirectoryServiceEndpointResourceId <String>]
[-GraphEndpoint <String>]
[-AzureKeyVaultDnsSuffix <String>]
[-AzureKeyVaultServiceEndpointResourceId <String>]
[-TrafficManagerDnsSuffix <String>]
[-SqlDatabaseDnsSuffix <String>]
[-EnableAdfsAuthentication]
[-AdTenant <String>]
[-Profile <AzureSMProfile>]
[<CommonParameters>]
Description
The Add-AzureEnvironment cmdlet creates a new custom Azure account environment and saves it in your roaming user profile. The cmdlet returns an object that represents the new environment. When the command completes, you can use the environment in Windows PowerShell.
An Azure environment an independent deployment of Microsoft Azure, such as AzureCloud for global Azure and AzureChinaCloud for Azure operated by 21Vianet in China. You can also create on-premises Azure environments by using Azure Pack and the WAPack cmdlets. For more information, see Azure Pack.
Only the Name parameter of this cmdlet is mandatory. If you omit a parameter, its value is null ($Null), and the service that uses that endpoint might not function properly. To add or change the value of an environment property, use the Set-AzureEnvironment cmdlet.
NOTE: Changing your environment can cause your account to fail. Typically, environments are added only for testing or troubleshooting.
This topic describes the cmdlet in the 0.8.10 version of the Microsoft Azure PowerShell module.
To get the version of the module you're using, in the Azure PowerShell console, type (Get-Module -Name Azure).Version
.
Examples
Example 1: Add an Azure environment
PS C:\> Add-AzureEnvironment -Name ContosoEnv -PublishSettingsFileUrl https://contoso.com/fwlink/?LinkID=101 -ServiceEndpoint https://contoso.com/fwlink/?LinkID=102
Name : ContosoEnv
PublishSettingsFileUrl : https://contoso.com/fwlink/?LinkID=101
ServiceEndpoint : https://contoso.com/fwlink/?LinkID=102
ResourceManagerEndpoint :
ManagementPortalUrl :
ActiveDirectoryEndpoint :
ActiveDirectoryCommonTenantId :
StorageEndpointSuffix :
StorageBlobEndpointFormat :
StorageQueueEndpointFormat :
StorageTableEndpointFormat :
GalleryEndpoint :
This command creates the ContosoEnv Azure environment.
Parameters
-ActiveDirectoryEndpoint
Specifies the endpoint for Microsoft Entra authentication in the new environment.
Type: | String |
Aliases: | AdEndpointUrl, ActiveDirectory, ActiveDirectoryAuthority |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ActiveDirectoryServiceEndpointResourceId
Specifies the resource ID of a management API whose access is managed by Microsoft Entra ID.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-AdTenant
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-AzureKeyVaultDnsSuffix
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-AzureKeyVaultServiceEndpointResourceId
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-EnableAdfsAuthentication
Type: | SwitchParameter |
Aliases: | OnPremise |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-GalleryEndpoint
Specifies the endpoint for the Azure Resource Manager gallery, which stores resource group gallery templates. For more information about Azure resource groups and gallery templates, see the help topic for Get-AzureResourceGroupGalleryTemplatehttps://go.microsoft.com/fwlink/?LinkID=393052.
Type: | String |
Aliases: | Gallery, GalleryUrl |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-GraphEndpoint
Type: | String |
Aliases: | Graph, GraphUrl |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ManagementPortalUrl
Specifies the URL of the Azure Management Portal in the new environment.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specifies a name for the environment. This parameter is required. Do not use the names of the default environments, AzureCloud and AzureChinaCloud.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Profile
Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.
Type: | AzureSMProfile |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PublishSettingsFileUrl
Specifies the URL of the publish settings files for your account. An Azure publish settings file is an XML file that contains information about your account and a management certificate that allows Windows PowerShell to sign into your Azure account on your behalf.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceManagerEndpoint
Specifies the endpoint for Azure Resource Manager data, including data about resource groups associated with the account. For more information about Azure Resource Manager, see Azure Resource Manager Cmdlets (https://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (https://go.microsoft.com/fwlink/?LinkID=394767).
Type: | String |
Aliases: | ResourceManager, ResourceManagerUrl |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ServiceEndpoint
Specifies the URL of the Azure service endpoint. The Azure service endpoint determines whether your application is managed by the global Azure platform, Azure operated by 21Vianet in China, or a private Azure installation.
Type: | String |
Aliases: | ServiceManagement, ServiceManagementUrl |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-SqlDatabaseDnsSuffix
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-StorageEndpoint
Specifies the default endpoint of storage services in the new environment.
Type: | String |
Aliases: | StorageEndpointSuffix |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TrafficManagerDnsSuffix
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Inputs
None
You can pipe input to this cmdlet by property name, but not by value.
Outputs
Microsoft.WindowsAzure.Commands.Utilities.Common.WindowsAzureEnvironment