简体   繁体   中英

Azure API Management with Service Fabric

Problem:

I want to setup a CI/CD where whenever I publish changes to my SF API, it automatically updates the endpoints of the API in the Azure API Management instance.

How do I plan on doing that?

I push changes to my GitHub repo, it is built, and it gets deployed. Second step in the release is a PowerShell script which updates an existing Azure APIM API with the Swagger doc of the newly deployed SF API.

Whats the problem?

Well, you can't pass through the gateway unless you have an endpoint defined in the Azure APIM API. I can define a Swagger endpoint there by default, but whenever the PowerShell update is run, it'll remove that endpoint because the Swagger generated does not have itself in it, which is totally logical.

If I expose the Swagger endpoint without the gateway somehow, that posses a security threat, and kind of kills the purpose of Azure APIM gateway.

My Setup?

Incoming Request -> Azure APIM -> Service Fabric App (Public/Internal)

  • Internal SF Apps will ideally not be exposed through the gateway and are only used for inter app communication.

Any help in this regard is highly appreciated since I am kind of blocked on this :-)

You could create a separate API in APIM just to access swagger AT SF side and don't update this API as a part of CI/CD. If may even be made to look from outside as a part of said API. For example if your main API has suffix of "/myApi", then you swagger API suffix may be defined as "/myApi/swagger.json" (operation inside it may have empty URL template).

Or you could as a part of you CI/CD recreate swagger access operation inside newly imported API. This endpoint will be used later to fetch swagger for next import.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM