I am deploying the azure app services using the Powershell. I have made sure to set the execution policy Unrestricted in Powershell in the new PC. But, When I ran the powershell script for deployment I got the below message.
Deployment failed: Could not complete the request to remote agent URL '.axd?si
te=WebAppUser2'.
Am I missing something to configure in my New PC. Also please let me know if I need to provide any more information on this.
In my old PC when I tried to deploy the same app services using the same powershell script (that I deployed using New PC) it deployed fine.
I am deploying the azure app services using the Powershell. I have made sure to set the execution policy Unrestricted in Powershell in the new PC. But, When I ran the powershell script for deployment I got the below message.
Deployment failed: Could not complete the request to remote agent URL 'https://webappuser2.scm.azurewebsites/msdeploy.axd?si
te=WebAppUser2'.
Am I missing something to configure in my New PC. Also please let me know if I need to provide any more information on this.
In my old PC when I tried to deploy the same app services using the same powershell script (that I deployed using New PC) it deployed fine.
Share Improve this question edited Nov 21, 2024 at 6:11 Jahnavi 8,2411 gold badge6 silver badges13 bronze badges asked Nov 19, 2024 at 8:31 Fresh InstallFresh Install 1 4- Can you share the script tried so far? @Fresh Install – Jahnavi Commented Nov 20, 2024 at 3:32
- .\waws\WAWSDeploy.exe .\Server .\Settings\server.PublishSettings – Fresh Install Commented Nov 20, 2024 at 18:03
- Could you share the PowerShell command tried so far? @Fresh Install – Jahnavi Commented Nov 21, 2024 at 6:12
- Is the below approach worked for you. @Fresh Install – Jahnavi Commented Dec 3, 2024 at 6:24
1 Answer
Reset to default 0Could not complete the request to remote agent URL: -
There could be several reasons for the above connection error. Check below to resolve the connection conflicts.
Check the PowerShell execution policies to run the PowerShell MS Deploy script. It is possible that you have privileges to run the PowerShell script within the command prompt but not to run a script that runs your exact PowerShell script.
Refer blog by @Alan for the similar issue in a more detailed way. By referring to it, adding below parameters to your script should make it work as expected.
<Target Name="xxxx">
<Exec Command="$(PowerShellExe) -NonInteractive -ExecutionPolicy Unrestricted -File powershellScripts\deploy.ps1 $(PackageDeploymentPath)$(WebApp) $(WebApp).zip $(AzurePublishProfilesPath)\appname.azurewebsites.PublishSettings Debug"/>
</Target>
Also check if the MS Deploy
module has been successfully installed in your environment and try reinstalling it if still the issue persists.
Install-Module -Name MsDeploy
Also, if you are deploying a web app using MS Deploy, firstly, run the below command that provides you the username and password for your App Service as detailed in this SO by @Matt Ruwe clearly. Once it is obtained, provide the right path and continue the deployment further.
az webapp deployment list-publishing-profiles --resource-group Jahnavi --name apsjah --query "[?publishMethod=='MSDeploy']" | ConvertFrom-Json
You can also check if any firewall or network may be interfering with the connection to access the URL/server.
Also, verify if you have a valid certificate for SSL to handle the network configuration without any conflict.
Make sure that the "Allow untrusted certificate"
option is enabled under the publish profile
window while deployment if still the persists after trying the above points.