简体   繁体   中英

Create azure function with blob storage trigger using Azure CLI

How can i create a function in Azure using Azure CLI which will have blob storage trigger.

Tried creating function with below command found at below link but it does not have trigger option. https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-azure-function-azure-cli

az functionapp create --deployment-source-url https://github.com/Azure-Samples/functions-quickstart  --resource-group myResourceGroup --consumption-plan-location westeurope --name <app_name> --storage-account  <storage_name> 

Thanks in advance

As far as I know, if you want to create azure function via azure-cli, you could change the deployment resource url after --deployment-source-url . So you are able to create several kinds of triggers, including the blob storage trigger. For example, you could create a C# blob storage trigger with my github repository .

az functionapp create --deployment-source-url https://github.com/Joyw1/Azure-Function-Trigger  --resource-group myResourceGroup --consumption-plan-location westeurope --name <app_name> --storage-account  <storage_name>

Besides, I recommend you to use a Azure Functions Core Tool to code and test the azure functions, also you can use it to publish the function to azure.

In order to generate trigger programmatically you have to describe it in function.json file that you provide together with your source code. Azure then will recognise it when both files are deployed as zip or via git and make corresponding changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM