一个功能的应用程序可能包含多个功能,因此,如果只有一个功能损坏,删除整个功能的应用程序可能是矫枉过正。对于那些在这种情况下删除功能文件夹在Kudu控制台/使用PowerShell是一个更好的方法。
使用KUDU CONSOLE
- 转到
https://<yourFunctionApp>.scm.azurewebsites.net
- 点击
DEBUG(top bar) -> CMD
并在显示导航到site -> wwwroot
- 找到你的函数存在,并删除它的新页面(点击图标编辑/铅笔图标的右侧)
使用PowerShell (基于this)
$username = '<publish username>' #IMPORTANT: use single quotes as username may contain $
$password = "<publish password>"
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username,$password)))
$commandBody = @{
command = "rm -d -r myAzureFunction"
dir = "site\\wwwroot"
}
$deleteUrl = "https://<myFunctionApp>.scm.azurewebsites.net/api/command"
Invoke-RestMethod -Uri $deleteUrl -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -Method POST `
-ContentType "application/json" -Body (ConvertTo-Json $commandBody)
的发布用户名和密码发布可以根据具体here
$creds = Invoke-AzureRmResourceAction -ResourceGroupName YourResourceGroup -ResourceType Microsoft.Web/sites/config -ResourceName YourWebApp/publishingcredentials -Action list -ApiVersion 2015-08-01 -Force
$username = $creds.Properties.PublishingUserName
$password = $creds.Properties.PublishingPassword
获得对于未来的参考,你也可以使用https://resources.azure。 com /,这比CLI更容易,并且不需要客户端位。 –
我认为David Ebbo的上述评论应该是它自己的一个答案 - 它的工作原理也为我们提供了很多其他的机会。 – bevada