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] Error "Not valid api-version" while publishing named values #484

Closed
marcovanluyk opened this issue Feb 20, 2024 · 9 comments
Closed
Assignees
Labels
question Further information is requested

Comments

@marcovanluyk
Copy link

marcovanluyk commented Feb 20, 2024

Release version

APIOPS 5.1.1

Describe the bug

During the publishing process (Publishing to UAT environment) of named values we got the following exception:

System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/***/resourceGroups/providers/Microsoft.ApiManagement/service/namedValues/xxxxxxx?api-version=2022-04-01-preview failed with status code 400. Content is '{"error":{"code":"InvalidApiVersionParameter","message":"The api-version '2022-04-01-preview' is invalid.

I edited the publisher files and used the ARM_API_VERSION parameter but it didn't work.

Expected behavior

Pipeline will publish the artifacts.

Actual behavior

Error.

Reproduction Steps

Run Pipeline based on publisher.yaml file.

Copy link

  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.

@waelkdouh waelkdouh added the question Further information is requested label Feb 20, 2024
@guythetechie
Copy link
Contributor

I'm not able to reproduce this. Your URL looks off; you have https://management.azure.com/subscriptions/***/resourceGroups/providers/Microsoft.ApiManagement/service/namedValues/xxxxxxx?api-version=2022-04-01-preview, but it's missing a service name. Should be Microsoft.ApiManagement/service/yourapiminstancename/namedValues/xxxxxxx?api-version=2022-04-01-preview.

Can you make sure you've set the APIM instance name correctly for that environment? Should be coming from apimServiceName or API_MANAGEMENT_SERVICE_NAME in configuration.

@marcovanluyk
Copy link
Author

Thanks for your fast reply. I checked it again and now I get the same error withe the APIM instance:

https://management.azure.com/subscriptions/***/resourceGroups/providers/Microsoft.ApiManagement/service/xxxxxxxapis-uat-xxx/namedValues/xxxxdata-url?api-version=2022-04-01-preview failed with status code 400. Content is '{"error":{"code":"InvalidApiVersionParameter","message":"The api-version '2022-04-01-preview' is invalid.

I have really no idea what is going wrong....! :-(

@guythetechie
Copy link
Contributor

You're also missing a resource group name in your URL. Should look like this:

https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}?api-version={api-version}.

The subscription, resource group, and service name all come from environment variables you've configured in your pipeline.

@marcovanluyk
Copy link
Author

Yeah, I think the main issue is solved. But now I got an error with the logge (app insights):

I have one subscription with 3 ressource groups:
1 RG for dev
1 RG for uat
1 RG for monitoring (logger) --> dev/uat should use the same instance

System.Net.Http.HttpRequestException: HTTP request to URI https://management.azure.com/subscriptions/***/resourceGroups/API-Management-uat-rg/providers/Microsoft.ApiManagement/service/xxxapis-uat-apim/loggers/xxxapis-appi?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":"One or more Properties ['{0}'] specified are missing.","message":"Logger-Credentials--65d6107b46346125c8xxxxxx"}]}}'.
at common.HttpPipelineExtensions.Validate(Response response, Uri requestUri)

How can I handle this conflict?

@waelkdouh
Copy link
Contributor

It means you are not overriding the logger details correctly. Please search closed issues that have addressed this same topic in the past.

@marcovanluyk
Copy link
Author

OK-I will search for it thanks....

@waelkdouh
Copy link
Contributor

Welcome. Please close the issue when you get a chance.

@marcovanluyk
Copy link
Author

It is working!

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

No branches or pull requests

3 participants