여러 Azure 구독 관리Manage multiple Azure subscriptions

Azure를 처음 접하는 분들은 아마도 구독을 하나만 갖고 계실 것입니다.If you're brand new to Azure, you probably only have a single subscription. 하지만 한동안 Azure를 사용해 오신 분들 중에는 Azure 구독을 여러 개 만든 분도 있을 것입니다.But if you have been using Azure for a while, you may have created multiple Azure subscriptions. 특정 구독에 대해 명령을 실행하도록 Azure PowerShell을 구성할 수 있습니다.You can configure Azure PowerShell to execute commands against a particular subscription.

  1. 계정의 모든 구독 목록을 가져옵니다.Get a list of all subscriptions in your account.

    Get-AzureRmSubscription
    
    Environment           : AzureCloud
    Account               : username@contoso.com
    TenantId              : XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
    SubscriptionId        : XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
    SubscriptionName      : My Production Subscription
    CurrentStorageAccount :
    
    Environment           : AzureCloud
    Account               : username@contoso.com
    TenantId              : XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
    SubscriptionId        : XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
    SubscriptionName      : My DevTest Subscription
    CurrentStorageAccount :
    
    Environment           : AzureCloud
    Account               : username@contoso.com
    TenantId              : XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
    SubscriptionId        : XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
    SubscriptionName      : My Demos
    CurrentStorageAccount :
    
  2. 기본 구독을 설정합니다.Set the default.

    Select-AzureRmSubscription -Subscription "My Demos"
    
  3. Get-AzureRmContext cmdlet을 실행하여 변경 내용을 확인합니다.Verify the change by running the Get-AzureRmContext cmdlet.

    Get-AzureRmContext
    
    Environment           : AzureCloud
    Account               : username@contoso.com
    TenantId              : XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
    SubscriptionId        : XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
    SubscriptionName      : My Demos
    CurrentStorageAccount :
    

기본 구독을 설정한 후에는 모든 Azure PowerShell 명령이 기본 구독에 대해 실행됩니다.Once you set your default subscription, all Azure PowerShell commands run against this subscription.