Skip to content

Commit

Permalink
Added check for storage type FileStorage where blob is not supported …
Browse files Browse the repository at this point in the history
…in storage tables. (#418)
  • Loading branch information
bigdatasourav authored Jan 5, 2022
1 parent d5e47e0 commit a152183
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 0 deletions.
10 changes: 10 additions & 0 deletions azure/table_azure_storage_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,11 @@ func getAzureStorageAccountLifecycleManagementPolicy(ctx context.Context, d *plu
func getAzureStorageAccountBlobProperties(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
accountData := h.Item.(*storageAccountInfo)

// Blob is not supported for the account if storage type is FileStorage
if accountData.Account.Kind == "FileStorage" {
return nil, nil
}

session, err := GetNewSession(ctx, d, "MANAGEMENT")
if err != nil {
return nil, err
Expand Down Expand Up @@ -593,6 +598,11 @@ func listAzureStorageAccountEncryptionScope(ctx context.Context, d *plugin.Query
func getAzureStorageAccountBlobServiceLogging(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
accountData := h.Item.(*storageAccountInfo)

// Blob is not supported for the account if storage type is FileStorage
if accountData.Account.Kind == "FileStorage" {
return nil, nil
}

// Create session
session, err := GetNewSession(ctx, d, "MANAGEMENT")
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions azure/table_azure_storage_blob_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ func listStorageBlobServices(ctx context.Context, d *plugin.QueryData, h *plugin
// Get the details of storage account
account := h.Item.(*storageAccountInfo)

// Blob is not supported for the account if storage type is FileStorage
if account.Account.Kind == "FileStorage" {
return nil, nil
}

session, err := GetNewSession(ctx, d, "MANAGEMENT")
if err != nil {
return nil, err
Expand Down
5 changes: 5 additions & 0 deletions azure/table_azure_storage_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ func listStorageContainers(ctx context.Context, d *plugin.QueryData, h *plugin.H
// Get the details of storage account
account := h.Item.(*storageAccountInfo)

// Blob is not supported for the account if storage type is FileStorage
if account.Account.Kind == "FileStorage" {
return nil, nil
}

// Create session
session, err := GetNewSession(ctx, d, "MANAGEMENT")
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions azure/table_azure_storage_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ func listStorageQueues(ctx context.Context, d *plugin.QueryData, h *plugin.Hydra
// Get the details of storage account
account := h.Item.(*storageAccountInfo)

// Queue is not supported for the account if storage type is FileStorage
if account.Account.Kind == "FileStorage" {
return nil, nil
}

session, err := GetNewSession(ctx, d, "MANAGEMENT")
if err != nil {
return nil, err
Expand Down
5 changes: 5 additions & 0 deletions azure/table_azure_storage_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ func listStorageTables(ctx context.Context, d *plugin.QueryData, h *plugin.Hydra
// Get the details of storage account
account := h.Item.(*storageAccountInfo)

// Table is not supported for the account if storage type is FileStorage
if account.Account.Kind == "FileStorage" {
return nil, nil
}

session, err := GetNewSession(ctx, d, "MANAGEMENT")
if err != nil {
return nil, err
Expand Down
5 changes: 5 additions & 0 deletions azure/table_azure_storage_table_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ func listStorageTableServices(ctx context.Context, d *plugin.QueryData, h *plugi
// Get the details of storage account
account := h.Item.(*storageAccountInfo)

// Table is not supported for the account if storage type is FileStorage
if account.Account.Kind == "FileStorage" {
return nil, nil
}

session, err := GetNewSession(ctx, d, "MANAGEMENT")
if err != nil {
return nil, err
Expand Down

0 comments on commit a152183

Please sign in to comment.