Given that Azure Functions can be imported to API Management as described here, how do we keep the API up to date when Azure Functions change? For example, if the Function signature changes or a function is added or removed. How can this process be automated, so once the Azure Functions change, the changes are reflected in the API?
Microsoft's API Management team has a proposed solution here, but it's not clear to me how this solution can be applied with Azure Function App as the backed-end for the API.
Yes, you need to make it as part of your release process. After publishing the new version of Azure Functions, you'll import the new specification into API Management.
https://marketplace.visualstudio.com/items?itemName=stephane-eyskens.apim
Once you import and publish an API in APIM it will not be updated automatically. So, even though the developers released a new build, the consumers would still consume the older version of the API published in APIM.
Try to use Azure DevOps pipelines for continuous delivery of APIs to Azure API Management Service.
Add a create/update task, which will create or update the API in APIM based on the Swagger file and also set different API policies. This task will also update the API in APIM in case the Dev guy will create new API methods or remove API methods.
Related
I know that the Azure function supports HTTP trigger and we can write a function that can be exposed like an API. I'm looking for an option to host a complete C# WebAPI project (multiple Rest endpoints including swagger definition) into a single Azure function.
Is this feasible? and supported? I see this scenario is completely supported in AWS Lambda. Where we can deploy a whole WebAPI project into a single lambda. Here is the demo of
the same.
I have watched the provided Video and I observed the same functionality is also available in Azure Functions.
As Direct way is not available like publishing the Web API to the Functions but migration of Web API to Functions is possible if the Web API is authenticated with any option like Open API, etc and using the APIM Service we can manage all the operations in it.
And as per the Microsoft Update, Startup.csand program.cs is unified to the program.cs file. So, I have added the required swagger configuration code in the file program.cs and tested it, working successful locally.
Another approach is you can call the Web APIs from Azure Functions securely, here is one of my approaches along with few other ways to do it.
Refer to #VovaBilyachat alternative solution on publishing .NET Core Web API to Azure that provides the glimpse of using Containers instead Functions.
I'm creating a schedule-triggered Azure Function which will run tests once a day. If during the run any test fails, I want it to create a bug on a Azure DevOps project which includes a log of the failed tests.
I know I could create a PAT so that it can authenticates with the DevOps REST API but I don't like its downsides:
it can be valid for 1 year at maximum, I will need to remember to extend its expiration period
every bug created like this will have me as its creator
Edit:
I found out I could use a MS Flow - there's a DevOps connector that can create workitems, still it has a downside of having me as workitem's creator but it's not such a pain...
Still would much appreciate to learn about other options...
Is there any better way I can let my Azure Function to create bugs on my DevOps project?
An alternate option would be the use azure logic app along with azure function.
Here the azure function would directly call a azure logic app and the logic app would create a bug workitem .
Refer the following article by Stefan stranger
On how to create logic app which will create the bug. Here we will be using azure webhooks for the creating of bugs.
Now you can either send the data to a storage account where the logic app using some trigger to get the data and then use it to create bug, or you can directly connect to the logic app .
Refer the following article by Laura KokKarinen for this .
There is possibly an option to export the Mulesoft assets into OAS / RAML file, which can then be imported into Azure APIM.
But is it even possible to extract all the relevant API specifications like API, Operations, Policies etc. that is needed by Azure APIM to create APIs using the OAS file / url import ??
I'm trying to find a way to migrate from Mulesoft APIs to Azure APIM based administration, but didn't come across a proper way of doing it end to end yet.
Any directions would help.
OAS (OpenAPI Specification) can be included to Azure API Management by importing the definition file by downloading it from Mulesoft.
While migrating the API we need to make sure about API URL Suffix to our desired API Path.
Below are few steps from Azure APIM to add the OAS:
After creation of APIM, we can Add API.
We will be displayed with multiple options in adding the API like App Service, Function App, Logic App.
Refer to the blog for details steps in achieving the task of transforming API to Azure APIM.
I'm building a CI/CD pipeline to automatically deploy my application to azure. This include a webapp, and 2 REST API, running in 3 different App Services. This is working ok so far.
The only thing remaining in my solution is that I have an API management with my 2 REST API added. Those APIs are built in C#.
What I need to do, is to automatically update the swagger definition in Azure API gateway once the APIs are deployed.
I'm currently using this action https://github.com/solidify/github-action-update-azapim
But for some reason this is throwing an error in my json (the swagger file). which is incorrect, because the swagger is actually working.
Does anyone have another github action suggestion to perform this task?
I am creating a little utility app for some of my Azure work and i would love to make it possible to deploy a azure package from within my tool.
I have a package that have been created from Visual studio and i can manual deploy it or deploy it from within VS 2012.
Anyone who know a guide or can tell me how i would deploy it from my own application?
Yes, you can do that. Everything you see as far as deployment is concerned in VS is backed by a REST API. So you could essentially write a WPF application which is a wrapper over these REST API. There're two things you would need to do:
Upload Package files to blob storage: This would be the 1st thing you would need to do. You could make use of storage client library or implement REST API for uploading package files to blob storage.
Implement "Create Deployment" Service Management API function: Take a look at the functionality here: http://msdn.microsoft.com/en-us/library/windowsazure/ee460813.aspx. Once you have uploaded the package file in blob storage (and got the blob URI), you could invoke this functionality.
As far as I know there is no API wrapper / SDK available that covers full functionality on managing Storage Accounts, Deployments etc. yet. You can use the Windows Azure Management REST API though.
In order to use this API you need to have a valid management certificate in the subscription you want to manage and sign all REST calls to the Management API with it. There should be sufficient information about how to do so in the link above.
HTH