When creating logic app together with azure function, where should I place the bicep file? in infrastruct repo or function code repo?

Henry Zhang 181 Reputation points


Let's say I have created an Azure function app (with function A,B in it), also I will need a logic app to orchestrate the running sequence of A and B. A simple diagram like following:

User's image

Now my issue came when writing bicep for this.

In general, we separate the infrastructure code from the application code. So I have one CI/CD for just creating the function app (no function deployed). Then another application CI/CD will only do zip deployment for pushing the functions (A, B) into the function app.

The problem is where should I put the bicep for my logic app? in the infrastructure repo or the application repo?

  1. If I put the logic app bicep in the infrastructure repo, it will look like this:
    User's image

But this won't work, as the application CI/CD will redeploy the functions which will cause the logic app to throw an "unauthorized" error as the deployment will break the function key, see second answer in this ticket.
User's image

  1. If I put the bicep file with the application code:
    User's image

It will work as expected, but this means I will have to include a bicep file and ps1 file inside my application code. Now both my infrastructure repo and application repo will hold bicep files and deal with azure resource creation.
User's image

To me, none of the approaches is ideal....

Wondering which way should I go and why.


Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,019 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,713 questions
{count} votes

Accepted answer
  1. Mike Urnun 9,236 Reputation points Microsoft Employee

    Hello @Henry Zhang - Thanks for reaching out, and posting on the MS Q&A. Assuming that you're using Logic Apps Standard, here's my suggestion:

    Infra Repo:

    • Deploy Function Apps resource
    • Deploy LA resource
    • Use Bicep files

    App repo:

    • zip deployment pushing functions
    • zip deployment pushing workflows
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful