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 apic service returns 400 Bad Request when importing APIs from APIM #36

Open
aw230012 opened this issue Mar 7, 2024 · 3 comments
Open
Assignees
Labels
Solution provided Indicated that a fix has been proposed or implemented for the issue.

Comments

@aw230012
Copy link

aw230012 commented Mar 7, 2024

Description

When trying to import APIs from an APIM instance into APIC using Azure CLI's az apic import-from-apim command in PowerShell, the result is always a 4000 BAD REQUEST with an error Object reference not set to an instance of an object. I just installed the extension today to work with apic, so it should be a newer version.

Reproduction steps

Steps to reproduce the behavior:

  1. Retrieve the APIM ID
  2. Concatenate "/apis/*" to the end of the APIM ID into a new var $apiIDs
  3. Execute the command az apic service import-from-apim --service-name <service name> --resource-group <rg-name> --source-resource-ids $apiIDs

Expected behavior

The APIs should import.

Actual behavior

Always receive a 400 BAD REQUEST with an "Object reference not set to an instance of an object" error.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Just installed the APIC extension today, so the version is newer. Followed the examples in the APIC import from APIM Microsoft Documentation.

@juliajuju93
Copy link
Contributor

@aw230012, have you configured your managed identity correctly? Could you please clarify if you followed all the steps here?

https://learn.microsoft.com/en-us/azure/api-center/import-api-management-apis?tabs=portal#add-a-managed-identity-in-your-api-center

@aw230012
Copy link
Author

@aw230012, have you configured your managed identity correctly? Could you please clarify if you followed all the steps here?

https://learn.microsoft.com/en-us/azure/api-center/import-api-management-apis?tabs=portal#add-a-managed-identity-in-your-api-center

Yes I did verify the managed identity is correct. I am able to import the APIs one at a time. I only receive the 400 BAD REQUEST when trying to do the wildcard import as shown in the documentation.

@juliajuju93
Copy link
Contributor

@aw230012 :

We recently released a new CLI extension version with updated functionalities, resolving some of the bugs you mentioned. Could you please run this again and let us know if it worked this time.

@juliajuju93 juliajuju93 added Solution provided Indicated that a fix has been proposed or implemented for the issue. and removed Bug Untriaged labels May 15, 2024
@juliajuju93 juliajuju93 self-assigned this May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Solution provided Indicated that a fix has been proposed or implemented for the issue.
Projects
None yet
Development

No branches or pull requests

2 participants