github.com/darmach/terratest@v0.34.8-0.20210517103231-80931f95e3ff/modules/azure/subscription.go (about)

     1  package azure
     2  
     3  import (
     4  	"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions"
     5  )
     6  
     7  // GetSubscriptionClientE is a helper function that will setup an Azure Subscription client on your behalf
     8  func GetSubscriptionClientE() (*subscriptions.Client, error) {
     9  	// Create a Subscription client
    10  	client, err := CreateSubscriptionsClientE()
    11  	if err != nil {
    12  		return nil, err
    13  	}
    14  
    15  	// Create an authorizer
    16  	authorizer, err := NewAuthorizer()
    17  	if err != nil {
    18  		return nil, err
    19  	}
    20  
    21  	// Attach authorizer to the client
    22  	client.Authorizer = *authorizer
    23  	return &client, nil
    24  }