0

I am trying to install a Sitecore package through Azure Pipeline using Sitecore PowerShell Remoting.

The reference article that I followed.

https://jakubwajs.wordpress.com/2020/09/22/running-sitecore-powershell-extensions-module-as-part-of-powershell-script-in-azure-devops/

Here is my PowerShell:

Import-Module -Name  "$(System.DefaultWorkingDirectory)/sc-ci-artifacts/MyWebsite-Release-infra/infra/automation/modules/saf/Public/SPERemoting/SPE/SPE.psd1"

Get-Command -Module SPE

$session = New-ScriptSession -Username Admin -Password "" -ConnectionUri "https://mywebsite"

Invoke-RemoteScript -ScriptBlock {
 
} -Session $session

I am facing the below error while executing. Why am I seeing proxy issues? The same pipeline is doing the deployment.

2023-02-06T11:00:00.0155060Z ##[debug]New-WebServiceProxy : The request failed with HTTP status 403: Ip Forbidden.
2023-02-06T11:00:00.0224859Z ##[debug]At \SPERemoting\SPE\Invoke-RemoteScript.ps1:250 char:43
2023-02-06T11:00:00.0237823Z ##[debug]+ ...             $singleConnection.Proxy = New-WebServiceProxy @proxyProps
2023-02-06T11:00:00.0249645Z ##[debug]+                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-02-06T11:00:00.0261240Z ##[debug]    + CategoryInfo          : ObjectNotFound: (https://sbx-ext...ation.asmx?wsdl:Uri) [New-WebServiceProxy], WebExcept    ion
2023-02-06T11:00:00.0279749Z ##[debug]    + FullyQualifiedErrorId : WebException,Microsoft.PowerShell.Commands.NewWebServiceProxy
2023-02-06T11:00:00.0299977Z ##[debug]Script stack trace:
2023-02-06T11:00:00.0317239Z ##[debug]at Invoke-RemoteScript, \infra\automation\modules\saf\Public\SPERemoting\SPE\Invoke-RemoteScript.ps1: line 250
2023-02-06T11:00:00.0328594Z ##[debug]at <ScriptBlock>, D:\a\_temp\9073f99d-3979-4146-967b-8544d5f14ab8.ps1: line 12
2023-02-06T11:00:00.0339770Z ##[debug]at <ScriptBlock>, <No file>: line 1
2023-02-06T11:00:00.0351181Z ##[debug]at <ScriptBlock>, D:\a\_tasks\AzurePowerShell_72a1931b-effb-4d2e-8fd8-f8472a07cb62\4.216.2\azurepowershell.ps1: line 232
2023-02-06T11:00:00.0362504Z ##[debug]at <ScriptBlock>, D:\a\_tasks\AzurePowerShell_72a1931b-effb-4d2e-8fd8-f8472a07cb62\4.216.2\azurepowershell.ps1: line 228
2023-02-06T11:00:00.0373686Z ##[debug]at <ScriptBlock>, <No file>: line 1
2023-02-06T11:00:00.0384702Z ##[debug]at <ScriptBlock>, <No file>: line 22
2023-02-06T11:00:00.0395900Z ##[debug]at <ScriptBlock>, <No file>: line 18
2023-02-06T11:00:00.0407657Z ##[debug]at <ScriptBlock>, <No file>: line 1
2023-02-06T11:00:00.0425445Z ##[debug]Exception:
2023-02-06T11:00:00.0464130Z ##[debug]System.Net.WebException: There was an error downloading 'https://mywebsite/sitecore modules/PowerShell/Services/RemoteAutomation.asmx?wsdl'. ---> System.Net.WebException: The request failed with HTTP status 403: Ip Forbidden.
2023-02-06T11:00:00.0475156Z ##[debug]   --- End of inner exception stack trace ---
2023-02-06T11:00:00.0486617Z ##[debug]   at System.Web.Services.Discovery.DiscoveryClientProtocol.Download(String& url, String& contentType)
2023-02-06T11:00:00.0498685Z ##[debug]   at System.Web.Services.Discovery.DiscoveryClientProtocol.DiscoverAny(String url)
2023-02-06T11:00:00.0510237Z ##[debug]   at Microsoft.PowerShell.Commands.NewWebServiceProxy.GenerateWebServiceProxyAssembly(String NameSpace, String ClassName)
2023-02-06T11:00:00.0673907Z ##[error]There was an error downloading 'https://mywebsite/sitecore modules/PowerShell/Services/RemoteAutomation.asmx?wsdl'.
2023-02-06T11:00:00.0675632Z ##[debug]Processed: ##vso[task.logissue type=error]There was an error downloading 'https://mywebsite/sitecore modules/PowerShell/Services/RemoteAutomation.asmx?wsdl'.
2023-02-06T11:00:00.0685836Z ##[debug]Processed: ##vso[task.complete result=Failed]
2023-02-06T11:00:00.1105532Z ##[section]Finishing: Azure PowerShell script: InlineScript
1
  • The request failed with HTTP status 403: Ip Forbidden - My guess would be that you have IP restrictions somewhere on your site. Probably some security hardening on the /sitecore modules path - its common that folder is locked down: sitecore.stackexchange.com/questions/17631/…
    – Richard Seal
    Feb 9 at 18:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.