File tree 4 files changed +10
-8
lines changed
4 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -431,11 +431,11 @@ try {
431
431
else {
432
432
(($_.Name -eq $dependency.name ) -and ($_.Name -eq " Application" -or (($_.Publisher -eq $dependency.publisher ) -and ([System.Version ]$_.Version -ge [System.Version ]$dependency.version ))))
433
433
}
434
- }
434
+ } | Sort-Object { [ System.Version ] $_ .Version } - Descending | Select-Object - First 1
435
435
$addDependencies = @ ()
436
436
if ($existingApp ) {
437
437
Write-Host " Dependency App exists"
438
- if ($existingApp.PropagateDependencies ) {
438
+ if ($existingApp.ContainsKey ( ' PropagateDependencies' ) -and $existingApp .PropagateDependencies -and $existingApp .ContainsKey ( ' Dependencies ' ) ) {
439
439
$addDependencies += $existingApp.Dependencies
440
440
}
441
441
}
Original file line number Diff line number Diff line change @@ -186,11 +186,11 @@ try {
186
186
Write-Host " Processing dependency $ ( $dependency.Publisher ) _$ ( $dependency.Name ) _$ ( $dependency.Version ) ($ ( $dependency.AppId ) )"
187
187
$existingApp = $existingApps | Where-Object {
188
188
((($dependency.appId -ne ' ' -and $_.AppId -eq $dependency.appId ) -or ($dependency.appId -eq ' ' -and $_.Name -eq $dependency.Name )) -and ([System.Version ]$_.Version -ge [System.Version ]$dependency.version ))
189
- }
189
+ } | Sort-Object { [ System.Version ] $_ .Version } - Descending | Select-Object - First 1
190
190
$addDependencies = $ ()
191
191
if ($existingApp ) {
192
192
Write-Host " Dependency App exists"
193
- if ($existingApp.ContainsKey (' PropagateDependencies' ) -and $existingApp.PropagateDependencies ) {
193
+ if ($existingApp.ContainsKey (' PropagateDependencies' ) -and $existingApp.PropagateDependencies -and $existingApp .ContainsKey ( ' Dependencies ' ) ) {
194
194
$addDependencies += $existingApp.Dependencies
195
195
}
196
196
}
Original file line number Diff line number Diff line change 1
1
6.0.27
2
2
Issue 3538 Compile-AppWithBcCompilerFolder fails when dependency does propagateDependencies
3
+ Issue 3727 Regression - Release pipelines failing with SaaS environments due BcAuthContext
3
4
4
5
6.0.26
5
6
As minimum, always use the generic tag version which was available when shipping BcContainerHelper
Original file line number Diff line number Diff line change @@ -51,8 +51,6 @@ function Publish-PerTenantExtensionApps {
51
51
$telemetryScope = InitTelemetryScope - name $MyInvocation.InvocationName - parameterValues $PSBoundParameters - includeParameters @ ()
52
52
try {
53
53
54
- $script :authContext = Renew- BcAuthContext - bcAuthContext $bcAuthContext
55
-
56
54
function GetAuthHeaders {
57
55
$script :authContext = Renew- BcAuthContext - bcAuthContext $script :authContext
58
56
return @ { " Authorization" = " Bearer $ ( $script :authContext.AccessToken ) " }
@@ -69,16 +67,19 @@ try {
69
67
if ($clientSecret -is [String ]) { $clientSecret = ConvertTo-SecureString - String $clientSecret - AsPlainText - Force }
70
68
if ($clientSecret -isnot [SecureString ]) { throw " ClientSecret needs to be a SecureString or a String" }
71
69
72
- $bcauthContext = New-BcAuthContext `
70
+ $script :authContext = New-BcAuthContext `
73
71
- clientID $clientID `
74
72
- clientSecret $clientSecret `
75
73
- tenantID $tenantId `
76
74
- scopes " https://api.businesscentral.dynamics.com/.default"
77
75
78
- if (-not ($bcAuthContext )) {
76
+ if (-not ($script :AuthContext )) {
79
77
throw " Authentication failed"
80
78
}
81
79
}
80
+ else {
81
+ $script :authContext = Renew- BcAuthContext - bcAuthContext $bcAuthContext
82
+ }
82
83
83
84
$appFolder = Join-Path ([System.IO.Path ]::GetTempPath()) ([guid ]::NewGuid().ToString())
84
85
try {
You can’t perform that action at this time.
0 commit comments