Azure / apiops

APIOps applies the concepts of GitOps and DevOps to API deployment. By using practices from these two methodologies, APIOps can enable everyone involved in the lifecycle of API design, development, and deployment with self-service and automated tools to ensure the quality of the specifications and APIs that they’re building.
https://azure.github.io/apiops
MIT License
312 stars 182 forks source link

Extractor fails if using APIM Consumption Tier #561

Open karlrissland opened 3 months ago

karlrissland commented 3 months ago

Release version

v6.0.0-alpha.1.0.8

Describe the bug

Trying to run the default extractor from github against a consumption tier APIM instance. Both full extract and extracting with the config.yaml file fail. Same github workflow works when used against a non-consumption APIM instance.

log attached

logs_24558813652.zip

Expected behavior

it completes as expected

Actual behavior

An error is thrown somewhere in the C# image

Reproduction Steps

  1. Spin up a consumption tier instance of APIM
  2. Follow the instructions in the WIKI to get the extractor tool working in GitHub
  3. Run the workflow to extract without the config yaml file and note the error
  4. Run the workflow again to extract with the config yaml file and note the error
github-actions[bot] commented 3 months ago
  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.
guythetechie commented 2 months ago

Can you include the pipeline logs? The screenshot doesn't show the full error message.

automachina commented 1 month ago

I have the same issue and it appears to be caused by the Product Group extraction because Product Groups are not supported in the Consumption tier. The same error occurs in the publisher when it tries to push Product Groups (even though there's no Product Group artifacts in the repo) to a Consumption tier APIM instance.

Extractor Log:

info: extractor[0]
      Extracting groups for product advertising-services...
trce: HttpPipeline[0]
      Starting request
      Method: GET
      Uri: https://management.azure.com/subscriptions/***/resourceGroups/apim-dev/providers/Microsoft.ApiManagement/service/apim-dev/products/advertising-services/groups?api-version=2023-09-01-preview
      Content: <null>
trce: HttpPipeline[0]
      Starting request
      Method: GET
      Uri: https://management.azure.com/subscriptions/***/resourceGroups/apim-dev/providers/Microsoft.ApiManagement/service/apim-dev/products/api-gateway/groups?api-version=2023-09-01-preview
      Content: <null>
trce: HttpPipeline[0]
      Received response
      Method: GET
      Uri: https://management.azure.com/subscriptions/***/resourceGroups/apim-dev/providers/Microsoft.ApiManagement/service/apim-dev/products/api-gateway/groups?api-version=2023-09-01-preview
      Status code: 400
      Duration (hh:mm:ss): 00:00:00.2066050
      Content: {"error":{"code":"MethodNotAllowedInPricingTier","message":"Method not allowed in Consumption pricing tier","details":null}}
trce: HttpPipeline[0]
      Received response
      Method: GET
      Uri: https://management.azure.com/subscriptions/***/resourceGroups/apim-dev/providers/Microsoft.ApiManagement/service/apim-dev/products/advertising-services/groups?api-version=2023-09-01-preview
      Status code: 400
      Duration (hh:mm:ss): 00:00:00.5017768
      Content: {"error":{"code":"MethodNotAllowedInPricingTier","message":"Method not allowed in Consumption pricing tier","details":null}}