Merge pull request #121 from microsoft/users/tianw/refreshtoken
Refresh token when polling and fix input errors with flight
This commit is contained in:
Коммит
ccfea23af3
|
@ -285,14 +285,34 @@ try
|
|||
{
|
||||
Write-Output "Polling for submission $submissionId to finish"
|
||||
|
||||
# Refresh AccessToken before polling to avoid token expiration
|
||||
$commonParams['AccessToken'] = (Get-AzureRMAccessToken $endPointObj $endpointId $resource).access_token
|
||||
if (-not $(Watch-ExistingSubmission @commonParams -SubmissionId $submissionId -TargetPublishMode $targetPublishMode))
|
||||
$shouldMonitor = $true
|
||||
while ($shouldMonitor)
|
||||
{
|
||||
throw $("The submission $submissionId didn't reach the publishing state.$([Environment]::NewLine)" + `
|
||||
"Verify issues in dev center: https://partner.microsoft.com/en-us/dashboard/products/$appId/submissions/$submissionId")
|
||||
try
|
||||
{
|
||||
# Refresh AccessToken before polling
|
||||
$commonParams['AccessToken'] = (Get-AzureRMAccessToken $endPointObj $endpointId $resource).access_token
|
||||
if (-not $(Watch-ExistingSubmission @commonParams -SubmissionId $submissionId -TargetPublishMode $targetPublishMode))
|
||||
{
|
||||
throw $("The submission $submissionId didn't reach the publishing state.$([Environment]::NewLine)" + `
|
||||
"Verify issues in dev center: https://partner.microsoft.com/en-us/dashboard/products/$appId/submissions/$submissionId")
|
||||
}
|
||||
Write-Output "Submission $submissionId completed"
|
||||
$shouldMonitor = $false
|
||||
}
|
||||
catch
|
||||
{
|
||||
# Catch any authorization related exception and retry polling by refreshing the access token
|
||||
if ($_.Exception.Message -ilike "*Unauthorized*")
|
||||
{
|
||||
Write-Output "Got exception with authentication while trying to check on submission. Will try again. The exception was:" -Exception $_ -Level Warning
|
||||
}
|
||||
else {
|
||||
throw $_
|
||||
}
|
||||
}
|
||||
}
|
||||
Write-Output "Submission $submissionId completed"
|
||||
|
||||
Write-VstsSetResult -Result "Succeeded" -Message "Submission $submissionId completed"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"version": {
|
||||
"Major": "3",
|
||||
"Minor": "0",
|
||||
"Patch": "25"
|
||||
"Patch": "27"
|
||||
},
|
||||
"minimumAgentVersion": "2.117.0",
|
||||
"instanceNameFormat": "Publish $(appName)",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"manifestVersion": 1,
|
||||
"id": "windows-store-publish",
|
||||
"version": "2.4.33",
|
||||
"version": "2.4.36",
|
||||
"name": "Windows Store",
|
||||
"publisher": "ms-rdx-mro",
|
||||
"description": "Publish your applications on the Windows Store.",
|
||||
|
|
Загрузка…
Ссылка в новой задаче