From 83206989c3fb9d178ea274a114eaa70b36db4647 Mon Sep 17 00:00:00 2001 From: markcowl Date: Fri, 5 Dec 2014 10:06:14 -0800 Subject: [PATCH 1/2] Deprecating SubscriptionDataFile --- .../Commands.Common/Common/SubscriptionCmdletBase.cs | 4 +++- .../Commands.Common/Properties/Resources.Designer.cs | 9 +++++++++ src/Common/Commands.Common/Properties/Resources.resx | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Common/Commands.Common/Common/SubscriptionCmdletBase.cs b/src/Common/Commands.Common/Common/SubscriptionCmdletBase.cs index 1f2dd6dd4635..f7860d025ae0 100644 --- a/src/Common/Commands.Common/Common/SubscriptionCmdletBase.cs +++ b/src/Common/Commands.Common/Common/SubscriptionCmdletBase.cs @@ -14,6 +14,7 @@ using System.Management.Automation; using Microsoft.WindowsAzure.Commands.Common; +using Microsoft.WindowsAzure.Commands.Common.Properties; using Microsoft.WindowsAzure.Commands.Utilities.Common; namespace Microsoft.WindowsAzure.Commands.Utilities.Profile @@ -25,7 +26,7 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Profile /// public abstract class SubscriptionCmdletBase : AzurePSCmdlet { - [Parameter(Mandatory = false, HelpMessage = "File storing subscription data, if not set uses default.")] + [Parameter(Mandatory = false, HelpMessage = "[Deprecated]: File storing subscription data, if not set uses default.")] public string SubscriptionDataFile { get; set; } private readonly bool _saveProfile; @@ -40,6 +41,7 @@ protected override void BeginProcessing() if (!string.IsNullOrEmpty(SubscriptionDataFile)) { ProfileClient = new ProfileClient(SubscriptionDataFile); + WriteWarning(Resources.SubscriptionDataFileDeprecated); } else { diff --git a/src/Common/Commands.Common/Properties/Resources.Designer.cs b/src/Common/Commands.Common/Properties/Resources.Designer.cs index 1414d46eb5da..1a8465743d8b 100644 --- a/src/Common/Commands.Common/Properties/Resources.Designer.cs +++ b/src/Common/Commands.Common/Properties/Resources.Designer.cs @@ -3927,6 +3927,15 @@ public static string SubscriptionAlreadyExists { } } + /// + /// Looks up a localized string similar to The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information.. + /// + public static string SubscriptionDataFileDeprecated { + get { + return ResourceManager.GetString("SubscriptionDataFileDeprecated", resourceCulture); + } + } + /// /// Looks up a localized string similar to DefaultSubscriptionData.xml. /// diff --git a/src/Common/Commands.Common/Properties/Resources.resx b/src/Common/Commands.Common/Properties/Resources.resx index d62beedd94f2..9295f82d4c57 100644 --- a/src/Common/Commands.Common/Properties/Resources.resx +++ b/src/Common/Commands.Common/Properties/Resources.resx @@ -1573,4 +1573,7 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf Removing the Azure profile + + The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. + \ No newline at end of file From 62237885a8d1857e28ef2fedf7bca1284e81ffb8 Mon Sep 17 00:00:00 2001 From: markcowl Date: Fri, 5 Dec 2014 10:42:28 -0800 Subject: [PATCH 2/2] Add online help for deprecation --- ...WindowsAzure.Commands.Profile.dll-Help.xml | 8129 +++++++++-------- 1 file changed, 4077 insertions(+), 4052 deletions(-) diff --git a/src/Common/Commands.Profile/Microsoft.WindowsAzure.Commands.Profile.dll-Help.xml b/src/Common/Commands.Profile/Microsoft.WindowsAzure.Commands.Profile.dll-Help.xml index 9d2df460ffce..dc892b86f0d7 100644 --- a/src/Common/Commands.Profile/Microsoft.WindowsAzure.Commands.Profile.dll-Help.xml +++ b/src/Common/Commands.Profile/Microsoft.WindowsAzure.Commands.Profile.dll-Help.xml @@ -1,4077 +1,4102 @@ - - - - - Add-AzureAccount - - Adds the Azure account to Windows PowerShell - - - - - Add - AzureAccount - - - - The Add-AzureAccount cmdlet makes your Azure account and its subscriptions available in Windows PowerShell. It's like logging into your Azure account in Windows PowerShell. To log out of the account, use the Remove-AzureAccount cmdlet. - Add-AzureAccount downloads information about your Azure account and saves it in a subscription data file in your roaming user profile. It also gets an access token that allows Windows PowerShell to access your Azure account on your behalf. When the command completes, you can manage your Azure account in Windows PowerShell. - There are two different ways to make your Azure account available to Windows PowerShell. You can use the Add-AzureAccount cmdlet, which uses Azure Active Directory (Azure AD) authentication access tokens, or Import-AzurePublishSettingsFile, which uses a management certificate. For guidance on which method to use, see "How to: Connect to your subscription" (http://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/#Connect). - When you run Add-AzureAccount, it displays an interactive window that prompts you to sign into your Azure account. This sign-in is valid until the access token expires. When it expires, cmdlets that require access to your account prompt you to run Add-AzureAccount again. - If you have a Microsoft Organizational account, you can use the -Credential parameter to add the subscriptions associated with your account to Windows PowerShell without an interactive dialog. - When specifying -ServicePrincipal switch a -Credential parameter is used to authenticate a Service Principal. - - - - Add-AzureAccount - - Environment - - Specifies an Azure environment for the user account. This parameter is optional. The default is the AzureCloud environment.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.To get the available Azure environments, use the Get-AzureEnvironment cmdlet. To add an environment, use the Add-AzureEnvironment cmdlet. - - String - - - Credential - - The username and password account credentials used to authenticate with Azure Active Directory. The credentials must be for a Microsoft Organizational account or Service Principal, not a Microsoft account. - - PSCredential - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - Add-AzureAccount - - Environment - - Specifies an Azure environment for the user account. This parameter is optional. The default is the AzureCloud environment.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.To get the available Azure environments, use the Get-AzureEnvironment cmdlet. To add an environment, use the Add-AzureEnvironment cmdlet. - - String - - - Credential - - The username and password account credentials used to authenticate with Azure Active Directory. The credentials must be for a Microsoft Organizational account or Service Principal, not a Microsoft account. - - PSCredential - - - ServicePrincipal - - Specifies that your are logging in as a service principal. You must give a Credentials parameter for this case, with the service principal ID as the user name and the service principal key as the password. - - SwitchParameter - - - Tenant - - Used when logging in as a service principal. Specifies the AAD tenant the service principal is defined in. This can be either the tenant's domain name or id. - - String - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - - - Environment - - Specifies an Azure environment for the user account. This parameter is optional. The default is the AzureCloud environment.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.To get the available Azure environments, use the Get-AzureEnvironment cmdlet. To add an environment, use the Add-AzureEnvironment cmdlet. - - String - - String - - - - - - Credential - - The username and password account credentials used to authenticate with Azure Active Directory. The credentials must be for a Microsoft Organizational account or Service Principal, not a Microsoft account. - - PSCredential - - PSCredential - - - - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - String - - - - - - ServicePrincipal - - Specifies that your are logging in as a service principal. You must give a Credentials parameter for this case, with the service principal ID as the user name and the service principal key as the password. - - SwitchParameter - - SwitchParameter - - - - - - Tenant - - Used when logging in as a service principal. Specifies the AAD tenant the service principal is defined in. This can be either the tenant's domain name or id. - - String - - String - - - - - - - - - None - - - - - - - - - - - - - None - - - - - - - - - - - - - - - Add-AzureAccount (and the Azure AD authentication method) takes precedence over Import-AzurePublishSettings (and the management certificate method). If you use Add-AzureAccount even once on your account, the Azure AD authentication method is used and the management certificate is ignored. To remove the Azure AD token and restore the management certificate method, use the Remove-AzureAccount cmdlet. For more information, type: Get-Help Remove-AzureAccount. - - - - - -------------------------- Example 1: Add an account -------------------------- - - PS C:\> - - PS C:\>Add-AzureAccount - - This command adds an Azure account to Windows PowerShell. When you run the command, a windows pops up to request the user name and password of the account. - - - - - - - - - - - - - - -------------------------- Example 2: Use an alternate subscription data file -------------------------- - - PS C:\> - - PS C:\>Add-AzureAccount -SubscriptionDataFile C:\Testing\SDF.xml - - This command uses the SubscriptionDataFile parameter to direct Add-AzureAccount to store the account data in the C:\Testing\SDF.xml file, instead of the default file. - - - - - - - - - - - - - - -------------------------- Example 3: Add a Microsoft Organizational account using Credential -------------------------- - - PS C:\> - - PS C:\>$credential = Get-Credential -PS C:\>Add-AzureAccount -Credential $credential - - This command uses the Credential parameter to provide AAD authentication information on the command line, rather than using the pop-up dialog for AAD authentication. - - - - - - - - - - - - - - -------------------------- Example 4: Add a Service Principal account using Credential and ServicePrincipal -------------------------- - - PS C:\> - - PS C:\>$credential = Get-Credential -PS C:\>Add-AzureAccount -Credential $credential -ServicePrincipal -Tenant "3EB32C56-E1E5-46A6-9410-F4A0572B3998" - - This command uses the Credential parameter to provide AAD authentication information of the Service Principal in the tenant 3EB32C56-E1E5-46A6-9410-F4A0572B3998. - - - - - - - - - - - - - - -------------------------- Example 5: Add an account in Azure China -------------------------- - - PS C:\> - - PS C:\>Add-AzureAccount -Environment AzureChinaCloud - - This command uses the Environment parameter to add an Azure China account to Windows PowerShell. When you run the command, a windows pops up to request the user name and password of the account. - - - - - - - - - - - - - - - - Online Version: - http://go.microsoft.com/fwlink/?LinkID=397618 - - - Add-AzureEnvironment - - - - Get-AzureEnvironment - - - - Import-AzurePublishSettingsFile - - - - Get-AzureAccount - - - - Remove-AzureAccount - - - - - - - - Add-AzureEnvironment - - Creates an Azure environment - - - - - Add - AzureEnvironment - - - - 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 (http://www.microsoft.com/en-us/server-cloud/products/windows-azure-pack/default.aspx). - 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. - - - - Add-AzureEnvironment - - Name - - Specifies a name for the environment. This parameter is required. Do not use the names of the default environments, AzureCloud and AzureChinaCloud. - - String - - - 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. - - String - - - 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. - - String - - - ManagementPortalUrl - - Specifies the URL of the Azure Management Portal in the new environment. - - String - - - StorageEndpoint - - Specifies the default endpoint of storage services in the new environment. - - String - - - ActiveDirectoryEndpoint - - Specifies the endpoint for Azure Active Directory authentication in the new environment. - - String - - - 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 (http://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (http://go.microsoft.com/fwlink/?LinkID=394767). - - String - - - 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-AzureResourceGroupGalleryTemplate. - - String - - - ActiveDirectoryServiceEndpointResourceId - - Specifies the resource ID of a management API whose access is managed by Azure Active Directory. - - String - - - GraphEndpoint - - Changes the endpoint for Azure Active Directory Graph API to the specified value. - - String - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - - - Name - - Specifies a name for the environment. This parameter is required. Do not use the names of the default environments, AzureCloud and AzureChinaCloud. - - String - - String - - - - - - 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. - - String - - String - - - - - - 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. - - String - - String - - - - - - ManagementPortalUrl - - Specifies the URL of the Azure Management Portal in the new environment. - - String - - String - - - - - - StorageEndpoint - - Specifies the default endpoint of storage services in the new environment. - - String - - String - - - - - - ActiveDirectoryEndpoint - - Specifies the endpoint for Azure Active Directory authentication in the new environment. - - String - - String - - - - - - 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 (http://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (http://go.microsoft.com/fwlink/?LinkID=394767). - - String - - String - - - - - - 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-AzureResourceGroupGalleryTemplate. - - String - - String - - - - - - ActiveDirectoryServiceEndpointResourceId - - Specifies the resource ID of a management API whose access is managed by Azure Active Directory. - - String - - String - - - - - - GraphEndpoint - - Changes the endpoint for Azure Active Directory Graph API to the specified value. - - String - - String - - - - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - String - - - - - - - - - None - - - - - - - - - - - - - Microsoft.WindowsAzure.Commands.Utilities.Common.WindowsAzureEnvironment - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Add an Azure environment -------------------------- - - PS C:\> - - PS C:\>Add-AzureEnvironment -Name ContosoEnv -PublishSettingsFileUrl https://contoso.com/fwlink/?LinkID=101 -ServiceEndpoint https://contoso.com/fwlink/?LinkID=102 -Name : ContosoEnv + + + + + + Add-AzureAccount + + Adds the Azure account to Windows PowerShell + + + + + Add + AzureAccount + + + + The Add-AzureAccount cmdlet makes your Azure account and its subscriptions available in Windows PowerShell. It's like logging into your Azure account in Windows PowerShell. To log out of the account, use the Remove-AzureAccount cmdlet. + Add-AzureAccount downloads information about your Azure account and saves it in a subscription data file in your roaming user profile. It also gets an access token that allows Windows PowerShell to access your Azure account on your behalf. When the command completes, you can manage your Azure account in Windows PowerShell. + There are two different ways to make your Azure account available to Windows PowerShell. You can use the Add-AzureAccount cmdlet, which uses Azure Active Directory (Azure AD) authentication access tokens, or Import-AzurePublishSettingsFile, which uses a management certificate. For guidance on which method to use, see "How to: Connect to your subscription" (http://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/#Connect). + When you run Add-AzureAccount, it displays an interactive window that prompts you to sign into your Azure account. This sign-in is valid until the access token expires. When it expires, cmdlets that require access to your account prompt you to run Add-AzureAccount again. + If you have a Microsoft Organizational account, you can use the -Credential parameter to add the subscriptions associated with your account to Windows PowerShell without an interactive dialog. + When specifying -ServicePrincipal switch a -Credential parameter is used to authenticate a Service Principal. + + + + Add-AzureAccount + + Environment + + Specifies an Azure environment for the user account. This parameter is optional. The default is the AzureCloud environment.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.To get the available Azure environments, use the Get-AzureEnvironment cmdlet. To add an environment, use the Add-AzureEnvironment cmdlet. + + String + + + Credential + + The username and password account credentials used to authenticate with Azure Active Directory. The credentials must be for a Microsoft Organizational account or Service Principal, not a Microsoft account. + + PSCredential + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + Add-AzureAccount + + Environment + + Specifies an Azure environment for the user account. This parameter is optional. The default is the AzureCloud environment.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.To get the available Azure environments, use the Get-AzureEnvironment cmdlet. To add an environment, use the Add-AzureEnvironment cmdlet. + + String + + + Credential + + The username and password account credentials used to authenticate with Azure Active Directory. The credentials must be for a Microsoft Organizational account or Service Principal, not a Microsoft account. + + PSCredential + + + ServicePrincipal + + Specifies that your are logging in as a service principal. You must give a Credentials parameter for this case, with the service principal ID as the user name and the service principal key as the password. + + SwitchParameter + + + Tenant + + Used when logging in as a service principal. Specifies the AAD tenant the service principal is defined in. This can be either the tenant's domain name or id. + + String + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + + + Environment + + Specifies an Azure environment for the user account. This parameter is optional. The default is the AzureCloud environment.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.To get the available Azure environments, use the Get-AzureEnvironment cmdlet. To add an environment, use the Add-AzureEnvironment cmdlet. + + String + + String + + + + + + Credential + + The username and password account credentials used to authenticate with Azure Active Directory. The credentials must be for a Microsoft Organizational account or Service Principal, not a Microsoft account. + + PSCredential + + PSCredential + + + + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + String + + + + + + ServicePrincipal + + Specifies that your are logging in as a service principal. You must give a Credentials parameter for this case, with the service principal ID as the user name and the service principal key as the password. + + SwitchParameter + + SwitchParameter + + + + + + Tenant + + Used when logging in as a service principal. Specifies the AAD tenant the service principal is defined in. This can be either the tenant's domain name or id. + + String + + String + + + + + + + + + None + + + + + + + + + + + + + None + + + + + + + + + + + + + + + Add-AzureAccount (and the Azure AD authentication method) takes precedence over Import-AzurePublishSettings (and the management certificate method). If you use Add-AzureAccount even once on your account, the Azure AD authentication method is used and the management certificate is ignored. To remove the Azure AD token and restore the management certificate method, use the Remove-AzureAccount cmdlet. For more information, type: Get-Help Remove-AzureAccount. + + + + + -------------------------- Example 1: Add an account -------------------------- + + PS C:\> + + PS C:\>Add-AzureAccount + + This command adds an Azure account to Windows PowerShell. When you run the command, a windows pops up to request the user name and password of the account. + + + + + + + + + + + + + + -------------------------- Example 2: Use an alternate subscription data file -------------------------- + + PS C:\> + + PS C:\>Add-AzureAccount -SubscriptionDataFile C:\Testing\SDF.xml + + This command uses the SubscriptionDataFile parameter to direct Add-AzureAccount to store the account data in the C:\Testing\SDF.xml file, instead of the default file. + + + + + + + + + + + + + + -------------------------- Example 3: Add a Microsoft Organizational account using Credential -------------------------- + + PS C:\> + + + PS C:\>$credential = Get-Credential + PS C:\>Add-AzureAccount -Credential $credential + + + This command uses the Credential parameter to provide AAD authentication information on the command line, rather than using the pop-up dialog for AAD authentication. + + + + + + + + + + + + + + -------------------------- Example 4: Add a Service Principal account using Credential and ServicePrincipal -------------------------- + + PS C:\> + + + PS C:\>$credential = Get-Credential + PS C:\>Add-AzureAccount -Credential $credential -ServicePrincipal -Tenant "3EB32C56-E1E5-46A6-9410-F4A0572B3998" + + + This command uses the Credential parameter to provide AAD authentication information of the Service Principal in the tenant 3EB32C56-E1E5-46A6-9410-F4A0572B3998. + + + + + + + + + + + + + + -------------------------- Example 5: Add an account in Azure China -------------------------- + + PS C:\> + + PS C:\>Add-AzureAccount -Environment AzureChinaCloud + + This command uses the Environment parameter to add an Azure China account to Windows PowerShell. When you run the command, a windows pops up to request the user name and password of the account. + + + + + + + + + + + + + + + + Online Version: + http://go.microsoft.com/fwlink/?LinkID=397618 + + + Add-AzureEnvironment + + + + Get-AzureEnvironment + + + + Import-AzurePublishSettingsFile + + + + Get-AzureAccount + + + + Remove-AzureAccount + + + + + + + + Add-AzureEnvironment + + Creates an Azure environment + + + + + Add + AzureEnvironment + + + + 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 (http://www.microsoft.com/en-us/server-cloud/products/windows-azure-pack/default.aspx). + 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. + + + + Add-AzureEnvironment + + Name + + Specifies a name for the environment. This parameter is required. Do not use the names of the default environments, AzureCloud and AzureChinaCloud. + + String + + + 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. + + String + + + 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. + + String + + + ManagementPortalUrl + + Specifies the URL of the Azure Management Portal in the new environment. + + String + + + StorageEndpoint + + Specifies the default endpoint of storage services in the new environment. + + String + + + ActiveDirectoryEndpoint + + Specifies the endpoint for Azure Active Directory authentication in the new environment. + + String + + + 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 (http://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (http://go.microsoft.com/fwlink/?LinkID=394767). + + String + + + 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-AzureResourceGroupGalleryTemplate. + + String + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the resource ID of a management API whose access is managed by Azure Active Directory. + + String + + + GraphEndpoint + + Changes the endpoint for Azure Active Directory Graph API to the specified value. + + String + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + + + Name + + Specifies a name for the environment. This parameter is required. Do not use the names of the default environments, AzureCloud and AzureChinaCloud. + + String + + String + + + + + + 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. + + String + + String + + + + + + 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. + + String + + String + + + + + + ManagementPortalUrl + + Specifies the URL of the Azure Management Portal in the new environment. + + String + + String + + + + + + StorageEndpoint + + Specifies the default endpoint of storage services in the new environment. + + String + + String + + + + + + ActiveDirectoryEndpoint + + Specifies the endpoint for Azure Active Directory authentication in the new environment. + + String + + String + + + + + + 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 (http://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (http://go.microsoft.com/fwlink/?LinkID=394767). + + String + + String + + + + + + 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-AzureResourceGroupGalleryTemplate. + + String + + String + + + + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the resource ID of a management API whose access is managed by Azure Active Directory. + + String + + String + + + + + + GraphEndpoint + + Changes the endpoint for Azure Active Directory Graph API to the specified value. + + String + + String + + + + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + String + + + + + + + + + None + + + + + + + + + + + + + Microsoft.WindowsAzure.Commands.Utilities.Common.WindowsAzureEnvironment + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1: Add an Azure environment -------------------------- + + PS C:\> + + + 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 + PublishSettingsFileUrl : https://contoso.com/fwlink/?LinkID=101 -ServiceEndpoint : https://contoso.com/fwlink/?LinkID=102 + ServiceEndpoint : https://contoso.com/fwlink/?LinkID=102 -ResourceManagerEndpoint : + ResourceManagerEndpoint : -ManagementPortalUrl : + ManagementPortalUrl : -ActiveDirectoryEndpoint : + ActiveDirectoryEndpoint : -ActiveDirectoryCommonTenantId : + ActiveDirectoryCommonTenantId : -StorageEndpointSuffix : + StorageEndpointSuffix : -StorageBlobEndpointFormat : + StorageBlobEndpointFormat : -StorageQueueEndpointFormat : + StorageQueueEndpointFormat : -StorageTableEndpointFormat : + StorageTableEndpointFormat : -GalleryEndpoint : - - This command creates the ContosoEnv Azure environment. - - - - - - - - - - - - - - -------------------------- Example 2: Add an Azure environment with Parameters -------------------------- - - PS C:\> - - PS C:\>Add-AzureEnvironment -Name ContosoEnv -PublishSettingsFileUrl "https://contoso.com/fwlink/?LinkID=101" -ServiceEndpoint "https://contoso.com/fwlink/?LinkID=102" -ResourceManagerEndpoint "https://contoso.com/fwlink/?LinkID=103" -GraphEndpoint "https://contoso.com/fwlink/?LinkID=104" - - This command creates the ContosoEnv Azure environment with PublishSettingsFileUrl, ServiceEndpoint, ResourceManagerEndpoint, and GraphEndpoint specified. All other endpoints are ignored. - - - - - - - - - - - - - - - - Online Version: - http://go.microsoft.com/fwlink/?LinkID=397619 - - - Get-AzureEnvironment - - - - Remove-AzureEnvironment - - - - Set-AzureEnvironment - - - - - - - - Clear-AzureProfile - - Clears an Azure profile - - - - - Clear - AzureProfile - - - - The Clear-AzureProfile cmdlet resets Azure profile to default values. All imported subscriptions and accounts are removed. - - - - Clear-AzureProfile - - Force - - Suppresses the confirmation prompt. By default, Clear-AzureProfile prompts you before clearing the profile. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - - - Force - - Suppresses the confirmation prompt. By default, Clear-AzureProfile prompts you before clearing the profile. - - SwitchParameter - - SwitchParameter - - - - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - String - - - - - - - - - - - - - - - - - - - - - None - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Clear profile -------------------------- - - PS C:\> - - PS C:\>Clear-AzureProfile - - This command clears default user Azure profile. - - - - - - - - - - - - - - -------------------------- Example 2: Clear non-default profile -------------------------- - - PS C:\> - - PS C:\>Clear-AzureProfile -SubscriptionDataFile c:\myprofile.json - - This command clears Azure profile stored in c:\myprofile.json file. - - - - - - - - - - - - - - - - Get-AzureSubscription - - - - Set-AzureSubscription - - - - Add-AzureAccount - - - - Remove-AzureAccount - - - - - - - - Get-AzureAccount - - Gets Azure accounts that are available to Azure PowerShell. - - - - - Get - AzureAccount - - - - This is the Description section - The Get-AzureAccount cmdlet gets the Azure accounts that are available to Windows PowerShell. To make your accounts available to Windows PowerShell, use the Add-AzureAccount or Import-PublishSettingsFile cmdlets. - - - - Get-AzureAccount - - Name - - Gets only the specified account. The default is all accounts that are available to Windows PowerShell. Enter the account name. The Name value is case-sensitive. Wildcards are not permitted. - - String - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - - - Name - - Gets only the specified account. The default is all accounts that are available to Windows PowerShell. Enter the account name. The Name value is case-sensitive. Wildcards are not permitted. - - String - - String - - - - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - String - - - - - - - - - None - - - - - - - - - - - - - None - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get all accounts -------------------------- - - PS C:\> - - PS C:\>Get-AzureAccount -Name ActiveDirectories ----- ----------------- -contosoadmin@outlook.com {{ ActiveDirectoryTenantId = abcde5cd-bcc3-441a-bd86-e6a... -contosotest1@outlook.com {{ ActiveDirectoryTenantId = aaeabcde-386c-4466-bf70-794... - - This command gets all accounts associated with the specified user. - - - - - - - - - - - - - - -------------------------- Example 2: Get an account by name -------------------------- - - PS C:\> - - PS C:\>Get-AzureAccount -Name contosoadmin@outlook.com -Name ActiveDirectories ----- ----------------- -contosoadmin@outlook.com {{ ActiveDirectoryTenantId = abcde5cd-bcc3-441a-bd86-e6a... - - This command gets the ContosoAdmin account. - - - - - - - - - - - - - - - - Online Version: - http://go.microsoft.com/fwlink/?LinkID=397620 - - - Add-AzureAccount - - - - Get-AzurePublishSettingsFile - - - - Import-AzurePublishSettingsFile - - - - Remove-AzureAccount - - - - - - - - Get-AzureEnvironment - - Gets Azure environments - - - - - Get - AzureEnvironment - - - - This is the Description section - The Get-AzureEnvironment cmdlet gets the Azure environments that are available to 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 (http://www.microsoft.com/en-us/server-cloud/products/windows-azure-pack/default.aspx).The Get-AzureEnvironment cmdlet gets environments from your subscription data file, not from Azure. If the subscription data file is outdated, run the Add-AzureAccount or Import-PublishSettingsFile cmdlet to refresh it. - - - - Get-AzureEnvironment - - Name - - Gets only the specified environment. Type the environment name. The parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - - - Name - - Gets only the specified environment. Type the environment name. The parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - String - - - - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - String - - - - - - - - - None - - - - - - - - - - - - - System.Management.Automation.PSCustomObject - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Get all environments -------------------------- - - PS C:\> - - PS C:\>Get-AzureEnvironment -EnvironmentName ServiceEndpoint ResourceManagerEndpoint PublishSettingsFileUrl ---------------- --------------- ----------------------- ---------------------- + GalleryEndpoint : + + + This command creates the ContosoEnv Azure environment. + + + + + + + + + + + + + + -------------------------- Example 2: Add an Azure environment with Parameters -------------------------- + + PS C:\> + + PS C:\>Add-AzureEnvironment -Name ContosoEnv -PublishSettingsFileUrl "https://contoso.com/fwlink/?LinkID=101" -ServiceEndpoint "https://contoso.com/fwlink/?LinkID=102" -ResourceManagerEndpoint "https://contoso.com/fwlink/?LinkID=103" -GraphEndpoint "https://contoso.com/fwlink/?LinkID=104" + + This command creates the ContosoEnv Azure environment with PublishSettingsFileUrl, ServiceEndpoint, ResourceManagerEndpoint, and GraphEndpoint specified. All other endpoints are ignored. + + + + + + + + + + + + + + + + Online Version: + http://go.microsoft.com/fwlink/?LinkID=397619 + + + Get-AzureEnvironment + + + + Remove-AzureEnvironment + + + + Set-AzureEnvironment + + + + + + + + Clear-AzureProfile + + Clears an Azure profile + + + + + Clear + AzureProfile + + + + The Clear-AzureProfile cmdlet resets Azure profile to default values. All imported subscriptions and accounts are removed. + + + + Clear-AzureProfile + + Force + + Suppresses the confirmation prompt. By default, Clear-AzureProfile prompts you before clearing the profile. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + + + Force + + Suppresses the confirmation prompt. By default, Clear-AzureProfile prompts you before clearing the profile. + + SwitchParameter + + SwitchParameter + + + + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + String + + + + + + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1: Clear profile -------------------------- + + PS C:\> + + PS C:\>Clear-AzureProfile + + This command clears default user Azure profile. + + + + + + + + + + + + + + -------------------------- Example 2: Clear nondefault profile -------------------------- + + PS C:\> + + PS C:\>Clear-AzureProfile -SubscriptionDataFile c:\myprofile.json + + This command clears Azure profile stored in c:\myprofile.json file. + + + + + + + + + + + + + + + + Get-AzureSubscription + + + + Set-AzureSubscription + + + + Add-AzureAccount + + + + Remove-AzureAccount + + + + + + + + Get-AzureAccount + + Gets Azure accounts that are available to Azure PowerShell. + + + + + Get + AzureAccount + + + + This is the Description section + The Get-AzureAccount cmdlet gets the Azure accounts that are available to Windows PowerShell. To make your accounts available to Windows PowerShell, use the Add-AzureAccount or Import-PublishSettingsFile cmdlets. + + + + Get-AzureAccount + + Name + + Gets only the specified account. The default is all accounts that are available to Windows PowerShell. Enter the account name. The Name value is case-sensitive. Wildcards are not permitted. + + String + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + + + Name + + Gets only the specified account. The default is all accounts that are available to Windows PowerShell. Enter the account name. The Name value is case-sensitive. Wildcards are not permitted. + + String + + String + + + + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + String + + + + + + + + + None + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1: Get all accounts -------------------------- + + PS C:\> + + + PS C:\>Get-AzureAccount + Name ActiveDirectories + ---- ----------------- + contosoadmin@outlook.com {{ ActiveDirectoryTenantId = abcde5cd-bcc3-441a-bd86-e6a... + contosotest1@outlook.com {{ ActiveDirectoryTenantId = aaeabcde-386c-4466-bf70-794... + + + This command gets all accounts associated with the specified user. + + + + + + + + + + + + + + -------------------------- Example 2: Get an account by name -------------------------- + + PS C:\> + + + PS C:\>Get-AzureAccount -Name contosoadmin@outlook.com + Name ActiveDirectories + ---- ----------------- + contosoadmin@outlook.com {{ ActiveDirectoryTenantId = abcde5cd-bcc3-441a-bd86-e6a... + + + This command gets the ContosoAdmin account. + + + + + + + + + + + + + + + + Online Version: + http://go.microsoft.com/fwlink/?LinkID=397620 + + + Add-AzureAccount + + + + Get-AzurePublishSettingsFile + + + + Import-AzurePublishSettingsFile + + + + Remove-AzureAccount + + + + + + + + Get-AzureEnvironment + + Gets Azure environments + + + + + Get + AzureEnvironment + + + + This is the Description section + The Get-AzureEnvironment cmdlet gets the Azure environments that are available to 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 (http://www.microsoft.com/en-us/server-cloud/products/windows-azure-pack/default.aspx).The Get-AzureEnvironment cmdlet gets environments from your subscription data file, not from Azure. If the subscription data file is outdated, run the Add-AzureAccount or Import-PublishSettingsFile cmdlet to refresh it. + + + + Get-AzureEnvironment + + Name + + Gets only the specified environment. Type the environment name. The parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + + + Name + + Gets only the specified environment. Type the environment name. The parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + String + + + + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + String + + + + + + + + + None + + + + + + + + + + + + + System.Management.Automation.PSCustomObject + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1: Get all environments -------------------------- + + PS C:\> + + + PS C:\>Get-AzureEnvironment + EnvironmentName ServiceEndpoint ResourceManagerEndpoint PublishSettingsFileUrl + --------------- --------------- ----------------------- ---------------------- -AzureCloud https://management.core.wi... https://management.azure.com/ http://go.microsoft.com/fw... -AzureChinaCloud https://management.core.ch... https://not-supported-serv... http://go.microsoft.com/fw... - - This command gets all environments that are available to Windows PowerShell. - - - - - - - - - - - - - - -------------------------- Example 2: Get an environment by name -------------------------- - - PS C:\> - - PS C:\>Get-AzureEnvironment -Name AzureCloud -Name : AzureCloud + AzureCloud https://management.core.wi... https://management.azure.com/ http://go.microsoft.com/fw... + AzureChinaCloud https://management.core.ch... https://not-supported-serv... http://go.microsoft.com/fw... + + + This command gets all environments that are available to Windows PowerShell. + + + + + + + + + + + + + + -------------------------- Example 2: Get an environment by name -------------------------- + + PS C:\> + + + PS C:\>Get-AzureEnvironment -Name AzureCloud + Name : AzureCloud -PublishSettingsFileUrl : http://go.microsoft.com/fwlink/?LinkID=301775 + PublishSettingsFileUrl : http://go.microsoft.com/fwlink/?LinkID=301775 -ServiceEndpoint : https://management.core.windows.net/ + ServiceEndpoint : https://management.core.windows.net/ -ResourceManagerEndpoint : https://management.azure.com/ + ResourceManagerEndpoint : https://management.azure.com/ -ManagementPortalUrl : http://go.microsoft.com/fwlink/?LinkId=254433 + ManagementPortalUrl : http://go.microsoft.com/fwlink/?LinkId=254433 -ActiveDirectoryEndpoint : https://login.windows.net/ + ActiveDirectoryEndpoint : https://login.windows.net/ -ActiveDirectoryCommonTenantId : common + ActiveDirectoryCommonTenantId : common -StorageEndpointSuffix : core.windows.net + StorageEndpointSuffix : core.windows.net -StorageBlobEndpointFormat : {0}://{1}.blob.core.windows.net/ + StorageBlobEndpointFormat : {0}://{1}.blob.core.windows.net/ -StorageQueueEndpointFormat : {0}://{1}.queue.core.windows.net/ + StorageQueueEndpointFormat : {0}://{1}.queue.core.windows.net/ -StorageTableEndpointFormat : {0}://{1}.table.core.windows.net/ + StorageTableEndpointFormat : {0}://{1}.table.core.windows.net/ -GalleryEndpoint : https://gallery.azure.com/ - - This example gets the AzureCloud environment. - - - - - - - - - - - - - - -------------------------- Example 3: Get all properties of all environments -------------------------- - - PS C:\> - - PS C:\>Get-AzureEnvironment | ForEach-Object {Get-AzureEnvironment -Name $_.EnvironmentName} - - This command gets all properties of all environments. - - - The command uses the Get-AzureEnvironment cmdlet to get all Azure environments for this account. Then, it uses the Foreach-Object cmdlet to run a Get-AzureEnvironment command with the Name parameter on each environment. The value of the Name parameter is the EnvironmentName property of each environment.Without parameters, Get-AzureEnvironment gets only selected properties of an environment. - - - - - - - - - - - - - Online Version: - http://go.microsoft.com/fwlink/?LinkID=397621 - - - Add-AzureAccount - - - - Add-AzureEnvironment - - - - Get-AzurePublishSettingsFile - - - - Import-AzurePublishSettingsFile - - - - Remove-AzureEnvironment - - - - Set-AzureEnvironment - - - - - - - - Get-AzurePublishSettingsFile - - Downloads the publish settings file for an Azure subscription. - - - - - Get - AzurePublishSettingsFile - - - - This is the Description section - The Get-AzurePublishSettingsFile cmdlet downloads a publish settings file for a subscription in your account. When the command completes, you can use the Import-PublishSettingsFile cmdlet to make the settings in the file available to Windows PowerShell.To make your Azure account available to Windows PowerShell, you can use a publish settings file or the Add-AzureAccount cmdlet. Publish settings files let you prepare the session in advance so you can run scripts and background jobs unattended. However, not all services support publish settings files. For example, the AzureResourceManager module does not support publish settings files.When you run Get-AzurePublishSettingsFile, it opens your default browser and prompts you to sign into your Azure account, select a subscription, and select a file system location for the publish settings file. Then, it downloads the publish settings file for your subscription into the file that you selected.A "publish settings file" is an XML file with a .publishsettings file name extension. The file contains an encoded certificate that provides management credentials for your Azure subscriptions.Security Note: Publish settings files contains credentials that are used to administer your Azure subscriptions and services. If malicious users access your publish settings file, they can edit, create, and delete your Azure services. As a security best practice, save the file to a location in your Downloads or Documents folder and then delete it after using Import-AzurePublishSettingsFile cmdlet to import the settings. - - - - Get-AzurePublishSettingsFile - - Environment - - Specifies an Azure environment.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 (http://www.microsoft.com/en-us/server-cloud/products/windows-azure-pack/default.aspx). - - String - - - Realm - - Specifies the organization in an organizational ID. For example, if you sign into Azure as admin@contoso.com, the value of the Realm parameter is contoso.com. Use this parameter when you use an organizational ID to sign into the Azure portal. This parameter is not required when you use a Microsoft account, such as an outlook.com or live.com account. - - String - - - PassThru - - Returns True ($true) if the command succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. The PassThru parameter is typically used in conditional statements in functions and scripts. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - - - Environment - - Specifies an Azure environment.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 (http://www.microsoft.com/en-us/server-cloud/products/windows-azure-pack/default.aspx). - - String - - String - - - - - - Realm - - Specifies the organization in an organizational ID. For example, if you sign into Azure as admin@contoso.com, the value of the Realm parameter is contoso.com. Use this parameter when you use an organizational ID to sign into the Azure portal. This parameter is not required when you use a Microsoft account, such as an outlook.com or live.com account. - - String - - String - - - - - - PassThru - - Returns True ($true) if the command succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. The PassThru parameter is typically used in conditional statements in functions and scripts. - - SwitchParameter - - SwitchParameter - - - - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - String - - - - - - - - - None - - - - - - - - - - - - - None or System.Boolean - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Download a publish settings file -------------------------- - - PS C:\> - - PS C:\>Get-AzurePublishSettingsFile - - This command opens your default browser, connects to your Microsoft Azure account, and then downloads the .publishsettings file for your account. - - - - - - - - - - - - - - -------------------------- Example 2: Specify a realm -------------------------- - - PS C:\> - - PS C:\>Get-AzurePublishSettingsFile -Realm contoso.com -Passthru - - This command downloads the publish settings file for an account in the contoso.com domain. Use a command with the Realm parameter when you sign into Azure with an organizational account, instead of a Microsoft account. - - - - - - - - - - - - - - - - Online Version: - http://go.microsoft.com/fwlink/?LinkID=397622 - - - Add-AzureAccount - - - - Import-AzurePublishSettingsFile - - - - - - - - Get-AzureSubscription - - Gets Azure subscriptions in Azure account. - - - - - Get - AzureSubscription - - - - This is the Description section - The Get-AzureSubscription cmdlet gets the subscriptions in your Azure account. You can use this cmdlet to get information about the subscription and to pipe the subscription to other cmdlets.Get-AzureSubscription requires access to your Azure accounts. Before you run Get-AzureSubscription, you must run the Add-AzureAccount cmdlet or the cmdlets that download and install a publish settings file (Get-AzurePublishSettingsFile, Import-AzurePublishSettingsFile. - - - - Get-AzureSubscription - - SubscriptionName - - Gets only the specified subscription. Enter the subscription name. The value is case-sensitive. Wildcard characters are not supported. By default, Get-AzureSubscription gets all subscriptions in your Azure accounts. - - String - - - ExtendedDetails - - Returns quota information for the subscription, in addition to the standard settings. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - Get-AzureSubscription - - SubscriptionId - - Gets only the specified subscription. Enter the subscription Id. By default, Get-AzureSubscription gets all subscriptions in your Azure accounts. - - String - - - ExtendedDetails - - Returns quota information for the subscription, in addition to the standard settings. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - Get-AzureSubscription - - Default - - Gets only the default subscription, that is, the subscription designated as "default." By default, Get-AzureSubscription gets all subscriptions in your Azure accounts. To designate a subscription as "default," use the Default parameter of the Select-AzureSubscription cmdlet. - - SwitchParameter - - - ExtendedDetails - - Returns quota information for the subscription, in addition to the standard settings. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - Get-AzureSubscription - - Current - - Gets only the current subscription, that is, the subscription designated as "current." By default, Get-AzureSubscription gets all subscriptions in your Azure accounts. To designate a subscription as "current," use the Current parameter of the Select-AzureSubscription cmdlet. - - SwitchParameter - - - ExtendedDetails - - Returns quota information for the subscription, in addition to the standard settings. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - - - SubscriptionName - - Gets only the specified subscription. Enter the subscription name. The value is case-sensitive. Wildcard characters are not supported. By default, Get-AzureSubscription gets all subscriptions in your Azure accounts. - - String - - String - - - - - - ExtendedDetails - - Returns quota information for the subscription, in addition to the standard settings. - - SwitchParameter - - SwitchParameter - - - - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - String - - - - - - SubscriptionId - - Gets only the specified subscription. Enter the subscription Id. By default, Get-AzureSubscription gets all subscriptions in your Azure accounts. - - String - - String - - - - - - Default - - Gets only the default subscription, that is, the subscription designated as "default." By default, Get-AzureSubscription gets all subscriptions in your Azure accounts. To designate a subscription as "default," use the Default parameter of the Select-AzureSubscription cmdlet. - - SwitchParameter - - SwitchParameter - - - - - - Current - - Gets only the current subscription, that is, the subscription designated as "current." By default, Get-AzureSubscription gets all subscriptions in your Azure accounts. To designate a subscription as "current," use the Current parameter of the Select-AzureSubscription cmdlet. - - SwitchParameter - - SwitchParameter - - - - - - - - - None - - - - - - - - - - - - - Microsoft.WindowsAzure.Commands.Utilities.Common.AzureSubscription - - - - - - - - - - - - - - - Get-AzureSubscription gets data from the subscription data file that the Add-AzureAccount and Import-PublishSettingsFile cmdlets create. - - - - - -------------------------- Example 1: Get all subscriptions -------------------------- - - PS C:\> - - PS C:\> C:\PS>Get-AzureSubscription - - This command gets all subscriptions in the account. - - - - - - - - - - - - - - -------------------------- Example 2: Get a subscription by name -------------------------- - - PS C:\> - - PS C:\> C:\PS>Get-AzureSubscription –SubscriptionName "MyProdSubscription" - - This command gets only the "MyProdSubsciption" subscription. - - - - - - - - - - - - - - -------------------------- Example 3: Get the default subscription -------------------------- - - PS C:\> - - PS C:\> C:\PS>(Get-AzureSubscription -Default).SubscriptionName - - This command gets only the name of the default subscription. The command first gets the subscription and then uses the dot method to get the SubscriptionName property of the subscription. - - - - - - - - - - - - - - -------------------------- Example 4: Get selected subscription properties -------------------------- - - PS C:\> - - PS C:\> C:\PS>Get-AzureSubscription -Current | Format-List -Property SubscriptionName, Certificate - - This command returns a list with the name and certificate of the current subscription. It uses a Get-AzureSubscription command to get the current subscription. Then it pipes the subscription to a Format-List command that displays the selected properties in a list. - - - - - - - - - - - - - - -------------------------- Example 5: Use an alternate subscription data file -------------------------- - - PS C:\> - - PS C:\> C:\PS>Get-AzureSubscription -SubscriptionDataFile "C:\Temp\MySubscriptions.xml" - - This command gets subscriptions from the C:\Temp\MySubscriptions.xml subscription data file. Use the SubscriptionDataFile parameter if you specified an alternate subscription data file when you ran the Add-AzureAccount or Import-PublishSettingsFile cmdlets. - - - - - - - - - - - - - - - - Online Version: - http://go.microsoft.com/fwlink/?LinkID=397623 - - - Add-AzureAccount - - - - Get-AzurePublishSettingsFile - - - - Import-AzurePublishSettingsFile - - - - Remove-AzureSubscription - - - - Set-AzureSubscription - - - - - - - - Import-AzurePublishSettingsFile - - Imports a publish settings file that lets you manage your Azure accounts in Windows PowerShell. - - - - - Import - AzurePublishSettingsFile - - - - This is the Description section - The Import-AzurePublishSettingsFile cmdlet imports a publish settings file (*.publishsettings) that contains information about your Azure accounts and saves a subscription data file on your computer. When the cmdlet completes, you can manage your Azure accounts in Windows PowerShell.Before running Import-AzurePublishSettingsFile, run Get-AzurePublishSettingsFile, which downloads and saves the publish settings file so you can import it.To make your Azure account available to Windows PowerShell, you can use a publish settings file or the Add-AzureAccount cmdlet. Publish settings files let you prepare the session in advance so you can run scripts and background jobs unattended. However, not all services support publish settings files. For example, the AzureResourceManager module does not support publish settings files.Security Note: Publish settings files contain a management certificate that is encoded, but not encrypted. If malicious users access your publish settings file, they might be able to edit, create, and delete your Azure services. As a security best practice, save the file to a location in your Downloads or Documents folder and then delete it after using Import-AzurePublishSettingsFile cmdlet to import the settings. - - - - Import-AzurePublishSettingsFile - - PublishSettingsFile - - Specifies the full path and filename of the publish settings file. This should match the file location that you entered when prompted by Get-AzurePublishSettingsFile. - - String - - - Environment - - Specifies the environment to use. This parameter is optional. If it is not provided, an environment will be chosen according to the endpoint in the publish settings file. - - String - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - - - PublishSettingsFile - - Specifies the full path and filename of the publish settings file. This should match the file location that you entered when prompted by Get-AzurePublishSettingsFile. - - String - - String - - - - - - Environment - - Specifies the environment to use. This parameter is optional. If it is not provided, an environment will be chosen according to the endpoint in the publish settings file. - - String - - String - - - - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - String - - - - - - - - - None - - - - - - - - - - - - - None - - - - - - - - - - - - - - - A "publish settings file" is an XML file with a .publishsettings file name extension. The file contains an encoded certificate that provides management credentials for your Azure subscriptions. After you import this file, delete it to avoid security risks. - - - - - -------------------------- Example 1 -------------------------- - - PS C:\> - - PS C:\>Import-AzurePublishSettingsFile –PublishSettingsFile C:\Temp\MyAccount.publishsettings - - This command imports the "C:\Temp\MyAccount.publishsettings" file. - - - - - - - - - - - - - - -------------------------- Example 2 -------------------------- - - PS C:\> - - PS C:\>Import-AzurePublishSettingsFile –PublishSettingsFile C:\Temp\MyAccount.publishsettings –SubscriptionDataFile C:\Subs\Subscriptions.xml - - This command imports the "C:\Temp\MyAccountName-date-credentials.publishsettings" file and then saves the subscription data file in C:\Subs\Subscriptions.xml. - - - When you use the SubscriptionDataFile parameter to save your subscription data file in an alternate location, be sure to use the SubscriptionDataFile parameter of cmdlets that use subscription data file, such as Select-AzureSubscription and Remove-AzureAccount. - - - - - - - - - - - -------------------------- Example 3 -------------------------- - - PS C:\> - - PS C:\>Import-AzurePublishSettingsFile –PublishSettingsFile C:\Temp\MyAccount.publishsettings -Environment AzureChinaCloud - - This command imports the "C:\Temp\MyAccount.publishsettings" file and sets the Azure environment of all imported subscriptions to be AzureChinaCloud. This will overwrite the endpoints defined in the publish settings file. - - - - - - - - - - - - - - - - Online Version: - http://go.microsoft.com/fwlink/?LinkID=397624 - - - How to Install and Configure Azure PowerShell - - - - Add-AzureAccount - - - - Get-AzurePublishSettingsFile - - - - - - - - Remove-AzureAccount - - Deletes an Azure account from Windows PowerShell. - - - - - Remove - AzureAccount - - - - The Remove-AzureAccount cmdlet deletes an Azure account and its subscriptions from the subscription data file in your roaming user profile. It does not delete the account from Microsoft Azure, or change the actual account in any way. - Using this cmdlet is a lot like logging out of your Azure account. And, if you want to log into the account again, use the Add-AzureAccount or Import-AzurePublishSettingsFile to add the account to Windows PowerShell again. - You can also use Remove-AzureAccount cmdlet to change the way the Azure PowerShell cmdlets sign into your Azure account. If your account has both a management certificate from Import-AzurePublishSettingsFile and an access token from Add-AzureAccount, the Azure PowerShell cmdlets use only the access token; they ignore the management certificate. To use the management certificate, run Remove-AzureAccount. When Remove-AzureAccount finds both a management certificate and an access token, it deletes only the access token, instead of deleting the account. The management certificate is still there, so account is still available to Windows PowerShell. - - - - Remove-AzureAccount - - Name - - Specifies the name of the account to remove. The parameter value is case-sensitive. Wildcard characters are not supported. - - String - - - Force - - Suppresses the confirmation prompt. By default, Remove-AzureAccount prompts you before removing the account from Windows PowerShell. - - SwitchParameter - - - PassThru - - Returns True ($true) if the operation succeeded and False ($false) if it failed. By default, the cmdlet does not return any output. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - SwitchParameter - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - SwitchParameter - - - - - - Name - - Specifies the name of the account to remove. The parameter value is case-sensitive. Wildcard characters are not supported. - - String - - String - - - - - - Force - - Suppresses the confirmation prompt. By default, Remove-AzureAccount prompts you before removing the account from Windows PowerShell. - - SwitchParameter - - SwitchParameter - - - - - - PassThru - - Returns True ($true) if the operation succeeded and False ($false) if it failed. By default, the cmdlet does not return any output. - - SwitchParameter - - SwitchParameter - - - - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - String - - - - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - SwitchParameter - - SwitchParameter - - - false - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - SwitchParameter - - SwitchParameter - - - false - - - - - - None - - - - - - - - - - - - - None or System.Boolean - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Remove an account -------------------------- - - PS C:\> - - PS C:\>Remove-AzureAccount -Name admin@contoso.com - - This command removes the admin@contoso.com from your subscription data file. When the command completes, the account is no longer available to Windows PowerShell. - - - - - - - - - - - - - - - - Online Version: - http://go.microsoft.com/fwlink/?LinkID=397625 - - - Add-AzureAccount - - - - Get-AzureAccount - - - - - - - - Remove-AzureEnvironment - - Deletes an Azure environment from Windows PowerShell - - - - - Remove - AzureEnvironment - - - - This is the Description section - The Remove-AzureEnvironment cmdlet deletes an Azure environment from your roaming profile so Windows PowerShell can't find it. This cmdlet does not delete the environment from Microsoft Azure, or change the actual environment in any way.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 (http://www.microsoft.com/en-us/server-cloud/products/windows-azure-pack/default.aspx). - - - - Remove-AzureEnvironment - - Name - - Specifies the name of the environment to remove. This parameter is required. This parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - - Force - - Suppresses the confirmation prompt. By default, Remove-AzureAccount prompts you before removing the account from Windows PowerShell. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - - - Name - - Specifies the name of the environment to remove. This parameter is required. This parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - String - - - - - - Force - - Suppresses the confirmation prompt. By default, Remove-AzureAccount prompts you before removing the account from Windows PowerShell. - - SwitchParameter - - SwitchParameter - - - - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - String - - - - - - PassThru - - Returns True ($true) if the command succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. - - string - - string - - - - - - - - - None - - - - - - - - - - - - - None or System.Boolean - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Delete an environment -------------------------- - - PS C:\> - - PS C:\>Remove-AzureEnvironment -Name ContosoEnv - - This command deletes the ContosoEnv environment from Windows PowerShell. - - - - - - - - - - - - - - -------------------------- Example 2: Delete multiple environments -------------------------- - - PS C:\> - - PS C:\>Get-AzureEnvironment | Where-Object EnvironmentName -like "Contoso*" | ForEach-Object {Remove-AzureEnvironment -Name $_.EnvironmentName } - - This command deletes environments whose names begin with "Contoso" from Windows PowerShell. - - - - - - - - - - - - - - - - Online Version: - http://go.microsoft.com/fwlink/?LinkID=397626 - - - Add-AzureEnvironment - - - - Get-AzureEnvironment - - - - Set-AzureEnvironment - - - - - - - - Remove-AzureSubscription - - Deletes an Azure subscription from Windows PowerShell. - - - - - Remove - AzureSubscription - - - - The Remove-AzureSubscription cmdlet deletes an Azure subscription from your subscription data file so Windows PowerShell can't find it. This cmdlet does not delete the subscription from Microsoft Azure, or change the actual subscription in any way. - - - - Remove-AzureSubscription - - SubscriptionName - - Specifies the subscription name. This parameter is required. The parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - - Force - - Suppresses the confirmation prompt. By default, Remove-AzureSubscription prompts you before deleting the subscription. - - SwitchParameter - - - PassThru - - Returns True ($true) if the command succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - SwitchParameter - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - SwitchParameter - - - - Remove-AzureSubscription - - SubscriptionId - - Specifies the subscription Id. This parameter is required. - - String - - - Force - - Suppresses the confirmation prompt. By default, Remove-AzureSubscription prompts you before deleting the subscription. - - SwitchParameter - - - PassThru - - Returns True ($true) if the command succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - SwitchParameter - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - SwitchParameter - - - - - - SubscriptionName - - Specifies the subscription name. This parameter is required. The parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - String - - - - - - Force - - Suppresses the confirmation prompt. By default, Remove-AzureSubscription prompts you before deleting the subscription. - - SwitchParameter - - SwitchParameter - - - - - - PassThru - - Returns True ($true) if the command succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. - - SwitchParameter - - SwitchParameter - - - - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - String - - - - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - SwitchParameter - - SwitchParameter - - - false - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - SwitchParameter - - SwitchParameter - - - false - - - SubscriptionId - - Specifies the subscription Id. This parameter is required. - - String - - String - - - - - - - - - None - - - - - - - - - - - - - None or System.Boolean - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Delete a subscription -------------------------- - - PS C:\> - - PS C:\> C:\PS> Remove-AzureSubscription -SubscriptionName Test + GalleryEndpoint : https://gallery.azure.com/ + + + This example gets the AzureCloud environment. + + + + + + + + + + + + + + -------------------------- Example 3: Get all properties of all environments -------------------------- + + PS C:\> + + PS C:\>Get-AzureEnvironment | ForEach-Object {Get-AzureEnvironment -Name $_.EnvironmentName} + + This command gets all properties of all environments. + + + The command uses the Get-AzureEnvironment cmdlet to get all Azure environments for this account. Then, it uses the Foreach-Object cmdlet to run a Get-AzureEnvironment command with the Name parameter on each environment. The value of the Name parameter is the EnvironmentName property of each environment.Without parameters, Get-AzureEnvironment gets only selected properties of an environment. + + + + + + + + + + + + + Online Version: + http://go.microsoft.com/fwlink/?LinkID=397621 + + + Add-AzureAccount + + + + Add-AzureEnvironment + + + + Get-AzurePublishSettingsFile + + + + Import-AzurePublishSettingsFile + + + + Remove-AzureEnvironment + + + + Set-AzureEnvironment + + + + + + + + Get-AzurePublishSettingsFile + + Downloads the publish settings file for an Azure subscription. + + + + + Get + AzurePublishSettingsFile + + + + This is the Description section + The Get-AzurePublishSettingsFile cmdlet downloads a publish settings file for a subscription in your account. When the command completes, you can use the Import-PublishSettingsFile cmdlet to make the settings in the file available to Windows PowerShell.To make your Azure account available to Windows PowerShell, you can use a publish settings file or the Add-AzureAccount cmdlet. Publish settings files let you prepare the session in advance so you can run scripts and background jobs unattended. However, not all services support publish settings files. For example, the AzureResourceManager module does not support publish settings files.When you run Get-AzurePublishSettingsFile, it opens your default browser and prompts you to sign into your Azure account, select a subscription, and select a file system location for the publish settings file. Then, it downloads the publish settings file for your subscription into the file that you selected.A "publish settings file" is an XML file with a .publishsettings file name extension. The file contains an encoded certificate that provides management credentials for your Azure subscriptions.Security Note: Publish settings files contains credentials that are used to administer your Azure subscriptions and services. If malicious users access your publish settings file, they can edit, create, and delete your Azure services. As a security best practice, save the file to a location in your Downloads or Documents folder and then delete it after using Import-AzurePublishSettingsFile cmdlet to import the settings. + + + + Get-AzurePublishSettingsFile + + Environment + + Specifies an Azure environment.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 (http://www.microsoft.com/en-us/server-cloud/products/windows-azure-pack/default.aspx). + + String + + + Realm + + Specifies the organization in an organizational ID. For example, if you sign into Azure as admin@contoso.com, the value of the Realm parameter is contoso.com. Use this parameter when you use an organizational ID to sign into the Azure portal. This parameter is not required when you use a Microsoft account, such as an outlook.com or live.com account. + + String + + + PassThru + + Returns True ($true) if the command succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. The PassThru parameter is typically used in conditional statements in functions and scripts. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + + + Environment + + Specifies an Azure environment.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 (http://www.microsoft.com/en-us/server-cloud/products/windows-azure-pack/default.aspx). + + String + + String + + + + + + Realm + + Specifies the organization in an organizational ID. For example, if you sign into Azure as admin@contoso.com, the value of the Realm parameter is contoso.com. Use this parameter when you use an organizational ID to sign into the Azure portal. This parameter is not required when you use a Microsoft account, such as an outlook.com or live.com account. + + String + + String + + + + + + PassThru + + Returns True ($true) if the command succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. The PassThru parameter is typically used in conditional statements in functions and scripts. + + SwitchParameter + + SwitchParameter + + + + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + String + + + + + + + + + None + + + + + + + + + + + + + None or System.Boolean + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1: Download a publish settings file -------------------------- + + PS C:\> + + PS C:\>Get-AzurePublishSettingsFile + + This command opens your default browser, connects to your Microsoft Azure account, and then downloads the .publishsettings file for your account. + + + + + + + + + + + + + + -------------------------- Example 2: Specify a realm -------------------------- + + PS C:\> + + PS C:\>Get-AzurePublishSettingsFile -Realm contoso.com -Passthru + + This command downloads the publish settings file for an account in the contoso.com domain. Use a command with the Realm parameter when you sign into Azure with an organizational account, instead of a Microsoft account. + + + + + + + + + + + + + + + + Online Version: + http://go.microsoft.com/fwlink/?LinkID=397622 + + + Add-AzureAccount + + + + Import-AzurePublishSettingsFile + + + + + + + + Get-AzureSubscription + + Gets Azure subscriptions in Azure account. + + + + + Get + AzureSubscription + + + + This is the Description section + The Get-AzureSubscription cmdlet gets the subscriptions in your Azure account. You can use this cmdlet to get information about the subscription and to pipe the subscription to other cmdlets.Get-AzureSubscription requires access to your Azure accounts. Before you run Get-AzureSubscription, you must run the Add-AzureAccount cmdlet or the cmdlets that download and install a publish settings file (Get-AzurePublishSettingsFile, Import-AzurePublishSettingsFile. + + + + Get-AzureSubscription + + SubscriptionName + + Gets only the specified subscription. Enter the subscription name. The value is case-sensitive. Wildcard characters are not supported. By default, Get-AzureSubscription gets all subscriptions in your Azure accounts. + + String + + + ExtendedDetails + + Returns quota information for the subscription, in addition to the standard settings. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + Get-AzureSubscription + + SubscriptionId + + Gets only the specified subscription. Enter the subscription Id. By default, Get-AzureSubscription gets all subscriptions in your Azure accounts. + + String + + + ExtendedDetails + + Returns quota information for the subscription, in addition to the standard settings. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + Get-AzureSubscription + + Default + + Gets only the default subscription, that is, the subscription designated as "default." By default, Get-AzureSubscription gets all subscriptions in your Azure accounts. To designate a subscription as "default," use the Default parameter of the Select-AzureSubscription cmdlet. + + SwitchParameter + + + ExtendedDetails + + Returns quota information for the subscription, in addition to the standard settings. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + Get-AzureSubscription + + Current + + Gets only the current subscription, that is, the subscription designated as "current." By default, Get-AzureSubscription gets all subscriptions in your Azure accounts. To designate a subscription as "current," use the Current parameter of the Select-AzureSubscription cmdlet. + + SwitchParameter + + + ExtendedDetails + + Returns quota information for the subscription, in addition to the standard settings. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + + + SubscriptionName + + Gets only the specified subscription. Enter the subscription name. The value is case-sensitive. Wildcard characters are not supported. By default, Get-AzureSubscription gets all subscriptions in your Azure accounts. + + String + + String + + + + + + ExtendedDetails + + Returns quota information for the subscription, in addition to the standard settings. + + SwitchParameter + + SwitchParameter + + + + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + String + + + + + + SubscriptionId + + Gets only the specified subscription. Enter the subscription Id. By default, Get-AzureSubscription gets all subscriptions in your Azure accounts. + + String + + String + + + + + + Default + + Gets only the default subscription, that is, the subscription designated as "default." By default, Get-AzureSubscription gets all subscriptions in your Azure accounts. To designate a subscription as "default," use the Default parameter of the Select-AzureSubscription cmdlet. + + SwitchParameter + + SwitchParameter + + + + + + Current + + Gets only the current subscription, that is, the subscription designated as "current." By default, Get-AzureSubscription gets all subscriptions in your Azure accounts. To designate a subscription as "current," use the Current parameter of the Select-AzureSubscription cmdlet. + + SwitchParameter + + SwitchParameter + + + + + + + + + None + + + + + + + + + + + + + Microsoft.WindowsAzure.Commands.Utilities.Common.AzureSubscription + + + + + + + + + + + + + + + Get-AzureSubscription gets data from the subscription data file that the Add-AzureAccount and Import-PublishSettingsFile cmdlets create. + + + + + -------------------------- Example 1: Get all subscriptions -------------------------- + + PS C:\> + + PS C:\> C:\PS>Get-AzureSubscription + + This command gets all subscriptions in the account. + + + + + + + + + + + + + + -------------------------- Example 2: Get a subscription by name -------------------------- + + PS C:\> + + PS C:\> C:\PS>Get-AzureSubscription –SubscriptionName "MyProdSubscription" + + This command gets only the "MyProdSubsciption" subscription. + + + + + + + + + + + + + + -------------------------- Example 3: Get the default subscription -------------------------- + + PS C:\> + + PS C:\> C:\PS>(Get-AzureSubscription -Default).SubscriptionName + + This command gets only the name of the default subscription. The command first gets the subscription and then uses the dot method to get the SubscriptionName property of the subscription. + + + + + + + + + + + + + + -------------------------- Example 4: Get selected subscription properties -------------------------- + + PS C:\> + + PS C:\> C:\PS>Get-AzureSubscription -Current | Format-List -Property SubscriptionName, Certificate + + This command returns a list with the name and certificate of the current subscription. It uses a Get-AzureSubscription command to get the current subscription. Then it pipes the subscription to a Format-List command that displays the selected properties in a list. + + + + + + + + + + + + + + -------------------------- Example 5: Use an alternate subscription data file -------------------------- + + PS C:\> + + PS C:\> C:\PS>Get-AzureSubscription -SubscriptionDataFile "C:\Temp\MySubscriptions.xml" + + This command gets subscriptions from the C:\Temp\MySubscriptions.xml subscription data file. Use the SubscriptionDataFile parameter if you specified an alternate subscription data file when you ran the Add-AzureAccount or Import-PublishSettingsFile cmdlets. + + + + + + + + + + + + + + + + Online Version: + http://go.microsoft.com/fwlink/?LinkID=397623 + + + Add-AzureAccount + + + + Get-AzurePublishSettingsFile + + + + Import-AzurePublishSettingsFile + + + + Remove-AzureSubscription + + + + Set-AzureSubscription + + + + + + + + Import-AzurePublishSettingsFile + + Imports a publish settings file that lets you manage your Azure accounts in Windows PowerShell. + + + + + Import + AzurePublishSettingsFile + + + + This is the Description section + The Import-AzurePublishSettingsFile cmdlet imports a publish settings file (*.publishsettings) that contains information about your Azure accounts and saves a subscription data file on your computer. When the cmdlet completes, you can manage your Azure accounts in Windows PowerShell.Before running Import-AzurePublishSettingsFile, run Get-AzurePublishSettingsFile, which downloads and saves the publish settings file so you can import it.To make your Azure account available to Windows PowerShell, you can use a publish settings file or the Add-AzureAccount cmdlet. Publish settings files let you prepare the session in advance so you can run scripts and background jobs unattended. However, not all services support publish settings files. For example, the AzureResourceManager module does not support publish settings files.Security Note: Publish settings files contain a management certificate that is encoded, but not encrypted. If malicious users access your publish settings file, they might be able to edit, create, and delete your Azure services. As a security best practice, save the file to a location in your Downloads or Documents folder and then delete it after using Import-AzurePublishSettingsFile cmdlet to import the settings. + + + + Import-AzurePublishSettingsFile + + PublishSettingsFile + + Specifies the full path and filename of the publish settings file. This should match the file location that you entered when prompted by Get-AzurePublishSettingsFile. + + String + + + Environment + + Specifies the environment to use. This parameter is optional. If it is not provided, an environment will be chosen according to the endpoint in the publish settings file. + + String + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + + + PublishSettingsFile + + Specifies the full path and filename of the publish settings file. This should match the file location that you entered when prompted by Get-AzurePublishSettingsFile. + + String + + String + + + + + + Environment + + Specifies the environment to use. This parameter is optional. If it is not provided, an environment will be chosen according to the endpoint in the publish settings file. + + String + + String + + + + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + String + + + + + + + + + None + + + + + + + + + + + + + None + + + + + + + + + + + + + + + A "publish settings file" is an XML file with a .publishsettings file name extension. The file contains an encoded certificate that provides management credentials for your Azure subscriptions. After you import this file, delete it to avoid security risks. + + + + + -------------------------- Example 1 -------------------------- + + PS C:\> + + PS C:\>Import-AzurePublishSettingsFile –PublishSettingsFile C:\Temp\MyAccount.publishsettings + + This command imports the "C:\Temp\MyAccount.publishsettings" file. + + + + + + + + + + + + + + -------------------------- Example 2 -------------------------- + + PS C:\> + + PS C:\>Import-AzurePublishSettingsFile –PublishSettingsFile C:\Temp\MyAccount.publishsettings –SubscriptionDataFile C:\Subs\Subscriptions.xml + + This command imports the "C:\Temp\MyAccountName-date-credentials.publishsettings" file and then saves the subscription data file in C:\Subs\Subscriptions.xml. + + + When you use the SubscriptionDataFile parameter to save your subscription data file in an alternate location, be sure to use the SubscriptionDataFile parameter of cmdlets that use subscription data file, such as Select-AzureSubscription and Remove-AzureAccount. + + + + + + + + + + + -------------------------- Example 3 -------------------------- + + PS C:\> + + PS C:\>Import-AzurePublishSettingsFile –PublishSettingsFile C:\Temp\MyAccount.publishsettings -Environment AzureChinaCloud + + This command imports the "C:\Temp\MyAccount.publishsettings" file and sets the Azure environment of all imported subscriptions to be AzureChinaCloud. This will overwrite the endpoints defined in the publish settings file. + + + + + + + + + + + + + + + + Online Version: + http://go.microsoft.com/fwlink/?LinkID=397624 + + + How to Install and Configure Azure PowerShell + + + + Add-AzureAccount + + + + Get-AzurePublishSettingsFile + + + + + + + + Remove-AzureAccount + + Deletes an Azure account from Windows PowerShell. + + + + + Remove + AzureAccount + + + + The Remove-AzureAccount cmdlet deletes an Azure account and its subscriptions from the subscription data file in your roaming user profile. It does not delete the account from Microsoft Azure, or change the actual account in any way. + Using this cmdlet is a lot like logging out of your Azure account. And, if you want to log into the account again, use the Add-AzureAccount or Import-AzurePublishSettingsFile to add the account to Windows PowerShell again. + You can also use Remove-AzureAccount cmdlet to change the way the Azure PowerShell cmdlets sign into your Azure account. If your account has both a management certificate from Import-AzurePublishSettingsFile and an access token from Add-AzureAccount, the Azure PowerShell cmdlets use only the access token; they ignore the management certificate. To use the management certificate, run Remove-AzureAccount. When Remove-AzureAccount finds both a management certificate and an access token, it deletes only the access token, instead of deleting the account. The management certificate is still there, so account is still available to Windows PowerShell. + + + + Remove-AzureAccount + + Name + + Specifies the name of the account to remove. The parameter value is case-sensitive. Wildcard characters are not supported. + + String + + + Force + + Suppresses the confirmation prompt. By default, Remove-AzureAccount prompts you before removing the account from Windows PowerShell. + + SwitchParameter + + + PassThru + + Returns True ($true) if the operation succeeded and False ($false) if it failed. By default, the cmdlet does not return any output. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + SwitchParameter + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + SwitchParameter + + + + + + Name + + Specifies the name of the account to remove. The parameter value is case-sensitive. Wildcard characters are not supported. + + String + + String + + + + + + Force + + Suppresses the confirmation prompt. By default, Remove-AzureAccount prompts you before removing the account from Windows PowerShell. + + SwitchParameter + + SwitchParameter + + + + + + PassThru + + Returns True ($true) if the operation succeeded and False ($false) if it failed. By default, the cmdlet does not return any output. + + SwitchParameter + + SwitchParameter + + + + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + String + + + + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + SwitchParameter + + SwitchParameter + + + false + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + SwitchParameter + + SwitchParameter + + + false + + + + + + None + + + + + + + + + + + + + None or System.Boolean + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1: Remove an account -------------------------- + + PS C:\> + + PS C:\>Remove-AzureAccount -Name admin@contoso.com + + This command removes the admin@contoso.com from your subscription data file. When the command completes, the account is no longer available to Windows PowerShell. + + + + + + + + + + + + + + + + Online Version: + http://go.microsoft.com/fwlink/?LinkID=397625 + + + Add-AzureAccount + + + + Get-AzureAccount + + + + + + + + Remove-AzureEnvironment + + Deletes an Azure environment from Windows PowerShell + + + + + Remove + AzureEnvironment + + + + This is the Description section + The Remove-AzureEnvironment cmdlet deletes an Azure environment from your roaming profile so Windows PowerShell can't find it. This cmdlet does not delete the environment from Microsoft Azure, or change the actual environment in any way.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 (http://www.microsoft.com/en-us/server-cloud/products/windows-azure-pack/default.aspx). + + + + Remove-AzureEnvironment + + Name + + Specifies the name of the environment to remove. This parameter is required. This parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + + Force + + Suppresses the confirmation prompt. By default, Remove-AzureAccount prompts you before removing the account from Windows PowerShell. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + + + Name + + Specifies the name of the environment to remove. This parameter is required. This parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + String + + + + + + Force + + Suppresses the confirmation prompt. By default, Remove-AzureAccount prompts you before removing the account from Windows PowerShell. + + SwitchParameter + + SwitchParameter + + + + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + String + + + + + + PassThru + + Returns True ($true) if the command succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. + + string + + string + + + + + + + + + None + + + + + + + + + + + + + None or System.Boolean + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1: Delete an environment -------------------------- + + PS C:\> + + PS C:\>Remove-AzureEnvironment -Name ContosoEnv + + This command deletes the ContosoEnv environment from Windows PowerShell. + + + + + + + + + + + + + + -------------------------- Example 2: Delete multiple environments -------------------------- + + PS C:\> + + PS C:\>Get-AzureEnvironment | Where-Object EnvironmentName -like "Contoso*" | ForEach-Object {Remove-AzureEnvironment -Name $_.EnvironmentName } + + This command deletes environments whose names begin with "Contoso" from Windows PowerShell. + + + + + + + + + + + + + + + + Online Version: + http://go.microsoft.com/fwlink/?LinkID=397626 + + + Add-AzureEnvironment + + + + Get-AzureEnvironment + + + + Set-AzureEnvironment + + + + + + + + Remove-AzureSubscription + + Deletes an Azure subscription from Windows PowerShell. + + + + + Remove + AzureSubscription + + + + The Remove-AzureSubscription cmdlet deletes an Azure subscription from your subscription data file so Windows PowerShell can't find it. This cmdlet does not delete the subscription from Microsoft Azure, or change the actual subscription in any way. + + + + Remove-AzureSubscription + + SubscriptionName + + Specifies the subscription name. This parameter is required. The parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + + Force + + Suppresses the confirmation prompt. By default, Remove-AzureSubscription prompts you before deleting the subscription. + + SwitchParameter + + + PassThru + + Returns True ($true) if the command succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + SwitchParameter + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + SwitchParameter + + + + Remove-AzureSubscription + + SubscriptionId + + Specifies the subscription Id. This parameter is required. + + String + + + Force + + Suppresses the confirmation prompt. By default, Remove-AzureSubscription prompts you before deleting the subscription. + + SwitchParameter + + + PassThru + + Returns True ($true) if the command succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + SwitchParameter + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + SwitchParameter + + + + + + SubscriptionName + + Specifies the subscription name. This parameter is required. The parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + String + + + + + + Force + + Suppresses the confirmation prompt. By default, Remove-AzureSubscription prompts you before deleting the subscription. + + SwitchParameter + + SwitchParameter + + + + + + PassThru + + Returns True ($true) if the command succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. + + SwitchParameter + + SwitchParameter + + + + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + String + + + + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + SwitchParameter + + SwitchParameter + + + false + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + SwitchParameter + + SwitchParameter + + + false + + + SubscriptionId + + Specifies the subscription Id. This parameter is required. + + String + + String + + + + + + + + + None + + + + + + + + + + + + + None or System.Boolean + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1: Delete a subscription -------------------------- + + PS C:\> + + + PS C:\> C:\PS> Remove-AzureSubscription -SubscriptionName Test -Confirm -Are you sure you want to perform this action? -[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): - - This command deletes the "Test" subscription from the default subscription data file. - - - - - - - - - - - - - - -------------------------- Example 2: Delete from an alternate subscription data file -------------------------- - - PS C:\> - - PS C:\> C:\PS> Remove-AzureSubscription -SubscriptionName Test -SubscriptionDataFile C:\Subs\MySubscriptions.xml -Force - - This command deletes the Test subscription from the MySubscriptions.xml subscription data file. The command uses the Force parameter to suppress the confirmation prompt. - - - - - - - - - - - - - - -------------------------- Example 3: Delete a subscription in a script -------------------------- - - PS C:\> - - PS C:\> C:\PS> ...if (Remove-AzureSubscription -SubscriptionName Test -PassThru) {...} - - This command uses the Remove-AzureSubscription command in an If statement. It uses the PassThru parameter, which returns a Boolean value, to determine whether the script block in the If statement is executed. - - - - - - - - - - - - - - - - Online Version: - http://go.microsoft.com/fwlink/?LinkID=397627 - - - Get-AzureSubscription - - - - Select-AzureSubscription - - - - Set-AzureSubscription - - - - - - - - Select-AzureSubscription - - Changes the current and default Azure subscriptions - - - - - Select - AzureSubscription - - - - The Select-AzureSubscription cmdlet sets and clears the current and default Azure subscriptions. - The "current subscription" is the subscription that is used by default in the current Windows PowerShell session. The "default subscription" is used by default in all Windows PowerShell sessions. The "current subscription" label lets you specify a different subscription to be used by default for the current session without changing the "default subscription" for all other sessions. - The "default" subscription designation is saved in your subscription data file. The session-specific "current" designation is not saved. - - - - Select-AzureSubscription - - SubscriptionName - - Specifies the subscription to change. Enter the subscription name. This parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - - Account - - Specifies optionally the account to use with the subscription. This parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - - Current - - Sets the "current" subscription. Use the SubscriptionName parameter to identify the subscription.The "current subscription" is the subscription that is used by default in the current Windows PowerShell session. - - SwitchParameter - - - PassThru - - Returns True ($true) when the operation succeeds and False ($false) when it fails. By default, this cmdlet does not return any output. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - Select-AzureSubscription - - SubscriptionName - - Specifies the subscription to change. Enter the subscription name. This parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - - Account - - Specifies optionally the account to use with the subscription. This parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - - Default - - Sets the "default" subscription. Use the SubscriptionName parameter to identify the subscription.The "default subscription" is the subscription that is used by default in the all Windows PowerShell sessions, unless a different subscription is set to "current". - - SwitchParameter - - - PassThru - - Returns True ($true) when the operation succeeds and False ($false) when it fails. By default, this cmdlet does not return any output. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - Select-AzureSubscription - - SubscriptionId - - Specifies the subscription Id to change. Enter the subscription Id. - - String - - - Account - - Specifies optionally the account to use with the subscription. This parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - - Current - - Sets the "current" subscription. Use the SubscriptionName parameter to identify the subscription.The "current subscription" is the subscription that is used by default in the current Windows PowerShell session. - - SwitchParameter - - - PassThru - - Returns True ($true) when the operation succeeds and False ($false) when it fails. By default, this cmdlet does not return any output. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - Select-AzureSubscription - - SubscriptionId - - Specifies the subscription Id to change. Enter the subscription Id. - - String - - - Account - - Specifies optionally the account to use with the subscription. This parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - - Default - - Sets the "default" subscription. Use the SubscriptionName parameter to identify the subscription.The "default subscription" is the subscription that is used by default in the all Windows PowerShell sessions, unless a different subscription is set to "current". - - SwitchParameter - - - PassThru - - Returns True ($true) when the operation succeeds and False ($false) when it fails. By default, this cmdlet does not return any output. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - Select-AzureSubscription - - Account - - Specifies optionally the account to use with the subscription. This parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - - NoCurrent - - Clears the "current" subscription setting. When no subscription is set to "current," the Azure PowerShell cmdlets use the default subscription. - - SwitchParameter - - - PassThru - - Returns True ($true) when the operation succeeds and False ($false) when it fails. By default, this cmdlet does not return any output. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - Select-AzureSubscription - - Account - - Specifies optionally the account to use with the subscription. This parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - - NoDefault - - Clears the "default" subscription setting. If there is no default subscription, the current subscription is used by default. When there is no current or default subscription, and you do not identify a subscription, commands that require a subscription fail. - - SwitchParameter - - - PassThru - - Returns True ($true) when the operation succeeds and False ($false) when it fails. By default, this cmdlet does not return any output. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - - - SubscriptionName - - Specifies the subscription to change. Enter the subscription name. This parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - String - - - - - - Account - - Specifies optionally the account to use with the subscription. This parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - String - - - - - - Current - - Sets the "current" subscription. Use the SubscriptionName parameter to identify the subscription.The "current subscription" is the subscription that is used by default in the current Windows PowerShell session. - - SwitchParameter - - SwitchParameter - - - - - - PassThru - - Returns True ($true) when the operation succeeds and False ($false) when it fails. By default, this cmdlet does not return any output. - - SwitchParameter - - SwitchParameter - - - - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - String - - - - - - Default - - Sets the "default" subscription. Use the SubscriptionName parameter to identify the subscription.The "default subscription" is the subscription that is used by default in the all Windows PowerShell sessions, unless a different subscription is set to "current". - - SwitchParameter - - SwitchParameter - - - - - - SubscriptionId - - Specifies the subscription Id to change. Enter the subscription Id. - - String - - String - - - - - - NoCurrent - - Clears the "current" subscription setting. When no subscription is set to "current," the Azure PowerShell cmdlets use the default subscription. - - SwitchParameter - - SwitchParameter - - - - - - NoDefault - - Clears the "default" subscription setting. If there is no default subscription, the current subscription is used by default. When there is no current or default subscription, and you do not identify a subscription, commands that require a subscription fail. - - SwitchParameter - - SwitchParameter - - - - - - - - - None - - - - - - - - - - - - - None or AzureSubscription if PassThru - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Set the current subscription -------------------------- - - PS C:\> - - PS C:\> C:\PS> Select-AzureSubscription -Current -SubscriptionName ContosoEngineering - - This command makes "ContosoEngineering" the current subscription. - - - - - - - - - - - - - - -------------------------- Example 2: Set the current subscription with account -------------------------- - - PS C:\> - - PS C:\> C:\PS> Select-AzureSubscription -Current -SubscriptionName ContosoEngineering -Account user@mail.contoso.com - - This command makes "ContosoEngineering" the current subscription and user@mail.contoso.com the current user. - - - - - - - - - - - - - - -------------------------- Example 3: Set the default description -------------------------- - - PS C:\> - - PS C:\> C:\PS> Select-AzureSubscription -Default -SubscriptionName ContosoFinance -SubscriptionDataFile "C:\subs\MySubscriptions.xml" - - This command changes the default subscription to "ContosoFinance." It saves the setting in the Subscriptions.xml subscription data file, instead of the default subscription data file. - - - - - - - - - - - - - - - - Online Version: - http://go.microsoft.com/fwlink/?LinkID=397628 - - - Get-AzureSubscription - - - - Remove-AzureSubscription - - - - Set-AzureSubscription - - - - - - - - Set-AzureEnvironment - - Changes the properties of an Azure environment - - - - - Set - AzureEnvironment - - - - This is the Description section - The Set-AzureEnvironment cmdlet changes the properties of an Azure environment. It returns an object that represents the environment with its new property values. Use the Name parameter to identify the environment and the other parameters to change property values. You cannot use Set-AzureEnvironment to change the name of an Azure environment.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 (http://www.microsoft.com/en-us/server-cloud/products/windows-azure-pack/default.aspx).NOTE: Do not change the properties of the AzureCloud or AzureChinaCloud environments. Use this cmdlet to change the values of private environments that you create. - - - - Set-AzureEnvironment - - Name - - Identifies the environment that is being changed. This parameter is required. The parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - - PublishSettingsFileUrl - - Changes the URL for publish settings files in the specified environment. 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. - - String - - - ServiceEndpoint - - Changes the URL of the Azure service endpoint in the specified environment. 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. - - String - - - ManagementPortalUrl - - Changes the URL of the Azure Management Portal to the specified value. - - String - - - StorageEndpoint - - Changes the default endpoint of storage services in the specified environment. - - String - - - ActiveDirectoryEndpoint - - Changes the endpoint for Azure Active Directory authentication to the specified value. - - String - - - ResourceManagerEndpoint - - Changes 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 (http://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (http://go.microsoft.com/fwlink/?LinkID=394767). - - String - - - GalleryEndpoint - - Changes the endpoint for the Azure Resource Manager gallery to the specified value. The gallery endpoint is the location for resource group gallery templates. For more information about Azure resource groups and gallery templates, see the help topic for Get-AzureResourceGroupGalleryTemplate. - - String - - - ActiveDirectoryServiceEndpointResourceId - - Specifies the resource ID of a management API whose access is managed by Azure Active Directory. - - String - - - GraphEndpoint - - Changes the endpoint for Azure Active Directory Graph API to the specified value. - - String - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - - - Name - - Identifies the environment that is being changed. This parameter is required. The parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - String - - - - - - PublishSettingsFileUrl - - Changes the URL for publish settings files in the specified environment. 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. - - String - - String - - - - - - ServiceEndpoint - - Changes the URL of the Azure service endpoint in the specified environment. 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. - - String - - String - - - - - - ManagementPortalUrl - - Changes the URL of the Azure Management Portal to the specified value. - - String - - String - - - - - - StorageEndpoint - - Changes the default endpoint of storage services in the specified environment. - - String - - String - - - - - - ActiveDirectoryEndpoint - - Changes the endpoint for Azure Active Directory authentication to the specified value. - - String - - String - - - - - - ResourceManagerEndpoint - - Changes 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 (http://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (http://go.microsoft.com/fwlink/?LinkID=394767). - - String - - String - - - - - - GalleryEndpoint - - Changes the endpoint for the Azure Resource Manager gallery to the specified value. The gallery endpoint is the location for resource group gallery templates. For more information about Azure resource groups and gallery templates, see the help topic for Get-AzureResourceGroupGalleryTemplate. - - String - - String - - - - - - ActiveDirectoryServiceEndpointResourceId - - Specifies the resource ID of a management API whose access is managed by Azure Active Directory. - - String - - String - - - - - - GraphEndpoint - - Changes the endpoint for Azure Active Directory Graph API to the specified value. - - String - - String - - - - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - String - - - - - - - - - None - - - - - - - - - - - - - Microsoft.WindowsAzure.Commands.Utilities.Common.WindowsAzureEnvironment - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Change environment properties -------------------------- - - PS C:\> - - PS C:\>Set-AzureEnvironment -Name ContosoEnv -PublishSettingsFileUrl "https://contoso.com" -StorageEndpoint "contoso.com" -GraphEndpoint "https://contoso.com/fwlink/?LinkID=104" - - This command changes the values of the PublishSettingsFileUrl, StorageEndpoint, and GraphEndpoint properties of the ContosoEnv environment. - - - - - - - - - - - - - - - - Online Version: - http://go.microsoft.com/fwlink/?LinkID=397629 - - - Add-AzureEnvironment - - - - Get-AzureEnvironment - - - - Remove-AzureEnvironment - - - - - - - - Set-AzureSubscription - - Creates or changes an Azure subscription - - - - - Set - AzureSubscription - - - - The Set-AzureSubscription cmdlet establishes and changes the properties of an Azure subscription. You can use this cmdlet to create a new subscription or change the properties of an existing subscription. - To create a new subscription, select a unique name for the value of the SubscriptionName parameter. To change an existing subscription, use the SubscriptionName parameter to identify the subscription. - This cmdlet changes the data in the subscription data file that you create when you use the Add-AzureAccount or Import-AzurePublishSettingsFile cmdlet to add an Azure account to Windows PowerShell. - - - - Set-AzureSubscription - - SubscriptionName - - Specifies the subscription name. If an Azure subscription with this name does not exist, this parameter creates a new subscription with the specified name. If the subscription exists, this parameter identifies the subscription and uses the other property values to change it.To get the names of existing Azure subscriptions, use the Get-AzureSubscription cmdlet. - - String - - - SubscriptionId - - Specifies the ID of the subscription. To get the subscription ID of an existing Azure subscription, use the Get-AzureSubscription cmdlet. - - String - - - Certificate - - Specifies a management certificate for the subscription. Management certificates are X.509 certificates that are saved as .cer files and uploaded to the Azure Management Portal. The certificate, including its private key, must be installed on the local computer, either in the current user's personal certificate store, or the local machine’s personal certificate store. - - X509Certificate2 - - - ServiceEndpoint - - Sets or changes the custom service endpoint for the management service to the specified value.The service endpoint is the Azure management API endpoint in the Azure environment. You can create custom service endpoints and set a different service endpoint for each subscription. - - String - - - ResourceManagerEndpoint - - Sets or changes the endpoint for Azure Resource Manager data to the specified value.For more information about Azure Resource Manager, see Azure Resource Manager Cmdlets (http://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (http://go.microsoft.com/fwlink/?LinkID=394767). - - String - - - CurrentStorageAccountName - - Designates the specified storage account as the "current" storage account for the subscription. Enter the storage account name. The parameter value is case-sensitive. Wildcard characters are not permitted.This parameter does not create a storage account; it just associates the storage account with the subscription. To create a storage account, use the New-AzureStorageAccount cmdlet. - - String - - - Environment - - Specifies the environment name. - - String - - - PassThru - - Returns True ($true) if the operation succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - Set-AzureSubscription - - SubscriptionName - - Specifies the subscription name. If an Azure subscription with this name does not exist, this parameter creates a new subscription with the specified name. If the subscription exists, this parameter identifies the subscription and uses the other property values to change it.To get the names of existing Azure subscriptions, use the Get-AzureSubscription cmdlet. - - String - - - Certificate - - Specifies a management certificate for the subscription. Management certificates are X.509 certificates that are saved as .cer files and uploaded to the Azure Management Portal. The certificate, including its private key, must be installed on the local computer, either in the current user's personal certificate store, or the local machine’s personal certificate store. - - X509Certificate2 - - - ServiceEndpoint - - Sets or changes the custom service endpoint for the management service to the specified value.The service endpoint is the Azure management API endpoint in the Azure environment. You can create custom service endpoints and set a different service endpoint for each subscription. - - String - - - ResourceManagerEndpoint - - Sets or changes the endpoint for Azure Resource Manager data to the specified value.For more information about Azure Resource Manager, see Azure Resource Manager Cmdlets (http://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (http://go.microsoft.com/fwlink/?LinkID=394767). - - String - - - CurrentStorageAccountName - - Designates the specified storage account as the "current" storage account for the subscription. Enter the storage account name. The parameter value is case-sensitive. Wildcard characters are not permitted.This parameter does not create a storage account; it just associates the storage account with the subscription. To create a storage account, use the New-AzureStorageAccount cmdlet. - - String - - - Environment - - Specifies the environment name. - - String - - - PassThru - - Returns True ($true) if the operation succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - Set-AzureSubscription - - SubscriptionId - - Specifies the ID of the subscription. To get the subscription ID of an existing Azure subscription, use the Get-AzureSubscription cmdlet. - - String - - - Certificate - - Specifies a management certificate for the subscription. Management certificates are X.509 certificates that are saved as .cer files and uploaded to the Azure Management Portal. The certificate, including its private key, must be installed on the local computer, either in the current user's personal certificate store, or the local machine’s personal certificate store. - - X509Certificate2 - - - ServiceEndpoint - - Sets or changes the custom service endpoint for the management service to the specified value.The service endpoint is the Azure management API endpoint in the Azure environment. You can create custom service endpoints and set a different service endpoint for each subscription. - - String - - - ResourceManagerEndpoint - - Sets or changes the endpoint for Azure Resource Manager data to the specified value.For more information about Azure Resource Manager, see Azure Resource Manager Cmdlets (http://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (http://go.microsoft.com/fwlink/?LinkID=394767). - - String - - - CurrentStorageAccountName - - Designates the specified storage account as the "current" storage account for the subscription. Enter the storage account name. The parameter value is case-sensitive. Wildcard characters are not permitted.This parameter does not create a storage account; it just associates the storage account with the subscription. To create a storage account, use the New-AzureStorageAccount cmdlet. - - String - - - Environment - - Specifies the environment name. - - String - - - PassThru - - Returns True ($true) if the operation succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. - - SwitchParameter - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - - - - - SubscriptionName - - Specifies the subscription name. If an Azure subscription with this name does not exist, this parameter creates a new subscription with the specified name. If the subscription exists, this parameter identifies the subscription and uses the other property values to change it.To get the names of existing Azure subscriptions, use the Get-AzureSubscription cmdlet. - - String - - String - - - - - - SubscriptionId - - Specifies the ID of the subscription. To get the subscription ID of an existing Azure subscription, use the Get-AzureSubscription cmdlet. - - String - - String - - - - - - Certificate - - Specifies a management certificate for the subscription. Management certificates are X.509 certificates that are saved as .cer files and uploaded to the Azure Management Portal. The certificate, including its private key, must be installed on the local computer, either in the current user's personal certificate store, or the local machine’s personal certificate store. - - X509Certificate2 - - X509Certificate2 - - - - - - ServiceEndpoint - - Sets or changes the custom service endpoint for the management service to the specified value.The service endpoint is the Azure management API endpoint in the Azure environment. You can create custom service endpoints and set a different service endpoint for each subscription. - - String - - String - - - - - - ResourceManagerEndpoint - - Sets or changes the endpoint for Azure Resource Manager data to the specified value.For more information about Azure Resource Manager, see Azure Resource Manager Cmdlets (http://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (http://go.microsoft.com/fwlink/?LinkID=394767). - - String - - String - - - - - - CurrentStorageAccountName - - Designates the specified storage account as the "current" storage account for the subscription. Enter the storage account name. The parameter value is case-sensitive. Wildcard characters are not permitted.This parameter does not create a storage account; it just associates the storage account with the subscription. To create a storage account, use the New-AzureStorageAccount cmdlet. - - String - - String - - - - - - Environment - - Specifies the environment name. - - String - - String - - - - - - PassThru - - Returns True ($true) if the operation succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. - - SwitchParameter - - SwitchParameter - - - - - - SubscriptionDataFile - - Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. - - String - - String - - - - - - - - - None - - - - - - - - - - - - - None or System.Boolean - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Create a new subscription -------------------------- - - PS C:\> - - PS C:\>$thumbprint = <Certificate Thumbprint> -PS C:\>$myCert = Get-Item cert:\\CurrentUser\My\$thumbprint -PS C:\>Set-AzureSubscription -SubscriptionName ContosotTest -Certificate $myCert -SubscriptionID 12345 - - These commands create the ContosoTest subscription in the default subscription data file. The commands add a management certificate and subscription ID for the new subscription. - - - When you run the Set-AzureSubscription command, the cmdlet looks for a subscription with the name "ContosoTest". If it doesn't find one, it creates a new subscription with the specified values. - - - - - - - - - - - -------------------------- Example 2: Change an existing subscription -------------------------- - - PS C:\> - - PS C:\> C:\PS> $thumbprint = <Thumbprint-2> -C:\PS> $differentCert = Get-Item cert:\\CurrentUser\My\$thumbprint -C:\PS> Set-AzureSubscription –SubscriptionName ContosoEngineering -Certificate $differentCert - - These commands are very similar to the commands in Example 1. However, because the SubscriptionName parameter now identifies an existing subscription, Set-AzureSubscription uses the remaining parameters to change the values of the existing subscription rather than creating a new subscription - - - - - - - - - - - - - - -------------------------- Example 2: Change the service endpoint -------------------------- - - PS C:\> - - PS C:\> C:\PS> Set-AzureSubscription –SubscriptionName ContosoEngineering -ServiceEndpoint "https://management.core.contoso.com" - - This command adds or changes a custom service endpoint for the ContosoEngineering subscription. - - - - - - - - - - - - - - -------------------------- Example 3: Clear property values -------------------------- - - PS C:\> - - PS C:\> C:\PS> Set-AzureSubscription –SubscriptionName ContosoEngineering –Certificate $null -ResourceManagerEndpoint $null - - This command sets the values of the Certificate and ResourceManagerEndpoint properties to null ($null). This clears the values of those properties without changing other settings. - - - - - - - - - - - - - - -------------------------- Example 4: Use an alternate subscription data file -------------------------- - - PS C:\> - - PS C:\> C:\PS> Set-AzureSubscription -SubscriptionName ContosoFinance -SubscriptionDataFile = C:\Azure\SubscriptionData.xml - CurrentStorageAccount ContosoStorage01 - - This command changes the current storage account of the ContosoFinance subscription to ContosoStorage01. The command uses the SubscriptionDataFile parameter to change the data in the C:\Azure\SubscriptionData.xml subscription data file. By default, Set-AzureSubscription uses the default subscription data file in your roaming user profile. - - - - - - - - - - - - - - - - Online Version: - http://go.microsoft.com/fwlink/?LinkID=397630 - - - Add-AzureAccount - - - - Get-AzureSubscription - - - - Import-AzurePublishSettingsFile - - - - Remove-AzureSubscription - - - - Select-AzureSubscription - - - - - - - - Switch-AzureMode - - Switches between the Azure and Azure Resource Manager modules - - - - - Switch - AzureMode - - - - This is the Description section - The Switch-AzureMode cmdlet switches between the Azure and Azure Resource Manager (AzureResourceManager) modules. These modules are not designed to be used in the same session. To determine which module is in your current session, use the Get-Module cmdlet.NOTE: The AzureResourceManager module is currently in preview. It might not provide the same management capabilities as the Azure module. Beginning in version 0.8,0, the Azure PowerShell installation includes both Azure modules and Azure Profile, a module of commands common to both modules. When you use the Azure PowerShell cmdlets, the Azure and Azure Profile modules are imported into the session by default. To remove the Azure module from the session and import the Azure Resource Manager module, use Switch-AzureMode. And, to switch back to the Azure module, just use Switch-AzureMode again. The Azure module includes cmdlets that help you to manage your Azure account in the traditional way. The cmdlets get, create, change, and remove individual resources such as storage accounts, virtual machines, SQL databases, web sites, media services, and cloud services.The new Azure Resource Manager module lets you manage your resources in an entirely new way. Instead of creating individual resources and trying to use them together, begin by imagining the service you want to create, such as a web portal, a blog, a photo gallery, a commerce site, or a wiki. Select a resource group template, including one of dozens in the Azure template gallery, or create your own. Each template provides a model of a complex service, complete with the resources that you need to support the service. Then use the template to create a resource group and its resources, and deploy and manage the related resources as a unit.You can use Switch-AzureMode to switch between Azure modules as often as you like. To set an Azure module as the default for all sessions, use the Global parameter when switching between modes. - - - - Switch-AzureMode - - Name - - Switches to the specified module. To switch to the Azure Resource Manager module, type AzureResourceManager. To switch to the Azure module, type AzureServiceManagement. This parameter is required. - - String - - - Global - - Switches all Windows PowerShell session to the specified Azure module. Use this parameter to save your module selection for other sessions. This parameter is optional. By default, the switch affects only the current session.This parameter requires administrator permissions. To use this parameter, start Windows PowerShell with the "Run as administrator" option. - - SwitchParameter - - - - - - Name - - Switches to the specified module. To switch to the Azure Resource Manager module, type AzureResourceManager. To switch to the Azure module, type AzureServiceManagement. This parameter is required. - - String - - String - - - - - - Global - - Switches all Windows PowerShell session to the specified Azure module. Use this parameter to save your module selection for other sessions. This parameter is optional. By default, the switch affects only the current session.This parameter requires administrator permissions. To use this parameter, start Windows PowerShell with the "Run as administrator" option. - - SwitchParameter - - SwitchParameter - - - - - - - - - None - - - - - - - - - - - - - None - - - - - - - - - - - - - - - - - - - - -------------------------- Example 1: Switch to the Azure Resource Manager module -------------------------- - - PS C:\> - - PS C:\>Switch-AzureMode -Name AzureResourceManager -PS C:\>Switch-AzureMode -Name AzureServiceManagement - - This command shows you how to switch between modules. The first command uses the Switch-AzureMode cmdlet to switch to the Azure Resource Manager module. The second command uses the Switch-AzureMode cmdlet to switch back to the Azure module. - - - When you import either module, the AzureProfile module, which includes commands common to both modules, including Add-AzureAccount, Get-AzureSubscription, and Switch-AzureMode, is imported, too. - - - - - - - - - - - -------------------------- Example 2: Switch all sessions to the Azure Resource Manager module -------------------------- - - PS C:\> - - PS C:\>Switch-AzureMode -Name AzureResourceManager -Global - - This command uses the Global parameter of Switch-AzureMode to switch all Microsoft Azure PowerShell sessions to the Azure Resource Manager module. If you close this session and open an new one, the Azure Resource Manager module is imported by default. - - - The Global parameter requires administrator permissions. To run this command, start Windows PowerShell with the "Run as administrator" option. - - - - - - - - - - - - - Online Version: - http://go.microsoft.com/fwlink/?LinkID=394398 - - - Azure Resource Manager Cmdlets - - - - Azure Service Management Cmdlets - - - - Azure Profile Cmdlets - - - - + Confirm + Are you sure you want to perform this action? + [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): + + + This command deletes the "Test" subscription from the default subscription data file. + + + + + + + + + + + + + + -------------------------- Example 2: Delete from an alternate subscription data file -------------------------- + + PS C:\> + + PS C:\> C:\PS> Remove-AzureSubscription -SubscriptionName Test -SubscriptionDataFile C:\Subs\MySubscriptions.xml -Force + + This command deletes the Test subscription from the MySubscriptions.xml subscription data file. The command uses the Force parameter to suppress the confirmation prompt. + + + + + + + + + + + + + + -------------------------- Example 3: Delete a subscription in a script -------------------------- + + PS C:\> + + PS C:\> C:\PS> ...if (Remove-AzureSubscription -SubscriptionName Test -PassThru) {...} + + This command uses the Remove-AzureSubscription command in an If statement. It uses the PassThru parameter, which returns a Boolean value, to determine whether the script block in the If statement is executed. + + + + + + + + + + + + + + + + Online Version: + http://go.microsoft.com/fwlink/?LinkID=397627 + + + Get-AzureSubscription + + + + Select-AzureSubscription + + + + Set-AzureSubscription + + + + + + + + Select-AzureSubscription + + Changes the current and default Azure subscriptions + + + + + Select + AzureSubscription + + + + The Select-AzureSubscription cmdlet sets and clears the current and default Azure subscriptions. + The "current subscription" is the subscription that is used by default in the current Windows PowerShell session. The "default subscription" is used by default in all Windows PowerShell sessions. The "current subscription" label lets you specify a different subscription to be used by default for the current session without changing the "default subscription" for all other sessions. + The "default" subscription designation is saved in your subscription data file. The session-specific "current" designation is not saved. + + + + Select-AzureSubscription + + SubscriptionName + + Specifies the subscription to change. Enter the subscription name. This parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + + Account + + Specifies optionally the account to use with the subscription. This parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + + Current + + Sets the "current" subscription. Use the SubscriptionName parameter to identify the subscription.The "current subscription" is the subscription that is used by default in the current Windows PowerShell session. + + SwitchParameter + + + PassThru + + Returns True ($true) when the operation succeeds and False ($false) when it fails. By default, this cmdlet does not return any output. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + Select-AzureSubscription + + SubscriptionName + + Specifies the subscription to change. Enter the subscription name. This parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + + Account + + Specifies optionally the account to use with the subscription. This parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + + Default + + Sets the "default" subscription. Use the SubscriptionName parameter to identify the subscription.The "default subscription" is the subscription that is used by default in the all Windows PowerShell sessions, unless a different subscription is set to "current". + + SwitchParameter + + + PassThru + + Returns True ($true) when the operation succeeds and False ($false) when it fails. By default, this cmdlet does not return any output. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + Select-AzureSubscription + + SubscriptionId + + Specifies the subscription Id to change. Enter the subscription Id. + + String + + + Account + + Specifies optionally the account to use with the subscription. This parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + + Current + + Sets the "current" subscription. Use the SubscriptionName parameter to identify the subscription.The "current subscription" is the subscription that is used by default in the current Windows PowerShell session. + + SwitchParameter + + + PassThru + + Returns True ($true) when the operation succeeds and False ($false) when it fails. By default, this cmdlet does not return any output. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + Select-AzureSubscription + + SubscriptionId + + Specifies the subscription Id to change. Enter the subscription Id. + + String + + + Account + + Specifies optionally the account to use with the subscription. This parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + + Default + + Sets the "default" subscription. Use the SubscriptionName parameter to identify the subscription.The "default subscription" is the subscription that is used by default in the all Windows PowerShell sessions, unless a different subscription is set to "current". + + SwitchParameter + + + PassThru + + Returns True ($true) when the operation succeeds and False ($false) when it fails. By default, this cmdlet does not return any output. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + Select-AzureSubscription + + Account + + Specifies optionally the account to use with the subscription. This parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + + NoCurrent + + Clears the "current" subscription setting. When no subscription is set to "current," the Azure PowerShell cmdlets use the default subscription. + + SwitchParameter + + + PassThru + + Returns True ($true) when the operation succeeds and False ($false) when it fails. By default, this cmdlet does not return any output. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + Select-AzureSubscription + + Account + + Specifies optionally the account to use with the subscription. This parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + + NoDefault + + Clears the "default" subscription setting. If there is no default subscription, the current subscription is used by default. When there is no current or default subscription, and you do not identify a subscription, commands that require a subscription fail. + + SwitchParameter + + + PassThru + + Returns True ($true) when the operation succeeds and False ($false) when it fails. By default, this cmdlet does not return any output. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + + + SubscriptionName + + Specifies the subscription to change. Enter the subscription name. This parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + String + + + + + + Account + + Specifies optionally the account to use with the subscription. This parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + String + + + + + + Current + + Sets the "current" subscription. Use the SubscriptionName parameter to identify the subscription.The "current subscription" is the subscription that is used by default in the current Windows PowerShell session. + + SwitchParameter + + SwitchParameter + + + + + + PassThru + + Returns True ($true) when the operation succeeds and False ($false) when it fails. By default, this cmdlet does not return any output. + + SwitchParameter + + SwitchParameter + + + + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + String + + + + + + Default + + Sets the "default" subscription. Use the SubscriptionName parameter to identify the subscription.The "default subscription" is the subscription that is used by default in the all Windows PowerShell sessions, unless a different subscription is set to "current". + + SwitchParameter + + SwitchParameter + + + + + + SubscriptionId + + Specifies the subscription Id to change. Enter the subscription Id. + + String + + String + + + + + + NoCurrent + + Clears the "current" subscription setting. When no subscription is set to "current," the Azure PowerShell cmdlets use the default subscription. + + SwitchParameter + + SwitchParameter + + + + + + NoDefault + + Clears the "default" subscription setting. If there is no default subscription, the current subscription is used by default. When there is no current or default subscription, and you do not identify a subscription, commands that require a subscription fail. + + SwitchParameter + + SwitchParameter + + + + + + + + + None + + + + + + + + + + + + + None or AzureSubscription if PassThru + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1: Set the current subscription -------------------------- + + PS C:\> + + PS C:\> C:\PS> Select-AzureSubscription -Current -SubscriptionName ContosoEngineering + + This command makes "ContosoEngineering" the current subscription. + + + + + + + + + + + + + + -------------------------- Example 2: Set the current subscription with account -------------------------- + + PS C:\> + + PS C:\> C:\PS> Select-AzureSubscription -Current -SubscriptionName ContosoEngineering -Account user@mail.contoso.com + + This command makes "ContosoEngineering" the current subscription and user@mail.contoso.com the current user. + + + + + + + + + + + + + + -------------------------- Example 3: Set the default description -------------------------- + + PS C:\> + + PS C:\> C:\PS> Select-AzureSubscription -Default -SubscriptionName ContosoFinance -SubscriptionDataFile "C:\subs\MySubscriptions.xml" + + This command changes the default subscription to "ContosoFinance." It saves the setting in the Subscriptions.xml subscription data file, instead of the default subscription data file. + + + + + + + + + + + + + + + + Online Version: + http://go.microsoft.com/fwlink/?LinkID=397628 + + + Get-AzureSubscription + + + + Remove-AzureSubscription + + + + Set-AzureSubscription + + + + + + + + Set-AzureEnvironment + + Changes the properties of an Azure environment + + + + + Set + AzureEnvironment + + + + This is the Description section + The Set-AzureEnvironment cmdlet changes the properties of an Azure environment. It returns an object that represents the environment with its new property values. Use the Name parameter to identify the environment and the other parameters to change property values. You cannot use Set-AzureEnvironment to change the name of an Azure environment.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 (http://www.microsoft.com/en-us/server-cloud/products/windows-azure-pack/default.aspx).NOTE: Do not change the properties of the AzureCloud or AzureChinaCloud environments. Use this cmdlet to change the values of private environments that you create. + + + + Set-AzureEnvironment + + Name + + Identifies the environment that is being changed. This parameter is required. The parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + + PublishSettingsFileUrl + + Changes the URL for publish settings files in the specified environment. 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. + + String + + + ServiceEndpoint + + Changes the URL of the Azure service endpoint in the specified environment. 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. + + String + + + ManagementPortalUrl + + Changes the URL of the Azure Management Portal to the specified value. + + String + + + StorageEndpoint + + Changes the default endpoint of storage services in the specified environment. + + String + + + ActiveDirectoryEndpoint + + Changes the endpoint for Azure Active Directory authentication to the specified value. + + String + + + ResourceManagerEndpoint + + Changes 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 (http://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (http://go.microsoft.com/fwlink/?LinkID=394767). + + String + + + GalleryEndpoint + + Changes the endpoint for the Azure Resource Manager gallery to the specified value. The gallery endpoint is the location for resource group gallery templates. For more information about Azure resource groups and gallery templates, see the help topic for Get-AzureResourceGroupGalleryTemplate. + + String + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the resource ID of a management API whose access is managed by Azure Active Directory. + + String + + + GraphEndpoint + + Changes the endpoint for Azure Active Directory Graph API to the specified value. + + String + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + + + Name + + Identifies the environment that is being changed. This parameter is required. The parameter value is case-sensitive. Wildcard characters are not permitted. + + String + + String + + + + + + PublishSettingsFileUrl + + Changes the URL for publish settings files in the specified environment. 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. + + String + + String + + + + + + ServiceEndpoint + + Changes the URL of the Azure service endpoint in the specified environment. 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. + + String + + String + + + + + + ManagementPortalUrl + + Changes the URL of the Azure Management Portal to the specified value. + + String + + String + + + + + + StorageEndpoint + + Changes the default endpoint of storage services in the specified environment. + + String + + String + + + + + + ActiveDirectoryEndpoint + + Changes the endpoint for Azure Active Directory authentication to the specified value. + + String + + String + + + + + + ResourceManagerEndpoint + + Changes 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 (http://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (http://go.microsoft.com/fwlink/?LinkID=394767). + + String + + String + + + + + + GalleryEndpoint + + Changes the endpoint for the Azure Resource Manager gallery to the specified value. The gallery endpoint is the location for resource group gallery templates. For more information about Azure resource groups and gallery templates, see the help topic for Get-AzureResourceGroupGalleryTemplate. + + String + + String + + + + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the resource ID of a management API whose access is managed by Azure Active Directory. + + String + + String + + + + + + GraphEndpoint + + Changes the endpoint for Azure Active Directory Graph API to the specified value. + + String + + String + + + + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + String + + + + + + + + + None + + + + + + + + + + + + + Microsoft.WindowsAzure.Commands.Utilities.Common.WindowsAzureEnvironment + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1: Change environment properties -------------------------- + + PS C:\> + + PS C:\>Set-AzureEnvironment -Name ContosoEnv -PublishSettingsFileUrl "https://contoso.com" -StorageEndpoint "contoso.com" -GraphEndpoint "https://contoso.com/fwlink/?LinkID=104" + + This command changes the values of the PublishSettingsFileUrl, StorageEndpoint, and GraphEndpoint properties of the ContosoEnv environment. + + + + + + + + + + + + + + + + Online Version: + http://go.microsoft.com/fwlink/?LinkID=397629 + + + Add-AzureEnvironment + + + + Get-AzureEnvironment + + + + Remove-AzureEnvironment + + + + + + + + Set-AzureSubscription + + Creates or changes an Azure subscription + + + + + Set + AzureSubscription + + + + The Set-AzureSubscription cmdlet establishes and changes the properties of an Azure subscription. You can use this cmdlet to create a new subscription or change the properties of an existing subscription. + To create a new subscription, select a unique name for the value of the SubscriptionName parameter. To change an existing subscription, use the SubscriptionName parameter to identify the subscription. + This cmdlet changes the data in the subscription data file that you create when you use the Add-AzureAccount or Import-AzurePublishSettingsFile cmdlet to add an Azure account to Windows PowerShell. + + + + Set-AzureSubscription + + SubscriptionName + + Specifies the subscription name. If an Azure subscription with this name does not exist, this parameter creates a new subscription with the specified name. If the subscription exists, this parameter identifies the subscription and uses the other property values to change it.To get the names of existing Azure subscriptions, use the Get-AzureSubscription cmdlet. + + String + + + SubscriptionId + + Specifies the ID of the subscription. To get the subscription ID of an existing Azure subscription, use the Get-AzureSubscription cmdlet. + + String + + + Certificate + + Specifies a management certificate for the subscription. Management certificates are X.509 certificates that are saved as .cer files and uploaded to the Azure Management Portal. The certificate, including its private key, must be installed on the local computer, either in the current user's personal certificate store, or the local machine’s personal certificate store. + + X509Certificate2 + + + ServiceEndpoint + + Sets or changes the custom service endpoint for the management service to the specified value.The service endpoint is the Azure management API endpoint in the Azure environment. You can create custom service endpoints and set a different service endpoint for each subscription. + + String + + + ResourceManagerEndpoint + + Sets or changes the endpoint for Azure Resource Manager data to the specified value.For more information about Azure Resource Manager, see Azure Resource Manager Cmdlets (http://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (http://go.microsoft.com/fwlink/?LinkID=394767). + + String + + + CurrentStorageAccountName + + Designates the specified storage account as the "current" storage account for the subscription. Enter the storage account name. The parameter value is case-sensitive. Wildcard characters are not permitted.This parameter does not create a storage account; it just associates the storage account with the subscription. To create a storage account, use the New-AzureStorageAccount cmdlet. + + String + + + Environment + + Specifies the environment name. + + String + + + PassThru + + Returns True ($true) if the operation succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + Set-AzureSubscription + + SubscriptionName + + Specifies the subscription name. If an Azure subscription with this name does not exist, this parameter creates a new subscription with the specified name. If the subscription exists, this parameter identifies the subscription and uses the other property values to change it.To get the names of existing Azure subscriptions, use the Get-AzureSubscription cmdlet. + + String + + + Certificate + + Specifies a management certificate for the subscription. Management certificates are X.509 certificates that are saved as .cer files and uploaded to the Azure Management Portal. The certificate, including its private key, must be installed on the local computer, either in the current user's personal certificate store, or the local machine’s personal certificate store. + + X509Certificate2 + + + ServiceEndpoint + + Sets or changes the custom service endpoint for the management service to the specified value.The service endpoint is the Azure management API endpoint in the Azure environment. You can create custom service endpoints and set a different service endpoint for each subscription. + + String + + + ResourceManagerEndpoint + + Sets or changes the endpoint for Azure Resource Manager data to the specified value.For more information about Azure Resource Manager, see Azure Resource Manager Cmdlets (http://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (http://go.microsoft.com/fwlink/?LinkID=394767). + + String + + + CurrentStorageAccountName + + Designates the specified storage account as the "current" storage account for the subscription. Enter the storage account name. The parameter value is case-sensitive. Wildcard characters are not permitted.This parameter does not create a storage account; it just associates the storage account with the subscription. To create a storage account, use the New-AzureStorageAccount cmdlet. + + String + + + Environment + + Specifies the environment name. + + String + + + PassThru + + Returns True ($true) if the operation succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + Set-AzureSubscription + + SubscriptionId + + Specifies the ID of the subscription. To get the subscription ID of an existing Azure subscription, use the Get-AzureSubscription cmdlet. + + String + + + Certificate + + Specifies a management certificate for the subscription. Management certificates are X.509 certificates that are saved as .cer files and uploaded to the Azure Management Portal. The certificate, including its private key, must be installed on the local computer, either in the current user's personal certificate store, or the local machine’s personal certificate store. + + X509Certificate2 + + + ServiceEndpoint + + Sets or changes the custom service endpoint for the management service to the specified value.The service endpoint is the Azure management API endpoint in the Azure environment. You can create custom service endpoints and set a different service endpoint for each subscription. + + String + + + ResourceManagerEndpoint + + Sets or changes the endpoint for Azure Resource Manager data to the specified value.For more information about Azure Resource Manager, see Azure Resource Manager Cmdlets (http://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (http://go.microsoft.com/fwlink/?LinkID=394767). + + String + + + CurrentStorageAccountName + + Designates the specified storage account as the "current" storage account for the subscription. Enter the storage account name. The parameter value is case-sensitive. Wildcard characters are not permitted.This parameter does not create a storage account; it just associates the storage account with the subscription. To create a storage account, use the New-AzureStorageAccount cmdlet. + + String + + + Environment + + Specifies the environment name. + + String + + + PassThru + + Returns True ($true) if the operation succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. + + SwitchParameter + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + + + + + SubscriptionName + + Specifies the subscription name. If an Azure subscription with this name does not exist, this parameter creates a new subscription with the specified name. If the subscription exists, this parameter identifies the subscription and uses the other property values to change it.To get the names of existing Azure subscriptions, use the Get-AzureSubscription cmdlet. + + String + + String + + + + + + SubscriptionId + + Specifies the ID of the subscription. To get the subscription ID of an existing Azure subscription, use the Get-AzureSubscription cmdlet. + + String + + String + + + + + + Certificate + + Specifies a management certificate for the subscription. Management certificates are X.509 certificates that are saved as .cer files and uploaded to the Azure Management Portal. The certificate, including its private key, must be installed on the local computer, either in the current user's personal certificate store, or the local machine’s personal certificate store. + + X509Certificate2 + + X509Certificate2 + + + + + + ServiceEndpoint + + Sets or changes the custom service endpoint for the management service to the specified value.The service endpoint is the Azure management API endpoint in the Azure environment. You can create custom service endpoints and set a different service endpoint for each subscription. + + String + + String + + + + + + ResourceManagerEndpoint + + Sets or changes the endpoint for Azure Resource Manager data to the specified value.For more information about Azure Resource Manager, see Azure Resource Manager Cmdlets (http://go.microsoft.com/fwlink/?LinkID=394765) and Using Windows PowerShell with Resource Manager (http://go.microsoft.com/fwlink/?LinkID=394767). + + String + + String + + + + + + CurrentStorageAccountName + + Designates the specified storage account as the "current" storage account for the subscription. Enter the storage account name. The parameter value is case-sensitive. Wildcard characters are not permitted.This parameter does not create a storage account; it just associates the storage account with the subscription. To create a storage account, use the New-AzureStorageAccount cmdlet. + + String + + String + + + + + + Environment + + Specifies the environment name. + + String + + String + + + + + + PassThru + + Returns True ($true) if the operation succeeds and False ($false) if it fails. By default, this cmdlet does not return any output. + + SwitchParameter + + SwitchParameter + + + + + + SubscriptionDataFile + + [Deprecated]: The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. Specifies the path to a profile file. This parameter is optional. If it is not provided, default file in the user's profile is used. + + String + + String + + + + + + + + + None + + + + + + + + + + + + + None or System.Boolean + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1: Create a new subscription -------------------------- + + PS C:\> + + + PS C:\>$thumbprint = <Certificate Thumbprint> + PS C:\>$myCert = Get-Item cert:\\CurrentUser\My\$thumbprint + PS C:\>Set-AzureSubscription -SubscriptionName ContosotTest -Certificate $myCert -SubscriptionID 12345 + + + These commands create the ContosoTest subscription in the default subscription data file. The commands add a management certificate and subscription ID for the new subscription. + + + When you run the Set-AzureSubscription command, the cmdlet looks for a subscription with the name "ContosoTest". If it doesn't find one, it creates a new subscription with the specified values. + + + + + + + + + + + -------------------------- Example 2: Change an existing subscription -------------------------- + + PS C:\> + + + PS C:\> C:\PS> $thumbprint = <Thumbprint-2> + C:\PS> $differentCert = Get-Item cert:\\CurrentUser\My\$thumbprint + C:\PS> Set-AzureSubscription –SubscriptionName ContosoEngineering -Certificate $differentCert + + + These commands are very similar to the commands in Example 1. However, because the SubscriptionName parameter now identifies an existing subscription, Set-AzureSubscription uses the remaining parameters to change the values of the existing subscription rather than creating a new subscription + + + + + + + + + + + + + + -------------------------- Example 2: Change the service endpoint -------------------------- + + PS C:\> + + PS C:\> C:\PS> Set-AzureSubscription –SubscriptionName ContosoEngineering -ServiceEndpoint "https://management.core.contoso.com" + + This command adds or changes a custom service endpoint for the ContosoEngineering subscription. + + + + + + + + + + + + + + -------------------------- Example 3: Clear property values -------------------------- + + PS C:\> + + PS C:\> C:\PS> Set-AzureSubscription –SubscriptionName ContosoEngineering –Certificate $null -ResourceManagerEndpoint $null + + This command sets the values of the Certificate and ResourceManagerEndpoint properties to null ($null). This clears the values of those properties without changing other settings. + + + + + + + + + + + + + + -------------------------- Example 4: Use an alternate subscription data file -------------------------- + + PS C:\> + + PS C:\> C:\PS> Set-AzureSubscription -SubscriptionName ContosoFinance -SubscriptionDataFile = C:\Azure\SubscriptionData.xml - CurrentStorageAccount ContosoStorage01 + + This command changes the current storage account of the ContosoFinance subscription to ContosoStorage01. The command uses the SubscriptionDataFile parameter to change the data in the C:\Azure\SubscriptionData.xml subscription data file. By default, Set-AzureSubscription uses the default subscription data file in your roaming user profile. + + + + + + + + + + + + + + + + Online Version: + http://go.microsoft.com/fwlink/?LinkID=397630 + + + Add-AzureAccount + + + + Get-AzureSubscription + + + + Import-AzurePublishSettingsFile + + + + Remove-AzureSubscription + + + + Select-AzureSubscription + + + + + + + + Switch-AzureMode + + Switches between the Azure and Azure Resource Manager modules + + + + + Switch + AzureMode + + + + This is the Description section + The Switch-AzureMode cmdlet switches between the Azure and Azure Resource Manager (AzureResourceManager) modules. These modules are not designed to be used in the same session. To determine which module is in your current session, use the Get-Module cmdlet.NOTE: The AzureResourceManager module is currently in preview. It might not provide the same management capabilities as the Azure module. Beginning in version 0.8,0, the Azure PowerShell installation includes both Azure modules and Azure Profile, a module of commands common to both modules. When you use the Azure PowerShell cmdlets, the Azure and Azure Profile modules are imported into the session by default. To remove the Azure module from the session and import the Azure Resource Manager module, use Switch-AzureMode. And, to switch back to the Azure module, just use Switch-AzureMode again. The Azure module includes cmdlets that help you to manage your Azure account in the traditional way. The cmdlets get, create, change, and remove individual resources such as storage accounts, virtual machines, SQL databases, web sites, media services, and cloud services.The new Azure Resource Manager module lets you manage your resources in an entirely new way. Instead of creating individual resources and trying to use them together, begin by imagining the service you want to create, such as a web portal, a blog, a photo gallery, a commerce site, or a wiki. Select a resource group template, including one of dozens in the Azure template gallery, or create your own. Each template provides a model of a complex service, complete with the resources that you need to support the service. Then use the template to create a resource group and its resources, and deploy and manage the related resources as a unit.You can use Switch-AzureMode to switch between Azure modules as often as you like. To set an Azure module as the default for all sessions, use the Global parameter when switching between modes. + + + + Switch-AzureMode + + Name + + Switches to the specified module. To switch to the Azure Resource Manager module, type AzureResourceManager. To switch to the Azure module, type AzureServiceManagement. This parameter is required. + + String + + + Global + + Switches all Windows PowerShell session to the specified Azure module. Use this parameter to save your module selection for other sessions. This parameter is optional. By default, the switch affects only the current session.This parameter requires administrator permissions. To use this parameter, start Windows PowerShell with the "Run as administrator" option. + + SwitchParameter + + + + + + Name + + Switches to the specified module. To switch to the Azure Resource Manager module, type AzureResourceManager. To switch to the Azure module, type AzureServiceManagement. This parameter is required. + + String + + String + + + + + + Global + + Switches all Windows PowerShell session to the specified Azure module. Use this parameter to save your module selection for other sessions. This parameter is optional. By default, the switch affects only the current session.This parameter requires administrator permissions. To use this parameter, start Windows PowerShell with the "Run as administrator" option. + + SwitchParameter + + SwitchParameter + + + + + + + + + None + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + -------------------------- Example 1: Switch to the Azure Resource Manager module -------------------------- + + PS C:\> + + + PS C:\>Switch-AzureMode -Name AzureResourceManager + PS C:\>Switch-AzureMode -Name AzureServiceManagement + + + This command shows you how to switch between modules. The first command uses the Switch-AzureMode cmdlet to switch to the Azure Resource Manager module. The second command uses the Switch-AzureMode cmdlet to switch back to the Azure module. + + + When you import either module, the AzureProfile module, which includes commands common to both modules, including Add-AzureAccount, Get-AzureSubscription, and Switch-AzureMode, is imported, too. + + + + + + + + + + + -------------------------- Example 2: Switch all sessions to the Azure Resource Manager module -------------------------- + + PS C:\> + + PS C:\>Switch-AzureMode -Name AzureResourceManager -Global + + This command uses the Global parameter of Switch-AzureMode to switch all Microsoft Azure PowerShell sessions to the Azure Resource Manager module. If you close this session and open an new one, the Azure Resource Manager module is imported by default. + + + The Global parameter requires administrator permissions. To run this command, start Windows PowerShell with the "Run as administrator" option. + + + + + + + + + + + + + Online Version: + http://go.microsoft.com/fwlink/?LinkID=394398 + + + Azure Resource Manager Cmdlets + + + + Azure Service Management Cmdlets + + + + Azure Profile Cmdlets + + + + \ No newline at end of file