Masoud Jahromi
Masoud Jahromi

Reputation: 135

deploy each function in a separate Azure function app

my project has 3 Service bus and 2 HTTP triggers. (5 functions)

How to deploy each function in a separate Azure function app?

Upvotes: 0

Views: 1138

Answers (1)

suziki
suziki

Reputation: 14080

The easiest way is to copy the code of the trigger you created before and create a new function app with a single trigger, then put the code into it(Deploy function app must be based on function app, and the function app should correspond to the project on local.).

The more complicated method is, first make sure the structure of your function app(this needs to check the language. function app has two types, one type is a scripting language and another type needs to be compiled.) For this, you can have a check of this official doc:

https://learn.microsoft.com/en-us/azure/azure-functions/supported-languages

Go to the language you are using and search the folder structure(your deployment structure should like the 'folder structure' in the doc. What needs to pay attention to is for the language like C# and java, you need to deploy the compiled files. Azure can't identify the source files.) Then you just need to imitate the structure and deploy based on this structure.

'Deploy' operation is just a upload operation, so you just needs to upload the files in specific structure, then azure can identify it.

Finally, you can use zip deploy to deploy your function app(Or to say deploy a project, a structure that azure can run must first run success on local.).

az webapp deployment source config-zip --resource-group <group-name> --name <app-name> --src clouddrive/<filename>.zip

(Above command is been used by some Integrated Development Environment, such as Visual Studio.)

I suggest you to use the first way, because it is simpler.

Upvotes: 2

Related Questions