Azure Functions部署失败,报错ERROR_CONNECTION_TERMINATED求协助
Hey there, sorry to hear you're stuck with this frustrating deployment issue—let's break down some actionable steps to get this sorted out, since you've already followed the tutorial and ruled out Fiddler interference.
Potential Fixes to Try
Verify Azure Account Permissions & Deployment Credentials
Make sure the Azure account you're signed into in Visual Studio has Owner or Contributor permissions on your target Function App. Sometimes stale or incorrect deployment credentials can block deployments:- Head to the Azure Portal, navigate to your Function App > Deployment Center > FTP/Credentials
- You can reset the deployment credentials here, then go back to Visual Studio, re-authenticate your Azure account, and try deploying again.
Clear Visual Studio's Deployment Cache
Corrupted local deployment cache is a common culprit. Delete these cache folders to start fresh:%LOCALAPPDATA%\Microsoft\VisualStudio\<your VS version>\WebSiteCache%LOCALAPPDATA%\Microsoft\VisualStudio\<your VS version>\Publish
Restart Visual Studio after deleting the folders, then attempt deployment again.
Check Function App Configuration & Status
Log into the Azure Portal and confirm:- Your Function App is in the Running state (not stopped or disabled)
- If you have
WEBSITE_RUN_FROM_PACKAGEset to1in Configuration > Application Settings, temporarily change it to0for the deployment—you can switch it back once deployment succeeds. This setting can interfere with Web Deploy.
Test Deployment via Azure CLI
To rule out Visual Studio-specific issues, try deploying manually with Azure CLI:- In Visual Studio, right-click your Function App project > Publish > Select Create Package to generate a deployment zip file.
- Run this command (replace placeholders with your details):
az functionapp deployment source config-zip --resource-group <your-resource-group> --name <your-function-app-name> --src <path-to-your-zip-file>
If this works, the problem is likely with Visual Studio's deployment setup; if it fails, the issue is on the Azure side (like permissions or app configuration).
Enable Detailed Deployment Logs
Get more granular error details by enabling verbose logs in Visual Studio:- Open the Publish window for your project > Go to Settings > Under Deployment Logs, select Detailed
- Run the deployment again and check the full log output—look for specific error codes (like 401/403 for permissions, 500 for server issues) that can pinpoint the exact problem.
内容的提问来源于stack exchange,提问作者Narendra Jangir

