admin管理员组

文章数量:1336174

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
  1. When using this Script on Windows 11 client machine, everything works fine.
  2. When using this Script on Windows Server 2016, i get the following message:
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

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
  1. When using this Script on Windows 11 client machine, everything works fine.
  2. When using this Script on Windows Server 2016, i get the following message:
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

Share Improve this question asked Nov 19, 2024 at 22:17 Volkhard VogelerVolkhard Vogeler 274 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

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:

  1. Visit the https://github/microsoft/azure-devops-tls12 and download the Azure DevOps TLS 1.2 transition readiness checker.
  2. Run the script: AzureDevOpsTls12Analysis.ps1 It will check the TLS settings on your windows server 2016 and you may find the following result:
  3. Run the generated mitigation script generated: Mitigation-NetFramework.ps1
  4. Rerun your PowerShell script again. This time, the error The underlying connection was closed: An unexpected error occurred on a send. should not be there anymore.

本文标签: azure devopsStoreBroker on Windows 2016 doesn180t authenticateStack Overflow