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

BeginInstallSiteExtension and BeginInstallSiteExtensionSlot Return 400 Bad Request Without Error Code or Response Body #23516

Open
Sylfwood opened this issue Sep 27, 2024 · 1 comment
Labels
App Services customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@Sylfwood
Copy link

Sylfwood commented Sep 27, 2024

Bug Report

package: github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice

SDK version: V4 (the error is also present in V2 and V3 versions)

Output of go version: go version go1.22.4 darwin/arm64


The functions BeginInstallSiteExtension and BeginInstallSiteExtensionSlot from WebAppsClient return a status code 400 Bad Request without an error code and no response body when attempting to install a site extension:

unable to initiate installation of site extension: PUT https://management.azure.com/subscriptions/********-****-****-****-************/resourceGroups/*****/providers/Microsoft.Web/sites/*****/siteextensions/Datadog.AzureAppServices.DotNet

--------------------------------------------------------------------------------
RESPONSE 400: 400 Bad Request
ERROR CODE UNAVAILABLE
--------------------------------------------------------------------------------
Response contained no body
--------------------------------------------------------------------------------

FAIL

I expected the client to successfully initiate the installation of the site extension without errors. Alternatively, if there is an error, I expected a detailed error message with an error code and response body to help diagnose the issue. Notably, the DeleteSiteExtension and DeleteSiteExtensionSlot functions return an error with status code 200... I can parse the ResponseError to check the StatusCode, but not ideal.

Here's a snippet of the code that reproduces the issue:

package azure

import (
    "fmt"

    "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
    
    armappserviceV4 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice/v4"
)

type WebAppsClient struct {
    inner armappserviceV4.WebAppsClient
}

type SupportedSiteExtension string

const (
    DatadogAzureAppServicesNodeApm   SupportedSiteExtension = "Datadog.AzureAppServices.Node.Apm"
    DatadogAzureAppServicesDotNetApm SupportedSiteExtension = "Datadog.AzureAppServices.DotNet"
)

func (w *WebAppsClient) InstallProductionSlotSiteExtension(resourceGroup string, appServiceName string, extension SupportedSiteExtension) error {
    extensionName := string(extension)

    poller, err := w.inner.BeginInstallSiteExtension(ctx, resourceGroup, appServiceName, extensionName, nil)
    if err != nil {
        return fmt.Errorf("unable to initiate installation of site extension: %w", err)
    }

    _, err = poller.PollUntilDone(ctx, nil)
    if err != nil {
        return fmt.Errorf("error while installing site extension: %w", err)
    }

    return nil
}

If you need any more details, please let me know.

@github-actions github-actions bot added App Services customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. labels Sep 27, 2024
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @antcp @AzureAppServiceCLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App Services customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

1 participant