This commit is contained in:
Freddy Kristiansen 2020-10-31 18:13:51 +01:00
Родитель 2a8a9adb03
Коммит 270614d09b
3 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -32,6 +32,8 @@
With this parameter, you can specify a hashtable, describring that the specified dependencies in the apps being published should be replaced
.Parameter showMyCode
With this parameter you can change or check ShowMyCode in the app file. Check will throw an error if ShowMyCode is False.
.Parameter PublisherAzureActiveDirectoryTenantId
AAD Tenant of the publisher to ensure access to keyvault (unless publisher check is disables in server config)
.Example
Publish-BcContainerApp -appFile c:\temp\myapp.app
.Example
@ -67,7 +69,8 @@ function Publish-BcContainerApp {
[string] $language = "",
[hashtable] $replaceDependencies = $null,
[ValidateSet('Ignore','True','False','Check')]
[string] $ShowMyCode = "Ignore"
[string] $ShowMyCode = "Ignore",
[string] $PublisherAzureActiveDirectoryTenantId
)
Add-Type -AssemblyName System.Net.Http
@ -83,6 +86,7 @@ function Publish-BcContainerApp {
"language" = $language
"replaceDependencies" = $replaceDependencies
"ShowMyCode" = $showMyCode
"PublisherAzureActiveDirectoryTenantId" = $PublisherAzureActiveDirectoryTenantId
}
if ($syncMode) { $Params += @{ "SyncMode" = $syncMode } }
if ($packageType) { $Params += @{ "packageType" = $packageType } }
@ -235,7 +239,7 @@ function Publish-BcContainerApp {
}
else {
Invoke-ScriptInBcContainer -containerName $containerName -ScriptBlock { Param($appFile, $skipVerification, $sync, $install, $upgrade, $tenant, $syncMode, $packageType, $scope, $language)
Invoke-ScriptInBcContainer -containerName $containerName -ScriptBlock { Param($appFile, $skipVerification, $sync, $install, $upgrade, $tenant, $syncMode, $packageType, $scope, $language, $PublisherAzureActiveDirectoryTenantId)
$publishArgs = @{ "packageType" = $packageType }
if ($scope) {
@ -244,6 +248,9 @@ function Publish-BcContainerApp {
$publishArgs += @{ "Tenant" = $tenant }
}
}
if ($PublisherAzureActiveDirectoryTenantId) {
$publishArgs += @{ "PublisherAzureActiveDirectoryTenantId" = $PublisherAzureActiveDirectoryTenantId }
}
Write-Host "Publishing $appFile"
Publish-NavApp -ServerInstance $ServerInstance -Path $appFile -SkipVerification:$SkipVerification @publishArgs
@ -287,7 +294,7 @@ function Publish-BcContainerApp {
}
}
} -ArgumentList $containerAppFile, $skipVerification, $sync, $install, $upgrade, $tenant, $syncMode, $packageType, $scope, $language
} -ArgumentList $containerAppFile, $skipVerification, $sync, $install, $upgrade, $tenant, $syncMode, $packageType, $scope, $language, $PublisherAzureActiveDirectoryTenantId
}
if ($copied) {

Просмотреть файл

@ -3,6 +3,7 @@ Issue #1414 the magic setting defaultTenantHasAllowAppDatabaseWrite=Y is not use
Add parameter -publishedOnly to Get-BcContainerAppInfo to get published apps (no tenant specified)
Add parameter -doNotCopyDatabase to New-BcContainerTenant to mount an existing database (move from other container)
Add parameter -doNotRemoveDatabase to Remove-BcContainerTenant to avoid removing the database (move to other container)
Add parameter -PublisherAzureActiveDirectoryTenantId to Publish-BcContainerApp
1.0.12
Issue #1401 set app version if appBuild -or appRevision is specified

Просмотреть файл

@ -72,7 +72,7 @@ function New-BcContainerTenant {
if (!$doNotCopyDatabase) {
Copy-NavDatabase -SourceDatabaseName $sourceDatabase -DestinationDatabaseName $destinationDatabase -DatabaseServer $databaseServer -DatabaseInstance $databaseInstance -DatabaseCredentials $sqlCredential
}
Mount-NavDatabase -ServerInstance $ServerInstance -TenantId $TenantId -DatabaseName $destinationDatabase -DatabaseServer $databaseServer -DatabaseInstance $databaseInstance -DatabaseCredentials $sqlCredential -AlternateId $alternateId @Params
Mount-NavDatabase -ServerInstance $ServerInstance -TenantId $TenantId -DatabaseName $destinationDatabase -DatabaseServer $databaseServer -DatabaseInstance $databaseInstance -DatabaseCredentials $sqlCredential -AlternateId $alternateId @Params -WarningAction SilentlyContinue
if (Test-Path "c:\run\my\updatehosts.ps1") {
$ip = "127.0.0.1"