購読IDを使用したAzure PowerShell Select-Azuresubscription
-
22-12-2019 - |
質問
PowerShell Azure Cmdletsを使用して、私が持っている各サブスクリプションに対して何らかの操作を行います。
$subs | ForEach-Object {
Select-AzureSubscription -Current -SubscriptionName $_.SubscriptionName
$services = Get-AzureService
Write-Output "$($services .Length) services under $($_.SubscriptionId) subscription"
}
.
サブスクリプションはサブスクリプションIDが異なるだけであるため、常に同じ購読のために機能します。
とSelect-AzureSubscription
には-SubscriptionId
パラメータがありません。
任意のアイデア回避策を見つけることができますか?
解決
PublishSettingsファイルを編集し、各サブスクリプションに別の名前を付けます。その後、再インポートします。その時点で、名前でそれぞれのものに簡単にアクセスできるようになります。
他のヒント
これが後で追加された場合は確かないが、2015年11月現在、-SubscriptionId
Write-Host "Selecting Azure subscription using id"
Select-AzureSubscription -SubscriptionId $subscriptionId
. アカウントのアカウント管理者の場合は、購読の名前を変更できます。このようにして、購読ダウンロードダウンロードのダウンロードにアクセスできる場合は、その名前が必要な方法が設定されます。
htef="http://rickrainey.com/windows-azure-how-tos/how-to-change-the-name-of-your-windows-azure-subscription/" rel="nofollow"> http://rickrainey.com/windows-azure-how-tos/how-to-change-the-name-of-your-windows-azure-subscription/
所属していません StackOverflow