[BUG] Publisher gets 400 from Azure
- Lingua principale
- C#
- Stelle
- 448
- Fork
- 247
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
### Release version
v6.0.1.3
### Describe the bug
I already have configuration of APIM in my GitHub repo collected by v5 of ApiOps. I extract everything successfully using v6.0.1.3. It created a few not essential changes related to a version (e.g. changed order of parameters in json). So almost the same configuration was published by v5 of ApiOps successfully. When I run publisher v6 it can't complete PUT operation. As you can see in log below publisher excludes "displayName" property from "Content". I tried to run the same API request manually and it actually does not work. It works only if we have "displayName" property in Content of request.
This is description of named value:
{
"properties": {
"displayName": "TestNamedValue",
"secret": false,
"tags": [],
"value": "some_value"
}
}
This is log:
Starting request
Method: PUT
Uri: https://management.azure.com/subscriptions/***/resourceGroups/***/providers/Microsoft.ApiManagement/service/***/namedValues/TestNamedValue?api-version=2023-09-01-preview
Content: {"properties":{"secret":false,"tags":[],"value":"some_value"}}
trce: HttpPipeline[0]
Received response
Method: PUT
Uri: https://management.azure.com/subscriptions/***/resourceGroups/***/providers/Microsoft.ApiManagement/service/***/namedValues/TestNamedValue?api-version=2023-09-01-preview
Status code: 400
Duration (hh:mm:ss): 00:00:00.5015046
Content: {"error":{"code":"ValidationError","message":"One or more fields contain incorrect values:","details":[{"code":"ValidationError","target":"name","message":"NamedValue (display name) should be between 1 and 256 characters long."}]}}
crit: publisher[0]
Application failed.
System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/***/resourceGroups/***/providers/Microsoft.ApiManagement/service/***/namedValues/TestNamedValue?api-version=2023-09-01-preview failed with status code 400. Content is '{"error":{"code":"ValidationError","message":"One or more fields contain incorrect values:","details":[{"code":"ValidationError","target":"name","message":"NamedValue (display name) should be between 1 and 256 characters long."}]}}'.
### Expected behavior
Expected successful publishing
### Actual behavior
'{"error":{"code":"ValidationError","message":"One or more fields contain incorrect values:","details":[{"code":"ValidationError","target":"name","message":"NamedValue (display name) should be between 1 and 256 characters long."}]}}'.
### Reproduction Steps
Extract configuration of Named Values.
Publish extracted configuration.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia riproducendo il flusso di named-value: estrai la configurazione, quindi pubblica la configurazione estratta con v6. Confronta il contenuto della richiesta PUT con quello della richiesta manuale funzionante dell'issue e considera l'issue completata quando Azure accetta la richiesta e la pubblicazione viene completata correttamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, csharp
- Ambito
- api, cloud
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100