Skip to content

Commit

Permalink
Merge pull request #3857 from terraform-providers/f/storage-containers
Browse files Browse the repository at this point in the history
r/storage_containers: switching to use the new SDK / support for `metadata`
  • Loading branch information
tombuildsstuff committed Jul 17, 2019
2 parents 94907ca + e26c7ef commit 1c556d0
Show file tree
Hide file tree
Showing 24 changed files with 1,877 additions and 364 deletions.
13 changes: 13 additions & 0 deletions azurerm/internal/services/storage/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/authorizers"
"github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs"
"github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/containers"
"github.com/tombuildsstuff/giovanni/storage/2018-11-09/file/directories"
"github.com/tombuildsstuff/giovanni/storage/2018-11-09/file/shares"
"github.com/tombuildsstuff/giovanni/storage/2018-11-09/queue/queues"
Expand Down Expand Up @@ -73,6 +74,18 @@ func (client Client) BlobsClient(ctx context.Context, resourceGroup, accountName
return &blobsClient, nil
}

func (client Client) ContainersClient(ctx context.Context, resourceGroup, accountName string) (*containers.Client, error) {
accountKey, err := client.findAccountKey(ctx, resourceGroup, accountName)
if err != nil {
return nil, fmt.Errorf("Error retrieving Account Key: %s", err)
}

storageAuth := authorizers.NewSharedKeyLiteAuthorizer(accountName, *accountKey)
containersClient := containers.New()
containersClient.Client.Authorizer = storageAuth
return &containersClient, nil
}

func (client Client) FileShareDirectoriesClient(ctx context.Context, resourceGroup, accountName string) (*directories.Client, error) {
accountKey, err := client.findAccountKey(ctx, resourceGroup, accountName)
if err != nil {
Expand Down
Loading

0 comments on commit 1c556d0

Please sign in to comment.