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

az apim api import to existing API clears serviceUrl when the optional --service-url parameter isn't provided #29363

Open
markdebruijne opened this issue Jul 11, 2024 · 1 comment
Labels
API Management az apim Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.

Comments

@markdebruijne
Copy link

Describe the bug

az apim api import to existing API clears serviceUrl when the optional --service-url parameter isn't provided
Clearing/removing/blanking the serviceUrl property of an APIM API is a risk that the runtime breaks down.

Related command

az apim api import

Errors

N/A

Issue script & Debug output

az apim api import 
  --service-name apim-something-weu 
  --resource-group rg-something-weu 
  --path /ecommerce 
  --specification-format OpenApiJson 
  --specification-path C:\something\ecommerce.json 
  --api-id ecommerce-v1 
  --api-version v1 
  --api-version-set-id 'ecommerce' 
  --description "sinterklaas" 
  --display-name eCommerce

Expected behavior

Ensure properties that are not provided, as they are (intentionally) optional, won't be changed via the resulting resource provider deployment.

Environment Summary

azure-cli                         2.62.0

core                              2.62.0
telemetry                          1.1.0

Extensions:
azure-devops                       1.0.0
maintenance                        1.6.0

Dependencies:
msal                              1.28.1
azure-mgmt-resource               23.1.1

Additional context

We aim to have this split

  • APIM configuration via BICEP infra templates
    • including API definition (paths, API level policies), (API) Products, subscriptions and such
  • On the API solution (deploy-time pipeline) we take the OpenAPI spec, and (re)import the operations into the predefined APIM API

The serviceUrl is to be configured and maintained in the former, also to have an environment agnostic OpenAPI specification file. Currently that is impossible as I can't instruct the az apim api import to stay "hands of" the serviceUrl that was configured, and is no cleared as result, breaking the runtime and resulting into unavailability.

Can be reproduced via

  • Checking the serviceUrl of an API after az apim api list --resource-group rg-something-weu --service-name apim-something-weu
  • (re)import that API, without specifying a --service-url
  • Check again the serviceUrl of the same API, which is now converted into a null value.

The error directly after that

GatewayError:
   at forward-request

Backend service URL is not defined. 
@markdebruijne markdebruijne added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jul 11, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Jul 11, 2024

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Service Attention This issue is responsible by Azure service team. API Management az apim labels Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Management az apim Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

2 participants