We are using Swashbuckle (v 3.2.2) to generate Swagger (OpenAPI) document for Azure Function Apps (v3). We are able to import Azure Function App in APIM using below PowerShell script:
$specificationUrl="https://myfunctionapp.azurewebsites.net/api/swagger/json?code=tdkaksas8393dkkfkr04kfkkfkf9933kk9=="
$apiContext = New-AzApiManagementContext -ResourceGroupName "MyResourceGroup" -ServiceName "MyServiceName"
Import-AzApiManagementApi -Context $apiContext -SpecificationFormat "OpenApi" -SpecificationUrl $specificationUrl -Path apis
The issue is Azure function app is not getting imported with correct setting in APIM. Imported operation's Backend Target type should be "Azure Resource" but Target type getting set to "HTTP(s) endpoint". Apart from this we are even not getting "Azure Resource" as option instead it shows "Azure Logic App". When we do manually it shows correct Backend Target i.e. "Azure Resource". Pls refer screenshot here for details.
We are using Swashbuckle version 3.2.2 Swashbuckle and referred this link for implementation of Swagger(OpenAPI) for Azure Functions.