microsoft / azure-container-apps

Roadmap and issues for Azure Container Apps
MIT License
355 stars 27 forks source link

Error when attempting to delete an Azure Container Apps Source Controls configuration via REST API #1191

Open fa-bwilliams opened 2 weeks ago

fa-bwilliams commented 2 weeks ago

Please provide us with the following information:

This issue is a: (mark with an x)

Issue description

When using the REST API to delete (verb) and existing Container Apps Source Controls configuration, per this documentation, I receive the following error:

{
    "error": {
        "code": "MissingAuthorizationToken",
        "message": "Can not find github access token from header."
    }
}

I originally recived the same error when trying to destroy Pulumi configuration where using this. I then tried the Microsoft REST API natively and received the same error, indicating that it is an issue with the Microsoft API and not Pulumi.

Steps to reproduce

  1. Have a working source control configuration configured for your Azure Container App.
  2. Use this documentation to attempt to delete that source control configuration.

Expected behavior To successfully delete the source control configuration.

Actual behavior Error as previously described.

howang-ms commented 1 week ago

Hi @fa-bwilliams Apologize that the document doesn't include all the details. We will update the document with more details. For Source Control REST API call, it will require a addtional header x-ms-github-auxiliary to pass in the Github token. If you are using the C# SDK, you can inject the header with some code like:

var httpClient = new HttpClient();
var armClientOptions = new ArmClientOptions();

httpClient.DefaultRequestHeaders.Add("x-ms-github-auxiliary", githubCredential);
armClientOptions.Transport = new HttpClientTransport(httpClient);
var armclient = new ArmClient(azureCredential, subsId, armClientOptions);