What are best practices to maintain Azure Functions?

Ganesh Patil 0 Reputation points Microsoft Employee
2023-04-18T12:28:42.6133333+00:00

We have a repo of our Azure SF services that interact with Cosmos DB. We are writing an Azure Function that will change a few properties in Cosmos DB document based on a trigger. So, we have the following questions:

  1. Shall we maintain the code of services and azure functions in the same repo? or is it advisable to maintain a separate repo for all the azure functions (Reason being Services are deployed every week, but we do not want to change azure function that frequently, Azure Function will run based on time triger, so deploy-once strategy works for us).
  2. What are the best practices that teams inside Microsoft follow? Is there any documentation for it?
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,679 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,016 Reputation points
    2023-04-19T14:18:18.03+00:00

    @Ganesh Patil Thanks for reaching out.

    It's a good practice to maintain separate repositories for your Azure Functions and your Azure Service Fabric services. This allows you to manage the code for each component separately and deploy them independently.

    By maintaining separate repositories, you can also enforce different release cycles for your Azure Functions and your Azure Service Fabric services. For example, you can deploy your Azure Service Fabric services every week, while deploying your Azure Functions only when necessary.

    As for best practices, Microsoft recommends using a separate repository for each Azure Function app. This allows you to manage the code for each function app separately and deploy them independently. You can also use a separate repository for each Azure Service Fabric application, which contains one or more services.

    In addition, Microsoft recommends using a continuous integration and continuous deployment (CI/CD) pipeline to automate the deployment of your Azure Functions and Azure Service Fabric services. This allows you to test and deploy your code quickly and reliably.

    You can find more information on best practices for Azure Functions and Azure Service Fabric on the Microsoft documentation website. Here are some links to get you started:

    0 comments No comments