API Management - Can you import from Swagger JSON that requires HTTP Header records?

Neil McAlister 291 Reputation points
2023-01-30T09:21:54.7266667+00:00

Using API Management - can I import from a Swagger JSON file definition AND where that endpoint requires the following injection to a header so that it can call/retrieve that Swagger JSON?

The API in question is actually an Azure Machine Learning Online Endpoint - and that contains a Swagger JSON definition. In order to see the definition you have to inject the following header records into the HTTP call...

Authorization: Bearer longRandomtokengeneratedbyAML12345
azureml-model-deployment: nameofmyamlmodeldendpointdeployment

Using API Management - can I somehow import this Swagger JSON ? I can't find a way to reach the endpoint and specify the x2 header records it requires

Thanks

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,291 questions
Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,124 questions
{count} votes

Accepted answer
  1. MuthuKumaranMurugaachari-MSFT 22,401 Reputation points
    2023-02-01T01:43:56.6766667+00:00

    @Neil McAlister Thanks for posting it in Microsoft Q&A. Based on the statement above, it looks like you are importing Swagger JSON to APIM via portal, CLI or PowerShell with specification URL, correct?

    If so, unfortunately that's not possible right now. There is no way to specify headers with --specification-url in az apim api import (or Import-AzApiManagementApi - PowerShell) and you would need to download swagger JSON in your pipeline and then use it with --specification-path(check size limitation when using this parameter here) or place it in another location where APIM can directly access it.

    If you are interested in this feature and like to submit feedback to our product team, please submit it via https://aka.ms/apimwish and would help our product team to prioritize the features. Also, others with similar interests can upvote it too.

    Feel free to reach out if you have any other questions.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.