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
Copy file name to clipboardExpand all lines: public/Connect-DbaInstance.ps1
+39-2Lines changed: 39 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -140,6 +140,9 @@ function Connect-DbaInstance {
140
140
.PARAMETERAccessToken
141
141
Connect to an Azure SQL Database or an Azure SQL Managed Instance with an AccessToken, that has to be generated with Get-AzAccessToken or New-DbaAzAccessToken.
142
142
143
+
Supports both String (Azure PowerShell v13 and earlier) and SecureString (Azure PowerShell v14+) token formats.
144
+
The function automatically detects the token type and converts SecureString tokens to the required plain text format internally.
145
+
143
146
Note that the token is valid for only one hour and cannot be renewed automatically.
144
147
145
148
Note that the returned SMO is not a fully functional SMO. It can only be used in a limited list of commands like Invoke-DbaQuery, Import-DbaCsv or Write-DbaDbTableData.
@@ -268,8 +271,20 @@ function Connect-DbaInstance {
268
271
PS C:\> Invoke-DbaQuery -SqlInstance $server -Query "select 1 as test"
269
272
270
273
Connect to an Azure SQL Database or an Azure SQL Managed Instance with an AccessToken.
274
+
Works with both Azure PowerShell v13 (string tokens) and v14+ (SecureString tokens).
271
275
Note that the token is valid for only one hour and cannot be renewed automatically.
272
276
277
+
.EXAMPLE
278
+
PS C:\> # Azure PowerShell v14+ with SecureString token support
0 commit comments