使用 Azure CLI 创建带有 blob 存储触发器的 azure 函数

Create azure function with blob storage trigger using Azure CLI

我如何使用 Azure CLI 在 Azure 中创建一个函数,该函数将具有 blob 存储触发器。

尝试使用 link 下面的命令创建函数,但它没有触发选项。 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> 

提前致谢

据我所知,如果你想通过 azure-cli 创建 azure 函数,你可以在 --deployment-source-url 之后更改部署资源 url。因此,您可以创建多种触发器,包括 blob 存储触发器。例如,您可以使用 my github repository 创建 C# blob storage trigger

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>

此外,我建议您使用 Azure Functions Core Tool 来编写和测试 azure 函数,您也可以使用它来将函数发布到 azure。

为了以编程方式生成触发器,您必须在与源代码一起提供的 function.json 文件中对其进行描述。当两个文件都部署为 zip 或通过 git 部署时,Azure 将识别它并进行相应的更改。