arcus-azure / arcus.scripting

Scripting with Microsoft Azure in a breeze.
https://scripting.arcus-azure.net/
MIT License
9 stars 12 forks source link

feat: TrustServerCertificate on AzSqlDatabaseMigration #434

Closed LodewijkSioen closed 2 months ago

LodewijkSioen commented 2 months ago

Added TrustServerCertificate for scenario's where you want to build locally for integration testing.

netlify[bot] commented 2 months ago

Deploy Preview for arcus-scripting canceled.

Name Link
Latest commit a6afc159cd10e743031b412806ef4392dff92ce5
Latest deploy log https://app.netlify.com/sites/arcus-scripting/deploys/66e96ade4140d10008b41f64
pim-simons commented 2 months ago

/AzurePipelines run

azure-pipelines[bot] commented 2 months ago
Azure Pipelines successfully started running 1 pipeline(s).
pim-simons commented 2 months ago

I see an issue in the integration test execution in the Azure Devops Pipeline:

Execute dummy SQL statement to make sure the Azure SQL DB is resumed. Task failed. Attempt 1. Will retry in next 1 seconds. Error: A parameter cannot be found that matches parameter name 'TrustServerCertificate'. Task failed. Attempt 2. Will retry in next 1 seconds. Error: A parameter cannot be found that matches parameter name 'TrustServerCertificate'. Task failed. Attempt 3. Will retry in next 1 seconds. Error: A parameter cannot be found that matches parameter name 'TrustServerCertificate'. Task failed. Attempt 4. Will retry in next 1 seconds. Error: A parameter cannot be found that matches parameter name 'TrustServerCertificate'. [-] Describe Arcus Azure SQL integration tests failed WriteErrorException: Task failed. With all 5 attempts. Error: System.Management.Automation.ParameterBindingException: A parameter cannot be found that matches parameter name 'TrustServerCertificate'. at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) A parameter cannot be found that matches parameter name 'TrustServerCertificate'. at global:Retry-Function, /home/vsts/work/1/s/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.Sql.tests.ps1:88 at , /home/vsts/work/1/s/src/Arcus.Scripting.Tests.Integration/Arcus.Scripting.Sql.tests.ps1:127

Interestingly this fails on Linux but the same integration test works on Windows...

LodewijkSioen commented 2 months ago

I'll look into it

LodewijkSioen commented 2 months ago

TrustServerCertificate was introduced in version 22 of the SqlServer module. I Updated the RequiredModules to the latest version to be sure.

pim-simons commented 2 months ago

/AzurePipelines run

azure-pipelines[bot] commented 2 months ago
Azure Pipelines successfully started running 1 pipeline(s).
pim-simons commented 2 months ago

Approved and merged! Thanks for your contribution 🥇