问题描述
我正在尝试使用ARM模板通过MSDeploy部署Azure Function应用(.NET Core,函数v3),并且几乎每次都会出现此错误。这只是偶尔成功。我的函数应用程序具有5个基于计时器的函数,它们每秒运行一次。我目前正在使用部署插槽,并且当它们位于暂存插槽中时(通过disabledAttribute和特定于插槽的设置),我的功能已设置为禁用。
我用来部署的ARM模板:
{
"apiVersion": "2018-02-01","name": "[concat(variables('webAppName'),'/staging')]","type": "Microsoft.Web/sites/slots","kind": "app","location": "[resourceGroup().location]","resources": [
{
"apiVersion": "2015-02-01","type": "Extensions","name": "MSDeploy","dependsOn": [
"[concat(resourceId('Microsoft.Web/Sites/',variables('webAppName')),'/slots/staging')]"
],"properties": {
"packageUri": "[parameters('packageUrl')]"
}
}
]
}
ARM-MSDeploy Deploy Failed: 'Microsoft.Web.Deployment.DeploymentDetailedUnauthorizedAccessException: Unable to perform the operation ("Delete File") for the specified directory ("D:\home\site\wwwroot\bin\MyAssembly.dll"). This can occur if the server administrator has not authorized this operation for the user credentials you are using. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_INSUFFICIENT_ACCESS_TO_SITE_FOLDER. ---> Microsoft.Web.Deployment.DeploymentException: The error code was 0x80070005. ---> System.UnauthorizedAccessException: Access to the path 'D:\home\site\wwwroot\bin\MyAssembly.dll' is denied.
如何阻止此错误的发生?