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
For historical context and to provide feedback, see [discussion #292](https://github.com/microsoft/go-sqlcmd/discussions/292).
168
171
169
172
### Miscellaneous enhancements
170
173
171
174
- Console output coloring (see below)
172
-
-`:Connect` now has an optional `-G` parameter to select one of the authentication methods for Azure SQL Database - `SqlAuthentication`, `ActiveDirectoryDefault`, `ActiveDirectoryIntegrated`, `ActiveDirectoryServicePrincipal`, `ActiveDirectoryManagedIdentity`, `ActiveDirectoryPassword`. If `-G` is not provided, either Integrated security or SQL Authentication will be used, dependent on the presence of a `-U` username parameter.
175
+
-`:Connect` now has an optional `-G` parameter to select one of the authentication methods for Azure SQL Database - `SqlAuthentication`, `ActiveDirectoryDefault`, `ActiveDirectoryIntegrated`, `ActiveDirectoryServicePrincipal`, `ActiveDirectoryManagedIdentity`, `ActiveDirectoryPassword`, `ActiveDirectoryInteractive`, `ActiveDirectoryAzCli`, `ActiveDirectoryDeviceCode`. If `-G` is not provided, either Integrated security or SQL Authentication will be used, dependent on the presence of a `-U` username parameter.
173
176
- The new `--driver-logging-level` command line parameter allows you to see traces from the `go-mssqldb` client driver. Use `64` to see all traces.
174
177
- Sqlcmd can now print results using a vertical format. Use the new `--vertical` command line option to set it. It's also controlled by the `SQLCMDFORMAT` scripting variable.
175
178
@@ -217,7 +220,7 @@ To use AAD auth, you can use one of two command line switches:
217
220
218
221
`ActiveDirectoryIntegrated`
219
222
220
-
This method is currently not implemented and will fall back to `ActiveDirectoryDefault`.
223
+
This method uses integrated Windows authentication. On Windows, it uses the current user's credentials. On Linux and macOS, it uses Kerberos authentication (requires a properly configured Kerberos environment).
221
224
222
225
`ActiveDirectoryPassword`
223
226
@@ -237,6 +240,26 @@ Use this method when running sqlcmd on an Azure VM that has either a system-assi
237
240
238
241
This method authenticates the provided username as a service principal id and the password as the client secret for the service principal. Provide a username in the form `<service principal id>@<tenant id>`. Set `SQLCMDPASSWORD` variable to the client secret. If using a certificate instead of a client secret, set `AZURE_CLIENT_CERTIFICATE_PATH` environment variable to the path of the certificate file.
239
242
243
+
`ActiveDirectoryAzCli`
244
+
245
+
This method uses the Azure CLI to obtain an access token. You must be logged in to Azure CLI (`az login`) before using this method.
246
+
247
+
`ActiveDirectoryDeviceCode`
248
+
249
+
This method uses the device code flow for authentication. It displays a code that you enter at https://microsoft.com/devicelogin to authenticate.
250
+
251
+
#### Additional authentication methods
252
+
253
+
The following authentication methods are also supported via `--authentication-method`:
254
+
255
+
-`ActiveDirectoryWorkloadIdentity` - For workload identity federation scenarios
256
+
-`ActiveDirectoryClientAssertion` - For client assertion authentication
257
+
-`ActiveDirectoryAzurePipelines` - For Azure Pipelines service connections
258
+
-`ActiveDirectoryEnvironment` - Uses environment variables for authentication
-`ActiveDirectoryServicePrincipalAccessToken` - Uses a pre-obtained access token
261
+
-`SqlPassword` - SQL Server authentication (same as using `-U` and `-P` without `-G`)
262
+
240
263
#### Environment variables for AAD auth
241
264
242
265
Some settings for AAD auth do not have command line inputs, and some environment variables are consumed directly by the `azidentity` package used by `sqlcmd`.
0 commit comments