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

Fix the GetConfig of azure_app_service_web_app_slot table to correctly return data instead of an empty row #654

Merged
merged 1 commit into from
Aug 17, 2023
Merged
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
18 changes: 5 additions & 13 deletions azure/table_azure_app_service_web_app_slot.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func tableAzureAppServiceWebAppSlot(_ context.Context) *plugin.Table {
Name: "name",
Description: "Resource Name.",
Type: proto.ColumnType_STRING,
Transform: transform.FromField("Name").Transform(lastPathElement),
},
{
Name: "app_name",
Expand Down Expand Up @@ -438,20 +439,11 @@ func getAppServiceWebAppSlot(ctx context.Context, d *plugin.QueryData, h *plugin

func getConfigurationSlot(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
plugin.Logger(ctx).Debug("getConfigurationSlot")
var appName, resourceGroupName, slotName string
if h.Item != nil {
data := h.Item.(*SlotInfo)
appName = *data.AppName
slotName = *data.Name
resourceGroupName = *data.SiteProperties.ResourceGroup
} else {
return nil, nil
}

// Restrict the API call for other apps if the app name is specified in the query paramater
if d.EqualsQualString("app_name") != "" && d.EqualsQualString("app_name") != appName {
return nil, nil
}
data := h.Item.(*SlotInfo)
appName := *data.AppName
slotName := *data.Name
resourceGroupName := *data.SiteProperties.ResourceGroup

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