We are getting below error on Azure devops pipeline via Self hosted agent release when Azure web app is on Private network. No Error seen when the web app on azure is on Public.
Error: Error: Failed to deploy web package to App Service. Error: tunneling socket could not be established, statusCode=503
Made Azure web app to private and error comes. Moved to public no error seen.
CodePudding user response:
Seems that the self-hosted agent cannot connect to the Azure app service. It seems to be a network issue.
The agent needs a way to connect to the App service directly. To ensure the connectivity is ok, we need to make sure the self-hosted agent is not blocked by NSG rules or App Service networking Access Restrictions. Just whitelist the agent machine in your rules.
The task using Kudu REST API to deploy the application. We need to check the following App Service networking Access Restrictions to allow deployment from a specific agent:
- Make sure the REST site “
xxx.scm.azurewebsites.net
” haveAllow All
, i.e. no restriction. - Also, the option “
Same restrictions as ***.azurewebsites.net
” should be unchecked.
Besides, when the proxy is set up, Web API calls and SCM hosts are bypassed by the user. The same has to be configured in the Azure pipelines agent explicitly. To bypass specific hosts, follow the steps
CodePudding user response:
1.Allow access to Public removed. 2.Created Pvt endpoints within same Vnet and Subnet of Target VM 3.Created new file .proxybypass in self hosted agent folder C:\Username\Agent 4.Added below entries in .proxybypass to allow and communicate bypassing corporate proxy https://MyWebappname.azurewebsites.net http://MyWebappname.azurewebsites.net
enter code here