diff --git a/Build/tSQLt.validatebuild.xml b/Build/tSQLt.validatebuild.xml index 98055037a..8fdea3b60 100644 --- a/Build/tSQLt.validatebuild.xml +++ b/Build/tSQLt.validatebuild.xml @@ -451,7 +451,7 @@ - + diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 276fb1b51..9e62f375e 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -20,8 +20,6 @@ parameters: # TODO, these don't work for scheduled pipelines, not even the defau - name: VMMatrix type: object default: - - name: SQL2008R2 - SQLVersionEdition: 2008R2Std - name: SQL2012 SQLVersionEdition: 2012Ent - name: SQL2014 @@ -195,7 +193,7 @@ stages: inputs: targetType: 'inline' script: | - $DS = Invoke-Sqlcmd -Query "SELECT SUSER_NAME() U,SYSDATETIME() T,@@VERSION V;" -ServerInstance "$(CreateSQLVMEnvironment.FQDNAndPort)" -Username "$(CreateSQLVMEnvironment.SQLUserName)" -Password "$(CreateSQLVMEnvironment.SQLPwd)" -As DataSet + $DS = Invoke-Sqlcmd -Query "SELECT SUSER_NAME() U,SYSDATETIME() T,@@VERSION V;" -ServerInstance "$(CreateSQLVMEnvironment.FQDNAndPort)" -Username "$(CreateSQLVMEnvironment.SQLUserName)" -Password "$(CreateSQLVMEnvironment.SQLPwd)" -As DataSet -TrustServerCertificate $DS.Tables[0].Rows | %{ echo "{ $($_['U']), $($_['T']), $($_['V']) }" } diff --git a/CI/Azure-DevOps/CreateSQLVM_azcli.ps1 b/CI/Azure-DevOps/CreateSQLVM_azcli.ps1 index 42b7b68ea..cc61a18bd 100644 --- a/CI/Azure-DevOps/CreateSQLVM_azcli.ps1 +++ b/CI/Azure-DevOps/CreateSQLVM_azcli.ps1 @@ -1,4 +1,10 @@ -<# USAGE: ./CreateSQLVM.ps1 -Location "East US 2" -Size "Standard_D2as_v4" -ResourceGroupName "myTestResourceGroup" -VMAdminName "azureAdminName" -VMAdminPwd "aoeihag;ladjfalkj23" -SQLVersionEdition "2017" -SQLPort "41433" -SQLUserName "tSQLt_sa" -SQLPwd "aoeihag;ladjfalkj46" -BuildId "001" #> +<# USAGE: + +az login +az account set --name "tSQLt CI Subscription" + +./CreateSQLVM_azcli.ps1 -Location "East US 2" -Size "Standard_D2as_v4" -ResourceGroupName "myTestResourceGroup" -VMAdminName "azureadminname" -VMAdminPwd "aoeihag;ladjfalkj23" -SQLVersionEdition "2017" -SQLPort "41433" -SQLUserName "tSQLt_sa" -SQLPwd "aoeihag;ladjfalkj46" -BuildId "001" -VmPriority "Spot" +#> Param( [Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()][string] $Location, [Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()][string] $Size, @@ -98,22 +104,30 @@ $FQDN = (az network public-ip show --resource-group $ResourceGroupName --name $P Log-Output "FQDN: ", $FQDN; Log-Output "DONE: Creating PIP $PipName"; -Log-Output "START: Creating NSG and Rules $NsgName"; +Log-Output "START: Creating NSG and Rules $NsgName --> nsg create"; $output = az network nsg create --name $NsgName --resource-group $ResourceGroupName --location $Location | ConvertFrom-Json; if (!$output) { Write-Error "Error creating NIC"; return } +Log-Output "START: Creating NSG and Rules $NsgName --> nsg rule create --name `"RDPRule`""; +$DestPort = 3389; +Log-Output "<-><-><-><-><-><-><-><-><-><-><-><-><-><->"; +Log-Output "ResourceGroupName: ", $ResourceGroupName; +Log-Output "NsgName: ", $NsgName; +Log-Output "DestPort: ", $DestPort; +Log-Output "<-><-><-><-><-><-><-><-><-><-><-><-><-><->"; $output = az network nsg rule create --name "RDPRule" --nsg-name $NsgName --priority 1000 --resource-group $ResourceGroupName --access Allow ` - --destination-address-prefixes * --destination-port-ranges 3389 --direction Inbound --protocol Tcp --source-address-prefixes * ` - --source-port-ranges * | ConvertFrom-Json; + --destination-address-prefixes '*' --destination-port-ranges $DestPort --direction Inbound --protocol Tcp --source-address-prefixes '*' ` + --source-port-ranges '*' | ConvertFrom-Json; if (!$output) { Write-Error "Error creating NIC RDPRule"; return } +Log-Output "START: Creating NSG and Rules $NsgName --> nsg rule create --name `"MSSQLRule`""; $output = az network nsg rule create --name "MSSQLRule" --nsg-name $NsgName --priority 1001 --resource-group $ResourceGroupName --access Allow ` - --destination-address-prefixes * --destination-port-ranges $SQLPort --direction Inbound --protocol Tcp --source-address-prefixes * ` - --source-port-ranges * | ConvertFrom-Json; + --destination-address-prefixes '*' --destination-port-ranges $SQLPort --direction Inbound --protocol Tcp --source-address-prefixes '*' ` + --source-port-ranges '*' | ConvertFrom-Json; if (!$output) { Write-Error "Error creating NIC MSSQLRule"; return @@ -163,7 +177,7 @@ $SQLVM|Out-String|Log-Output; Log-Output 'DONE: Applying SqlVM Config' Log-Output 'START: Prep SQL Server for tSQLt Build' -$DS = Invoke-Sqlcmd -InputFile "$dir/GetSQLServerVersion.sql" -ServerInstance "$FQDN,$SQLPort" -Username "$SQLUserName" -Password "$SQLPwd" -As DataSet +$DS = Invoke-Sqlcmd -InputFile "$dir/GetSQLServerVersion.sql" -ServerInstance "$FQDN,$SQLPort" -Username "$SQLUserName" -Password "$SQLPwd" -As DataSet -TrustServerCertificate $DS.Tables[0].Rows | %{ Log-Output "{ $($_['LoginName']), $($_['TimeStamp']), $($_['VersionDetail']), $($_['ProductVersion']), $($_['ProductLevel']), $($_['SqlVersion']), $($_['ServerCollation']) }" } $ActualSQLVersion = $DS.Tables[0].Rows[0]['SqlVersion'];