Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added check for storage type FileStorage where blob is not supported in storage tables. #418

Merged
merged 1 commit into from
Jan 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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