Azure / Azure/apiops

[BUG] Removing Backend credentials not working

Offen
#749 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C#
Sterne
448
Forks
247
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Release version

APIOps latest

### Describe the bug

We want to remove the credentials from a backend configuration while puclishing.
So when overwritting the configuration, we set the array to empty for both certificate and certificateIds.

The configuration is set as follows:
```
backends:
- name: "my-backend"
properties:
url: "https://example.com"
credentials:
certificate: []
certificateIds: []
```

However, we still get the error of missing certificate when we try to publish this without the certificate.

### Expected behavior

Backend created without any credentials and errors

### Actual behavior

We are getting validation error.

```
crit: Publisher[0]
System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/***/resourceGroups/***/providers/Microsoft.ApiManagement/service/***/backends/my-backend?api-version=2022-04-01-preview failed with status code 400. Content is '{"error":{"code":"ValidationError","message":"One or more fields contain incorrect values:","details":[{"code":"ValidationError","target":"credentials","message":"Certificate with id 'my-cert' not found."}]}}'.
at common.HttpPipelineExtensions.Validate(Response response, Uri requestUri)
at common.HttpPipelineExtensions.PutResource(HttpPipeline pipeline, Uri uri, JsonObject resource, CancellationToken cancellationToken)
at publisher.Program.<>c__DisplayClass12_0.<b__0>d.MoveNext()

```

### Reproduction Steps

Create a backend with certificate credentials.

and try to publish a new one without certificate credentials.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, den Backend-PUT-Request in publisher.Program und die an den Backends-Endpunkt von Azure API Management gesendeten Credential-Payload nachzuverfolgen. Reproduziere das Update von Zertifikat auf leere Credentials und verifiziere, dass die Veröffentlichung erfolgreich ist, ohne das alte Zertifikat beizubehalten oder den Validierungsfehler zurückzugeben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
azure, csharp
Bereich
api, backend, cloud
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.