Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Get-AzurePublishSettingsFile

Get-AzurePublishSettingsFile

microsoft.windowsazure.commands.profile.dll, microsoft.windowsazure.commands.dll

Synopsis

Downloads the publish settings file for an Azure subscription.

Syntax

Get-AzurePublishSettingsFile [-Environment] [-Realm] [-PassThru] [-SubscriptionDataFile] [<CommonParameters>]

Detailed Description

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.This topic describes the cmdlet in the 0.8.8 version of the Microsoft Azure PowerShell module. To find out the version of the module you're using, from the Azure PowerShell console, type (get-module azure).version.

Parameters

-Environment <String>

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).

Aliases

None

Required?

false

Position

0

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Realm <String>

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.

Aliases

None

Required?

false

Position

1

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-PassThru <SwitchParameter>

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.

Aliases

None

Required?

false

Position

2

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-SubscriptionDataFile <String>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type

None

Return Type

None or System.Boolean

Notes

Examples

-------------------------- Example 1: Download a publish settings file --------------------------

This command opens your default browser, connects to your Microsoft Azure account, and then downloads the .publishsettings file for your account.

PS C:\>Get-AzurePublishSettingsFile

-------------------------- Example 2: Specify a realm --------------------------

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.

PS C:\>Get-AzurePublishSettingsFile -Realm contoso.com -Passthru

Online Version
Add-AzureAccount
Import-AzurePublishSettingsFile