| 1 | ## Blob Storage Account SDK for API version 2019-12-12 |
| 2 | |
| 3 | This package allows you to interact with the Accounts Blob Storage API |
| 4 | |
| 5 | ### Supported Authorizers |
| 6 | |
| 7 | * Azure Active Directory |
| 8 | |
| 9 | ### Example Usage |
| 10 | |
| 11 | ```go |
| 12 | package main |
| 13 | |
| 14 | import ( |
| 15 | "context" |
| 16 | "fmt" |
| 17 | "time" |
| 18 | |
| 19 | "github.com/Azure/go-autorest/autorest" |
| 20 | "github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts" |
| 21 | ) |
| 22 | |
| 23 | func Example() error { |
| 24 | accountName := "storageaccount1" |
| 25 | |
| 26 | // e.g. https://github.com/tombuildsstuff/giovanni/blob/76f5f686c99ecdcc3fa533a0330d0e1aacb1c327/example/azuread-auth/main.go#L54 |
| 27 | client, err := buildClient() |
| 28 | if err != nil { |
| 29 | return fmt.Errorf("error building client: %s", err) |
| 30 | } |
| 31 | |
| 32 | ctx := context.TODO() |
| 33 | |
| 34 | input := StorageServiceProperties{ |
| 35 | StaticWebsite: &StaticWebsite{ |
| 36 | Enabled: true, |
| 37 | IndexDocument: index, |
| 38 | ErrorDocument404Path: errorDocument, |
| 39 | }, |
| 40 | } |
| 41 | |
| 42 | _, err = client.SetServiceProperties(ctx, accountName, input) |
| 43 | if err != nil { |
| 44 | return fmt.Errorf("error setting properties: %s", err) |
| 45 | } |
| 46 | |
| 47 | time.Sleep(2 * time.Second) |
| 48 | |
| 49 | _, err = accountsClient.GetServiceProperties(ctx, accountName) |
| 50 | if err != nil { |
| 51 | return fmt.Errorf("error getting properties: %s", err) |
| 52 | } |
| 53 | |
| 54 | return nil |
| 55 | } |
| 56 | |
| 57 | ``` |