You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`ServerName`| yes | The full name of the SQL Server that hosts the SQL Database. |
30
30
|`DatabaseName`| yes | The name of the SQL Database |
31
-
|`UserName`| yes | The UserName of the SQL Database |
32
-
|`Password`| yes | The Password of the SQL Database |
31
+
|`UserName`| no | The UserName of the user that must be used to login to the SQL Database. Prefer AccessToken instead |
32
+
|`Password`| no | The Password of the user that must be used to login to the SQL Database. Prefer AccessToken instead |
33
+
|`AccessToken`| no | The access token used to authenticate to SQL Server, as an alternative to user/password or Windows Authentication. Do not specify UserName/Password when using this parameter. |
33
34
|`TrustServerCertificate`| no (default: `$false`) | Indicates whether the channel will be encrypted while bypassing walking the certificate chain to validate trust. |
34
35
|`ScriptsFolder`| no (default: `$PSScriptRoot/sqlScripts`| The directory folder where the SQL migration scripts are located on the file system |
35
36
|`ScriptsFileFilter`| no (default: `*.sql`) | The file filter to limit the SQL script files to use during the migrations |
# Done migrating database. Current Database version is 1.0.0
81
+
```
82
+
68
83
### Adding SQL scripts so they can be picked up by the script
69
84
70
85
1. In the location where you want to run the script add a folder where the migration scripts will be placed. By default, we're looking in a folder called `SqlScripts`, but this can be any folder as it is configurable via the `ScriptsFolder` argument.
Copy file name to clipboardExpand all lines: src/Arcus.Scripting.Sql/Arcus.Scripting.Sql.psm1
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,10 @@ class DatabaseVersion : System.IComparable {
71
71
The name of the user to be used to connect to the Azure SQL Database.
72
72
73
73
.ParameterPassword
74
-
The password to be used to connect to the Azure SQL Database.
74
+
The password to be used to connect to the Azure SQL Database for the specified UserName. Prefer connecting via AccessToken instead.
75
+
76
+
.ParameterAccessToken
77
+
The access token used to authenticate to SQL Server. Do not specify UserName/Password when using this parameter.
75
78
76
79
.ParameterTrustServerCertificate
77
80
Indicates whether the channel will be encrypted while bypassing walking the certificate chain to validate trust.
@@ -92,16 +95,17 @@ function Invoke-AzSqlDatabaseMigration {
92
95
param(
93
96
[Parameter(Mandatory=$true)][string] $ServerName=$(throw"Please provide the name of the SQL Server that hosts the SQL Database. (Do not include 'database.windows.net'"),
94
97
[Parameter(Mandatory=$true)][string] $DatabaseName=$(throw"Please provide the name of the SQL Database"),
95
-
[Parameter(Mandatory=$true)][string] $UserName=$(throw"Please provide the UserName of the SQL Database"),
96
-
[Parameter(Mandatory=$true)][string] $Password=$(throw"Please provide the Password of the SQL Database"),
Copy file name to clipboardExpand all lines: src/Arcus.Scripting.Sql/Scripts/Invoke-AzSqlDatabaseMigration.ps1
+21-8Lines changed: 21 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,9 @@
1
1
param(
2
2
[Parameter(Mandatory=$true)][string] $ServerName=$(throw"Please provide the name of the SQL Server that hosts the SQL Database. (Do not include 'database.windows.net'"),
3
3
[Parameter(Mandatory=$true)][string] $DatabaseName=$(throw"Please provide the name of the SQL Database"),
4
-
[Parameter(Mandatory=$true)][string] $UserName=$(throw"Please provide the user name of the user that must be used to perform the update"),
5
-
[Parameter(Mandatory=$true)][string] $Password=$(throw"Please provide the password of the user that must be used to perform the update"),
$createDatabaseVersionTable="IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '$DatabaseVersionTable' AND TABLE_SCHEMA = '$DatabaseSchema' ) "+
0 commit comments