Reputation: 166
I'm putting the final pieces together on deploying a bunch of APIs through API Management.
I have a number of App and Logic App backends that are combined in API Management. Reverse engineering an ARM template from the portal suggests I have to write out each and every operation by hand to create the operations vi Bicep.
Is there a way, that like the portal, I can instruct ARM to use the OpenAPI specification generated automatically by the backend Apps and Logic Apps to automatically populate the operations?
Given the variety of operational paths, I feel like I'm going to be here all week typing them out as the variance is too much to have a loop.
Upvotes: 2
Views: 2828
Reputation: 425
Here is an example on how I used OpenAPI for populating APIM Gateway. I passed the OpenAPI spec converted to single line into the Value field and set the format field to openapi+json. Here is an example
resource ImportedOpenapi 'Microsoft.ApiManagement/service/apis@2021-12-01-preview' = {
parent: apimservicesymbolicname
name: 'ImportOpenApi'
properties: {
name: 'MyTestAPI'
apiType: 'http'
contact: {
email: '[email protected]'
name: 'test'
}
format: 'openapi+json'
path: 'myapi'
protocols: [
'https'
]
isCurrent: true
subscriptionRequired: true
type: 'http'
value: '{"openapi":"3.0.1","info":{"title":"MyApi","contact":{},"version":"1.0"},"servers":[{"url":"https://xyz.api"}],"paths":...'
}
}
Upvotes: 4