Reputation: 1600
I am reviewing Azure Functions to implement a micro service that is associated with our main ASP.net Core application (version 3.1 until .net 6 is released). The Azure function will require classes that are defined in our main application (I am reviewing this and this thread for that purpose, even though these threads are quite old).
Because of the dependency on these classes, I would like to include the Azure Functions in our main repository and include a pipeline in Azure DevOps for the Azure Function, next to the pipeline for our web application. In my thought this means that we don't have to check if there is a change in the dependent classes to deploy a new release for the Azure Function, as any commit will trigger a new release.
Is this the common or intended workflow for deploying Azure Functions with a dependency on other applications' classes?
Upvotes: 1
Views: 155
Reputation: 58951
I would recommend creating a .NET Standard Class Library where you share your Code / Models between your ASP.NET Core Application and your Azure Function (e. g. MyApplication.Core or MyApplication.Models) Then you usually want to configure your pipeline to only run when a change happens in a certain path - like:
trigger:
branches:
include: master
paths:
include:
- src/MyFunction
- src/MyApplication.Models
Upvotes: 1