How to deploy multiple azure function triggers in one function from command line?

Bakar, Cem 281 Reputation points
2022-06-16T12:53:05.17+00:00

Hello there,
Everytime I execute `func azure functionapp publish

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,506 Reputation points
    2022-06-16T14:12:27.677+00:00

    Hi @Bakar, Cem ,

    Thanks for reaching out to Q&A forum.

    As you mentioned, when you deploy the code to an existing function, the contents will be overwritten. If you would like to deploy multiple functions, I would suggest you to add multiple functions to one function app (same language stack) and then deploy using the function core tools. Please see below example,

    My function app is MyFunctionProj, I have http and blob triggered function

    212096-image.png

    I will add a queue storage trigger by using the command "func new" inside the MyFunctionProj folder which has the main function app

    Ref : https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=v4%2Cwindows%2Ccsharp%2Cportal%2Cbash#create-func

    212067-image.png

    Once you create all the functions, you can publish to Azure functions runtime using the below command

    func azure functionapp publish <FunctionAppName>

    I hope this helps! Feel free to reach out to me if you have any queries or concerns.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    0 comments No comments

  2. Bakar, Cem 281 Reputation points
    2022-06-16T14:34:21.593+00:00

    Hello @MughundhanRaveendran-MSFT ,

    Thank you for answer.
    I understand that func azure functionapp publish <FunctionAppName> deploys your code it also deletes existing ones!

    From ACE Portal, you can add multiple functions within your <FunctionAppName> but if you were to deploy one with func azure functionapp publish <FunctionAppName> , it would delete all of them first and deploy the last one you pushed. Which is what I am trying to figure out..

    The goal is having more than one functions within a function app!

    Thanks again,
    ~cem

    212070-screen-shot-2022-06-16-at-103144-am.png

    212107-screen-shot-2022-06-16-at-103200-am.png


  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

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.