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

Henry Zhang 206 Reputation points
2024-01-24T02:41:43.3966667+00:00

Hi,

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.

Thanks,

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

Accepted answer
  1. Mike Urnun 9,861 Reputation points Microsoft Employee
    2024-02-16T08:22:56.5433333+00:00

    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.