Good afternoon,
I was hoping someone may be able to help me with a powershell script I’m trying to automate with Octopus.
The script is attached, but I wrote it to deploy my database via a .dacpac.
What’s odd is that if I run the script via a command prompt it runs ok with this command:
powershell -executionPolicy bypass -file “c:\temp\Deploy.ps1”
But if I run the same script against the same .dacpac from Octopus I get the following error.
C:\OctopusTentacle\Applications\Test\MyApp\1.2.5612.22500\Content\MyApp.Database.dacpac
Info 13:33:16
Microsoft.SqlServer.Dac.DacServicesException
Could not generate deployment script.
at Microsoft.SqlServer.Dac.DacServices.GenerateDeployScript(DacPackage package, String targetDatabaseName, DacDeployOptions options, Nullable1 cancellationToken) at GenerateDeployScript(Object , Object[] ) at System.Management.Automation.DotNetAdapter.AuxiliaryMethodInvoke(Object target, Object[] arguments, MethodInformation methodInformation, Object[] originalArguments) Info 13:33:18 Microsoft.SqlServer.Dac.DacServicesException Could not deploy package. at Microsoft.SqlServer.Dac.DeployOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context) at Microsoft.SqlServer.Dac.DacServices.InternalDeploy(IPackageSource packageSource, Boolean isDacpac, String targetDatabaseName, DacDeployOptions options, CancellationToken cancellationToken, DacLoggingContext loggingContext) at Microsoft.SqlServer.Dac.DacServices.Deploy(DacPackage package, String targetDatabaseName, Boolean upgradeExisting, DacDeployOptions options, Nullable
1 cancellationToken)
at Deploy(Object , Object[] )
at System.Management.Automation.DotNetAdapter.AuxiliaryMethodInvoke(Object target, Object[] arguments, MethodInformation methodInformation, Object[] originalArguments)
Can you think of any reasons why I’d be able to run this OK from the the cmd prompt but not Octopus?
Any thoughts greatly appreciated,
Cheers,
Doug