Reputation: 27
i want to use StoreBroker in a TFS Build-Pipeline fow publishing a app into the windows store. for this i use following script:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$clientId="<clientid>"
$clientSecret="<clientsecret>"
$tenantId="<tenant>"
Import-Module StoreBroker
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
$css = ConvertTo-SecureString -String $ClientSecret -AsPlainText -force -Debug
$cred = New-Object System.Management.Automation.PSCredential $ClientId, $css
Set-StoreBrokerAuthentication -TenantId $TenantId -Credential $cred -Debug
Get-Applications -GetAll | Format-Applications -Verbose
Be sure to check that your client id/secret are valid.
The underlying connection was closed: An unexpected error occurred on a send.
At C:\Program Files\WindowsPowerShell\Modules\StoreBroker\1.21.2\StoreBroker\StoreIngestionApi.psm1:556 char:9
+ Write-Log -Message $newLineOutput -Level Error
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-Log
Be sure to check that your client id/secret are valid.
The underlying connection was closed: An unexpected error occurred on a send.
At C:\Program Files\WindowsPowerShell\Modules\StoreBroker\1.21.2\StoreBroker\StoreIngestionApi.psm1:557 char:9
+ throw $newLineOutput
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Be sure to chec...rred on a send.:String) [], RuntimeException
+ FullyQualifiedErrorId : Be sure to check that your client id/secret are valid.
The underlying connection was closed: An unexpected error occurred on a send.
Do you have an idea?
best regards
Volkhard
Upvotes: 0
Views: 37
Reputation: 5642
I can reproduce the same issue when I tried the script on the Windows Server 2016.
Then I found the error The underlying connection was closed: An unexpected error occurred on a send.
is similar with the one in this question and it is found that the older versions of DOTNET framework (i.e. 3.5 and 4.0) do not inherently support the newer versions of TLS like 1.2 and 1.3.
To solve the issue, there is an easy way to check and update the TLS 1.2 compatibility of the .NET Framework.
Here are the steps:
AzureDevOpsTls12Analysis.ps1
It will check the TLS settings on your windows server 2016 and you may find the following result: Mitigation-NetFramework.ps1
The underlying connection was closed: An unexpected error occurred on a send.
should not be there anymore.Upvotes: 0