microsoft / Low-Code

Website to showcase Low-Code content and community initiatives to help developers explore low code and fusion development with Microsoft Cloud and Developer Tools
https://aka.ms/lowcode-february
MIT License
167 stars 41 forks source link

Having an issue integrating the Web API that we created from previous learning module - into Azure API Management #25

Closed Gakinchi closed 1 year ago

Gakinchi commented 1 year ago

Submitted By

gakinchi

Your Role

What is your role in this learning context? Professional Developer


For Product

What do you have feedback on?

  • Swashbuckle Open API Web application
  • Azure API Management integration

https://learn.microsoft.com/en-us/training/modules/integrate-openapi-enabled-web-api-with-apim-and-visual-studio/6-exercise-integrate-web-api-with-azure-api-management

related to the February lowcode cloudskill challenge 2023


Description

Bug Report`: Having an issue integrating the Web API that we created from previous learning module - into Azure API Management.


Details

First of, apologies in advance if this is an inappropriate channel to ask for help, but I was unable to find a way to reach out from the Microsoft Learn itself...

The Azure App Service API works all fine when published without any connection to Azure API Management, but as a connection is established from my Visual Studio, it complains when it hits the integration update to Azure API Management when I Re-publish.

The error causes some failure when using Azure API Management. It creates the resource groups and an API with empty operations.

I've been trying to look for some answers online, but I keep getting the same error (tried to redo the learning steps twice yesterday and then rewinding again three times today - without any luck unfortunately)...

I've added a couple of screenshots to compliment the error description: vs-hitting-publish-error-popup tmp-file-as-screenshot

This is the error from Visual Studio after Publishing:

Publish has encountered an error. Be sure that the Startup.cs for your application is calling AddSwaggerGen from within ConfigureServices in order to generate swagger file. Visit https://go.microsoft.com/fwlink/?LinkId=2131205&CLCID=0x409 for more information.

A diagnostic log has been written to the following location: "C:\Users\gchi\AppData\Local\Temp\tmp3891.tmp"


Things I've tried:

Followed the steps exactly as is with referred outdated Swashbuckle NuGet version from the learning guide Followed the steps exactly with updated/newest Swashbuckle NuGet version instead from scratch. Checked for information for the related error message... Tried to DuckDuckGo it:

Gakinchi commented 1 year ago

I've made a temporary workaround and just imported the API application published as app service in Azure, and used swaggers.json payload from the swagger site, and added it to the Azure API Management manually.

But would appreciate if someone from the Team could have a look with the co-creators of the learning materials about why this is happening from Visual Studio's publishing method.

Best regards, Ga Kin Chi

justinyoo commented 1 year ago

@Gakinchi Thanks for the issue! We suspected that the sample app was a bit of outdated (using .NET 5), and that would cause the issue. We've updated the sample app to use .NET 7, and it worked OK. If you still have an issue, please let us know how to reproduce the error, and we'll check that out on our ends.