2
我deployng DACPAC與以下部署後SCRIPT1:T-SQL部署後腳本如何引用變量
ALTER DATABASE [$(DatabaseName)]
MODIFY FILE (NAME = [$(DatabaseName)],
SIZE = 100MB, MAXSIZE = UNLIMITED, FILEGROWTH = 20%)
然而,當我嘗試引用此部署後SCRIPT2,部署失敗:
ALTER DATABASE [$(DatabaseName)]
MODIFY FILE (NAME = [$(DatabaseName)],
SIZE = $(size), MAXSIZE = UNLIMITED, FILEGROWTH = 20%)
所以,我的問題是什麼是通過大小正確的語法?
我使用這個命令來啓動腳本(第一SCRIPT1作品,SCRIPT2沒有)
$resourceGroup = "SQL1"
$vmName = "SQL1"
$storageName = "sql1artifactsstorage111"
$ConfigurationPath = "C:\DSC\Ext\deployDB.ps1"
$ConfigurationName = "deployDB"
$configurationArchive = "deployDB.ps1.zip"
#Publish the configuration script into user storage
Publish-AzureRmVMDscConfiguration -ConfigurationPath $ConfigurationPath -ResourceGroupName $resourceGroup -StorageAccountName $storageName -force
#Set the VM to run the DSC configuration
$configurationArguments =
@{
Credential = Get-Credential;
DatabaseName = 'Database1'
size = '100MB'
}
Set-AzureRmVmDscExtension -Version 2.22 -Name dscExtension -ResourceGroupName $resourceGroup -VMName $vmName -ArchiveStorageAccountName $storageName -ArchiveBlobName $configurationArchive -AutoUpdate:$true -ConfigurationName $ConfigurationName -ConfigurationArgument $configurationArguments
這是錯誤DSC顯示:
Dac Deploy Failed: 'Exception calling "Deploy"
with "3" argument(s): "An error occurred during deployment plan generation.
Deployment cannot continue."'
你有多個標記爲「Post-Deploy」的文件嗎?您應該只有一個後期部署文件,並使用:r標籤包含要在該後期部署腳本中運行的其他文件。 –
我只有1個部署後腳本 – WinBoss