Get-AzureEnvironment
Azure 環境を取得します
注意
このドキュメントで参照されているコマンドレットは、Service Management API を使用するレガシ Azure リソースを管理するためのものです。 Azure Resource Manager リソースを管理するためのコマンドレットについては、Az PowerShell モジュールを参照してください。
構文
Get-AzureEnvironment
[-Name <String>]
[-Profile <AzureSMProfile>]
[<CommonParameters>]
説明
Get-AzureEnvironment コマンドレットは、Windows PowerShell で使用できる Azure 環境を取得します。
Azure 環境は、グローバル Azure 用の AzureCloud や、中国の 21Vianet によって運用される AzureChinaCloud for Azure など、Microsoft Azure の独立したデプロイです。 また、Azure Pack と WAPack コマンドレットを使用して、オンプレミスの Azure 環境を作成することもできます。 詳細については、Azure Pack を参照してください)。
Get-AzureEnvironment コマンドレットは、Azure からではなく、サブスクリプション データ ファイルから環境を取得します。 サブスクリプション データ ファイルが古い場合は、Add-AzureAccount または Import-PublishSettingsFile コマンドレットを実行して更新します。
このトピックでは、Microsoft Azure PowerShell モジュールの 0.8.10 バージョンのコマンドレットについて説明します。
使用しているモジュールのバージョンを取得するには、Azure PowerShell コンソールで「.」と入力します (Get-Module -Name Azure).Version
。
例
例 1: すべての環境を取得する
PS C:\> Get-AzureEnvironment
EnvironmentName ServiceEndpoint ResourceManagerEndpoint PublishSettingsFileUrl
--------------- --------------- ----------------------- ----------------------
AzureCloud https://management.core.wi... https://management.azure.com/ https://go.microsoft.com/fw...
AzureChinaCloud https://management.core.ch... https://not-supported-serv... https://go.microsoft.com/fw...
このコマンドは、Windows PowerShell で使用できるすべての環境を取得します。
例 2: 名前で環境を取得する
PS C:\> Get-AzureEnvironment -Name AzureCloud
Name : AzureCloud
PublishSettingsFileUrl : https://go.microsoft.com/fwlink/?LinkID=301775
ServiceEndpoint : https://management.core.windows.net/
ResourceManagerEndpoint : https://management.azure.com/
ManagementPortalUrl : https://go.microsoft.com/fwlink/?LinkId=254433
ActiveDirectoryEndpoint : https://login.windows.net/
ActiveDirectoryCommonTenantId : common
StorageEndpointSuffix : core.windows.net
StorageBlobEndpointFormat : {0}://{1}.blob.core.windows.net/
StorageQueueEndpointFormat : {0}://{1}.queue.core.windows.net/
StorageTableEndpointFormat : {0}://{1}.table.core.windows.net/
GalleryEndpoint : https://gallery.azure.com/
この例では、AzureCloud 環境を取得します。
例 3: すべての環境のすべてのプロパティを取得する
PS C:\> Get-AzureEnvironment | ForEach-Object {Get-AzureEnvironment -Name $_.EnvironmentName}
このコマンドは、すべての環境のすべてのプロパティを取得します。
このコマンドでは、 Get-AzureEnvironment コマンドレットを使用して、このアカウントのすべての Azure 環境を取得します。 次に、Foreach-Object コマンドレットを使用して、各環境で Name パラメーターを指定して Get-AzureEnvironment コマンドを実行します。 Name パラメーターの値は、各環境の EnvironmentName プロパティです。
パラメーターがない場合、 Get-AzureEnvironment は環境の選択されたプロパティのみを取得します。
パラメーター
-Name
指定した環境のみを取得します。 環境名を入力します。 パラメーター値では大文字と小文字が区別されます。 ワイルドカード文字は使用できません。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Profile
このコマンドレットが読み取る Azure プロファイルを指定します。 プロファイルを指定しない場合、このコマンドレットはローカルの既定のプロファイルから読み取ります。
Type: | AzureSMProfile |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
入力
None
このコマンドレットへの入力はプロパティ名でパイプできますが、値によるパイプ処理は行いません。
出力
既定では、 Get-AzureEnvironment はカスタム オブジェクトを返します。
Microsoft.WindowsAzure.Commands.Utilities.Common.WindowsAzureEnvironment
Name パラメーターを使用して Get-AzureEnvironment を実行すると、WindowsAzureEnvironment オブジェクトが返されます。