|
|
|
|
@ -9,6 +9,7 @@ import (
|
|
|
|
|
"net/url"
|
|
|
|
|
"os"
|
|
|
|
|
"strconv"
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute"
|
|
|
|
|
newCompute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute"
|
|
|
|
|
@ -126,7 +127,7 @@ func byConcatDecorators(decorators ...autorest.RespondDecorator) autorest.Respon
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewAzureClient(subscriptionID, resourceGroupName, storageAccountName string,
|
|
|
|
|
cloud *azure.Environment,
|
|
|
|
|
cloud *azure.Environment, SharedGalleryTimeout time.Duration,
|
|
|
|
|
servicePrincipalToken, servicePrincipalTokenVault *adal.ServicePrincipalToken) (*AzureClient, error) {
|
|
|
|
|
|
|
|
|
|
var azureClient = &AzureClient{}
|
|
|
|
|
@ -210,6 +211,7 @@ func NewAzureClient(subscriptionID, resourceGroupName, storageAccountName string
|
|
|
|
|
azureClient.GalleryImageVersionsClient.RequestInspector = withInspection(maxlen)
|
|
|
|
|
azureClient.GalleryImageVersionsClient.ResponseInspector = byConcatDecorators(byInspecting(maxlen), errorCapture(azureClient))
|
|
|
|
|
azureClient.GalleryImageVersionsClient.UserAgent = fmt.Sprintf("%s %s", useragent.String(), azureClient.GalleryImageVersionsClient.UserAgent)
|
|
|
|
|
azureClient.GalleryImageVersionsClient.Client.PollingDuration = SharedGalleryTimeout
|
|
|
|
|
|
|
|
|
|
azureClient.GalleryImagesClient = newCompute.NewGalleryImagesClientWithBaseURI(cloud.ResourceManagerEndpoint, subscriptionID)
|
|
|
|
|
azureClient.GalleryImagesClient.Authorizer = autorest.NewBearerAuthorizer(servicePrincipalToken)
|
|
|
|
|
|