[英]Zip deploy of Azure function was a success but Functions in Azure is empty
Hi I have a Azure function timer which I am trying to deploy via ZIP deploy, it succeeds but Functions in Azure is empty.嗨,我有一个 Azure function 计时器,我正在尝试通过 ZIP 部署来部署它,它成功了,但是 Azure 中的函数是空的。
The cmd I am using for the deployment is az functionapp deployment source config-zip -g $resourceGroupName -n $functionName --src $sourceZipPath我用于部署的 cmd 是az functionapp deployment source config-zip -g $resourceGroupName -n $functionName --src $sourceZipPath
The JSON response from the cmd is as below.来自 cmd 的 JSON 响应如下。
{ "active": false,
"author": "N/A",
"author_email": "N/A",
"complete": true,
"deployer": "ZipDeploy",
"end_time": "2022-03-25T12:37:54.9247211Z",
"id": "373e929429a14bee8b6368949e922789",
"is_readonly": true,
"is_temp": false,
"last_success_end_time": "2022-03-25T12:37:54.9247211Z",
"log_url": "https://xxxx.scm.azurewebsites.net/api/deployments/latest/log",
"message": "Created via a push deployment",
"progress": "",
"provisioningState": "Succeeded",
"received_time": "2022-03-25T12:33:05.5662452Z",
"site_name": "xxxx",
"start_time": "2022-03-25T12:33:17.5130554Z",
"status": 4,
"status_text": "",
"url": "https://xxxx.scm.azurewebsites.net/api/deployments/latest"
}
I can see all the files inside the file structure (screen shots below)我可以看到文件结构中的所有文件(下面的屏幕截图)
Not sure where I am going wrong.不知道我要去哪里错了。 It works perfectly when deployed from Visual Studio 2019.
从 Visual Studio 2019 部署时,它可以完美运行。
I did check on the post "https://stackoverflow.com/questions/64032902/az-functionapp-deployment-reports-success-but-functions-view-in-azure-is-empt" and followed the steps but no luck.我确实检查了帖子“https://stackoverflow.com/questions/64032902/az-functionapp-deployment-reports-success-but-functions-view-in-azure-is-empt”并按照步骤操作但没有运气.
Can anyone suggest what else can I try.谁能建议我还能尝试什么。
I tried to reproduce the same issue while deploying the Azure Function using AZ CLI both from Local CLI and Azure CloudShell:我在使用本地 CLI 和 Azure CloudShell 中的 AZ CLI 部署 Azure Function 时尝试重现相同的问题:
az functionapp deployment source config-zip -g HariTestRG -n KrishNet6FuncApp --src "C:/Users/Hari/source/repos/DotNet6/TimerTrigger1205.zip"
As Per this GitHub Discussion , I came to know that the command az functionapp deployment source config-zip
having the issue with AZ CLI versions and tried by downgrading to 2.28 version of Azure CLI but not succeeded the desired result.根据这个GitHub 讨论,我了解到命令
az functionapp deployment source config-zip
存在 AZ CLI 版本的问题,并尝试降级到 Azure CLI 的 2.28 版本,但没有取得预期的结果。
Command to downgrade the Azure CLI version:
$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://azcliprod.blob.core.windows.net/msi/azure-cli-2.28.0.msi -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'; rm .\AzureCLI.msi
Alternative workaround to this zip push deploy of Function Apps is using PowerShell Commands and working well . 886982359588 应用程序的 zip 推送部署的替代解决方法是使用 PowerShell 命令并且运行良好。
After enabling the application setting SCM_DO_BUILD_DURING_DEPLOYMENT
to true
and deploying the Azure Function Zip using AZ CLI
, it deployed successfully and shows the functions in the Azure Portal along with the files in the wwwroot
folder.在启用应用程序设置
SCM_DO_BUILD_DURING_DEPLOYMENT
为true
并使用AZ CLI
部署 Azure Function Zip 后,它成功部署并显示 Azure 门户中的功能以及wwwroot
文件夹中的文件。
AZ CLI Command: AZ CLI 命令:
az functionapp deployment source config-zip -g HariTestRG -n KrishNet6FuncApp --src "C:/Users/Hari/source/repos/DotNet6/TimerTrigger1205.zip"
From this Microsoft Documentation , we came to know that some deployment customization has to be done before deploying the Function App as a Zip Push, ie, by default the app setting SCM_DO_BUILD_DURING_DEPLOYMENT
is false which enables the continuous integration deployment.从这个Microsoft Documentation中,我们了解到在将 Function App 部署为 Zip Push 之前,必须进行一些部署自定义,即默认情况下,应用程序设置
SCM_DO_BUILD_DURING_DEPLOYMENT
为 false,从而启用持续集成部署。
For the PowerShell Workaround, refer this GitHub Page .对于 PowerShell 解决方法,请参阅此GitHub 页面。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.