我在使用Azure CLI或Azure PowerShell部署Azure功能时面临问题。
我已经创建了所需的资源,例如资源组,功能应用和BLOB存储。
我的功能应用程序平台类型是 Linux 带有消耗计划和运行时Net6.0。我已经创建了Service Bus Trigger功能并使用Visual Studio Publish Profile部署,并且可以按预期工作。
但是,当我执行命令以使用CLI部署Azure函数时。命令正在成功执行,但是当我从Azure Portal打开函数应用程序并转到功能刀片时,部署的函数不会出现。
中所述的构建输出的文件夹结构
我还检查了link https://learn.microsoft.com/en-us/azure/azure-functions/deployment-zip-push
任何帮助都将不胜感激。
谢谢
I'm facing an issue while deploying the azure function using Azure CLI or Azure PowerShell.
I have already created needed resources like resource group, function app and blob storage.
My function app platform type is Linux with consumption plan and runtime net6.0. I have created Service Bus trigger function and deployed using Visual Studio Publish profile and it is working as expected.
But when I executed the command to deploy the Azure function using CLI. Command is executing successfully but when I open the function app from azure portal and go to functions blade the deployed functions do not appear there.
I also checked the folder structure of the build output as mentioned in the link
https://learn.microsoft.com/en-us/azure/azure-functions/deployment-zip-push
any help would be appreciated.
Thanks
发布评论
评论(2)
使用az-cli
在设置
scm_do_do_build_derdury_deployment
true
true 在配置中的true az cli 命令再次部署,并在wwwroot
文件夹的Portal和Kudu站点中显示了功能。az cli命令:
根据此 ms doc ,我们知道必须在将函数应用程序作为zip push(即,默认情况下)app app设置<代码
scm_do_build_dury_deployment 是false,可以连续集成部署。
对于PowerShell解决方法,请参阅。
Reproduced the same issue from our end using Az-CLI
Workaround to fix the issue
After setting
SCM_DO_BUILD_DURING_DEPLOYMENT
totrue
in Configuration > Application Settings of the Azure Function App in Portal and deployed again usingAZ CLI
commands and shown the functions in Portal and in Kudu site ofwwwroot
folder.AZ CLI Command:
According to this MS DOC, we came to know that some deployment customization has to be done before deploying the Function App as a Zip Push, i.e., by default the app setting
SCM_DO_BUILD_DURING_DEPLOYMENT
is false which enables the continuous integration deployment.For the PowerShell Workaround, refer GitHub Page.
在消费计划中运行Linux OS上的功能应用程序的部署选项有限,但仅支持远程构建。
要在Linux上启用远程构建,必须设置以下应用程序设置:
功能核心工具是唯一的解决方案对我而言。
默认情况下,Azure函数核心工具部署到Linux时会执行远程构建。因此,它会在Azure自动为您创建这些设置。
我的自定义脚本文件,
如果您需要 linux托管的更多帮助使用此链接 zip deploymnet 获取与 Azure函数部署有关的详细信息。
Function App running on Linux OS in consumption plan has limited deployment options but supports only remote build.
To enable remote build on Linux, the following application settings must be set:
Functions Core Tools is the only solution work for me.
By default, Azure Functions Core Tool perform remote builds when deploying to Linux. Because of this, it automatically create these settings for you in Azure.
my custom script file
if you need more help with Linux hosting use this link Zip Deploymnet to get detailed information related to Azure Functions Deployments.