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

[BUG] Publisher gets 400 from Azure #719

Open
saqwel opened this issue Jan 7, 2025 · 2 comments
Open

[BUG] Publisher gets 400 from Azure #719

saqwel opened this issue Jan 7, 2025 · 2 comments

Comments

@saqwel
Copy link

saqwel commented Jan 7, 2025

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.

Copy link

github-actions bot commented Jan 7, 2025

  Thank you for opening this issue! Please be patient while we will look into it and get back to you as this is an open source project. In the meantime make sure you take a look at the [closed issues](https://github.com/Azure/apiops/issues?q=is%3Aissue+is%3Aclosed) in case your question has already been answered. Don't forget to provide any additional information if needed (e.g. scrubbed logs, detailed feature requests,etc.).
  Whenever it's feasible, please don't hesitate to send a Pull Request (PR) our way. We'd greatly appreciate it, and we'll gladly assess and incorporate your changes.

@saqwel saqwel changed the title [BUG] Publisher returns 400 [BUG] Publisher gets 400 from Azure Jan 7, 2025
@saqwel
Copy link
Author

saqwel commented Jan 9, 2025

Could you help with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant