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: docs/connect/jdbc/connecting-using-azure-active-directory-authentication.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Connection properties to support Azure Active Directory authentication in the Mi
25
25
-**authentication**: Use this property to indicate which SQL authentication method to use for the connection.
26
26
Possible values are:
27
27
-**ActiveDirectoryMSI**
28
-
- Supported since driver version **v7.2**, `authentication=ActiveDirectoryMSI` can be used to connect to an Azure SQL Database/Synapse Analytics from an Azure Resource with "Identity" support enabled. Optionally, **msiClientId** can be specified in the Connection/DataSource properties along with this authentication mode. `msiClientId` must contain the Client ID of a Managed Identity to be used to acquire the **accessToken** for establishing the connection.
28
+
- Supported since driver version **v8.3.1**, `authentication=ActiveDirectoryMSI` can be used to connect to an Azure SQL Database/Synapse Analytics from an Azure Resource with "Identity" support enabled. Optionally, **msiClientId** can be specified in the Connection/DataSource properties along with this authentication mode. `msiClientId` must contain the Client ID of a Managed Identity to be used to acquire the **accessToken** for establishing the connection.
29
29
-**ActiveDirectoryIntegrated**
30
30
- Supported since driver version **v6.0**, `authentication=ActiveDirectoryIntegrated` can be used to connect to an Azure SQL Database/Synapse Analytics using integrated authentication. To use this authentication mode, you need to federate the on-premise Active Directory Federation Services (ADFS) with Azure Active Directory in the cloud. Once it's set up, you can connect by either adding the native library 'mssql-jdbc_auth-\<version>-\<arch>.dll' to the application class path on Windows, or setting up a Kerberos ticket for cross-platform authentication support. You'll be able to access Azure SQL Database/Azure Synapse Analytics without being prompted for credentials when you're logged in to a domain joined machine.
The [bcp](../../../tools/bcp-utility.md) utility is available with the [!INCLUDE[msCoName](../../../includes/msconame_md.md)] ODBC Driver for [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] on Linux and macOS. This page documents the differences from the Windows version of `bcp`.
21
-
22
-
- The field terminator is a tab ("\t").
23
-
24
-
- The line terminator is a newline ("\n").
25
-
26
-
- Character mode is the preferred format for `bcp` format files and data files that do not contain extended characters.
27
-
28
-
> [!NOTE]
29
-
> A backslash '\\' on a command-line argument must either be quoted or escaped. For example, to specify a newline as a custom row terminator, you must use one of the following mechanisms:
30
-
>
31
-
> - -r\\\n
32
-
> - -r"\n"
33
-
> - -r'\n'
34
-
35
-
The following example is a command invocation of `bcp` to copy table rows to a text file:
36
-
37
-
```
38
-
bcp AdventureWorks2008R2.Person.Address out test.dat -Usa -Pxxxx -Sxxx.xxx.xxx.xxx
39
-
```
40
-
41
-
## Available Options
42
-
In the current release, the following syntax and options are available:
21
+
The [bcp](../../../tools/bcp-utility.md) utility is available with the [!INCLUDE[msCoName](../../../includes/msconame_md.md)] ODBC Driver for [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] on Linux and macOS. This page documents the differences from the [Windows version of bcp](../../../tools/bcp-utility.md).
Specifies the number of bytes, per network packet, sent to and from the server.
48
-
49
-
- -b *batch_size*
50
-
Specifies the number of rows per batch of imported data.
51
-
52
-
- -c
53
-
Uses a character data type.
54
-
55
-
- -d *database_name*
56
-
Specifies the database to connect to.
57
-
58
-
- -D
59
-
Causes the value passed to the `bcp` -S option to be interpreted as a data source name (DSN). For more information, see "DSN Support in sqlcmd and bcp" in [Connecting with sqlcmd](connecting-with-sqlcmd.md).
60
-
61
-
- -e *error_file*
62
-
Specifies the full path of an error file used to store any rows that the `bcp` utility cannot transfer from the file to the database.
63
-
64
-
- -E
65
-
Uses an identity value or values in the imported data file for the identity column.
66
-
67
-
- -f *format_file*
68
-
Specifies the full path of a format file.
69
-
70
-
- -F *first_row*
71
-
Specifies the number of the first row to export from a table or import from a data file.
25
+
- The line terminator is a newline ("\n").
72
26
73
-
- -G
74
-
This switch is used by the client when connecting to Azure SQL Database or Azure Synapse Analytics to specify that the user be authenticated using Azure Active Directory authentication. It can be combined with just the -P option to use access token authentication (v17.8+). The -G switch requires at least bcp version 17.6. To determine your version, execute bcp -v.
27
+
- Character mode is the preferred format for `bcp` format files and data files that don't contain extended characters.
28
+
29
+
> [!NOTE]
30
+
> A backslash '\\' on a command-line argument must either be quoted or escaped. For example, to specify a newline as a custom row terminator, you must use one of the following mechanisms:
31
+
>
32
+
> - -r\\\n
33
+
> - -r"\n"
34
+
> - -r'\n'
35
+
36
+
The following example is a command invocation of `bcp` to copy table rows to a text file:
37
+
38
+
```bash
39
+
bcp AdventureWorks2008R2.Person.Address out test.dat -Usa -Pxxxx -Sxxx.xxx.xxx.xxx
40
+
```
75
41
42
+
## Available options
43
+
44
+
In the current release, the following syntax and options are available:
Specifies the number of bytes, per network packet, sent to and from the server.
50
+
51
+
**-b***batch_size*
52
+
Specifies the number of rows per batch of imported data.
53
+
54
+
**-c**
55
+
Uses a character data type.
56
+
57
+
**-d***database_name*
58
+
Specifies the database to connect to.
59
+
60
+
**-D**
61
+
Causes the value passed to the `bcp` -S option to be interpreted as a data source name (DSN). For more information, see "DSN Support in sqlcmd and bcp" in [Connecting with sqlcmd](connecting-with-sqlcmd.md).
62
+
63
+
**-e***error_file*
64
+
Specifies the full path of an error file used to store any rows that the `bcp` utility can't transfer from the file to the database.
65
+
66
+
**-E**
67
+
Uses an identity value or values in the imported data file for the identity column.
68
+
69
+
**-f***format_file*
70
+
Specifies the full path of a format file.
71
+
72
+
**-F***first_row*
73
+
Specifies the number of the first row to export from a table or import from a data file.
74
+
75
+
**-G**
76
+
This switch is used by the client when connecting to Azure SQL Database or Azure Synapse Analytics to specify that the user be authenticated using Azure Active Directory authentication. It can be combined with just the -P option to use access token authentication (v17.8+). The -G switch requires at least bcp version 17.6. To determine your version, execute bcp -v.
76
77
77
78
> [!IMPORTANT]
78
79
> The `-G` option only applies to Azure SQL Database and Azure Synapse Analytics.
79
80
> AAD Interactive Authentication is not currently supported on Linux or macOS. AAD Integrated Authentication requires [Microsoft ODBC Driver 17 for SQL Server](../download-odbc-driver-for-sql-server.md) version 17.6.1 or higher and a properly [configured Kerberos environment](using-integrated-authentication.md#configure-kerberos).
80
81
81
-
- -k
82
-
Specifies that empty columns should retain a null value during the operation, rather than have any default values for the columns inserted.
83
-
84
-
- -l
85
-
Specifies a login timeout. The -l option specifies the number of seconds before a login to [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] times out when you try to connect to a server. The default login timeout is 15 seconds. The login timeout must be a number between 0 and 65534. If the value supplied is not numeric or does not fall into that range, `bcp` generates an error message. A value of 0 specifies an infinite timeout.
86
-
87
-
- -L *last_row*
88
-
Specifies the number of the last row to export from a table or import from a data file.
89
-
90
-
- -m *max_errors*
91
-
Specifies the maximum number of syntax errors that can occur before the `bcp` operation is canceled.
92
-
93
-
- -n
94
-
Uses the native (database) data types of the data to perform the bulk-copy operation.
95
-
96
-
- -P *password*
97
-
Specifies the password for the login ID. When used with the -G option without -U, specifies a file that contains an access token (v17.8+). The token file should be in UTF-16 format.
82
+
**-k**
83
+
Specifies that empty columns should keep a null value during the operation, rather than have any default values for the columns inserted.
98
84
99
-
100
-
- -q
101
-
Executes the SET QUOTED_IDENTIFIERS ON statement in the connection between the `bcp` utility and an instance of [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)].
102
-
103
-
- -r *row_terminator*
104
-
Specifies the row terminator.
105
-
106
-
- -R
107
-
Specifies that currency, date, and time data is bulk copied into [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] using the regional format defined for the locale setting of the client computer.
108
-
109
-
- -S *server*
110
-
Specifies the name of the [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] instance to connect to, or if -D is used, a DSN.
111
-
112
-
- -t *field_terminator*
113
-
Specifies the field terminator.
114
-
115
-
- -T
116
-
Specifies that the `bcp` utility connect to [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] with a trusted connection (integrated security).
117
-
118
-
- -U *login_id*
119
-
Specifies the login ID used to connect to [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)].
120
-
121
-
- -v
122
-
Reports the `bcp` utility version number and copyright.
123
-
124
-
- -w
125
-
Uses Unicode characters to perform the bulk copy operation.
126
-
127
-
In this release, Latin-1 and UTF-16 characters are supported.
128
-
129
-
## Unavailable Options
130
-
In the current release, the following syntax and options are not available:
85
+
**-l**
86
+
Specifies a login timeout. The -l option specifies the number of seconds before a login to [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] times out when you try to connect to a server. The default login timeout is 15 seconds. The login timeout must be a number between 0 and 65534. If the value supplied isn't numeric or doesn't fall into that range, `bcp` generates an error message. A value of 0 specifies an infinite timeout.
131
87
132
-
- -C
133
-
Specifies the code page of the data in the data file.
134
-
135
-
- -h *hint*
136
-
Specifies the hint or hints used during a bulk import of data into a table or view.
88
+
**-L***last_row*
89
+
Specifies the number of the last row to export from a table or import from a data file.
137
90
138
-
- -i *input_file*
139
-
Specifies the name of a response file.
140
-
141
-
- -N
142
-
Uses the native (database) data types of the data for noncharacter data, and Unicode characters for character data.
143
-
144
-
- -o *output_file*
145
-
Specifies the name of a file that receives output redirected from the command prompt.
146
-
147
-
- -V (80 | 90 | 100)
148
-
Uses data types from an earlier version of [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)].
149
-
150
-
- -x
151
-
Used with the format and -f format_file options, generates an XML-based format file instead of the default non-XML format file.
152
-
153
-
## See Also
91
+
**-m***max_errors*
92
+
Specifies the maximum number of syntax errors that can occur before the `bcp` operation is canceled.
93
+
94
+
**-n**
95
+
Uses the native (database) data types of the data to do the bulk-copy operation.
96
+
97
+
**-P***password*
98
+
Specifies the password for the login ID. When used with the -G option without -U, specifies a file that contains an access token (v17.8+). The token file should be in UTF-16LE (no BOM) format.
99
+
100
+
Access tokens can be obtained via various methods. It's important to ensure the access token is correct byte-for-byte, as it will be sent as-is. Below is an example command that obtains an access token. The command uses the Azure CLI and Linux commands and saves it to a file in the proper format. If your system or terminal's default encoding isn't ASCII or UTF-8, you may need to adjust the `iconv` options. Be sure to carefully secure the resulting file and delete it when it's no longer required.
Executes the SET QUOTED_IDENTIFIERS ON statement in the connection between the `bcp` utility and an instance of [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)].
108
+
109
+
**-r***row_terminator*
110
+
Specifies the row terminator.
111
+
112
+
**-R**
113
+
Specifies that currency, date, and time data is bulk copied into [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] using the regional format defined for the locale setting of the client computer.
114
+
115
+
**-S***server*
116
+
Specifies the name of the [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] instance to connect to, or if -D is used, a DSN.
117
+
118
+
**-t***field_terminator*
119
+
Specifies the field terminator.
120
+
121
+
**-T**
122
+
Specifies that the `bcp` utility connect to [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] with a trusted connection (integrated security).
123
+
124
+
**-U***login_id*
125
+
Specifies the login ID used to connect to [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)].
126
+
127
+
**-v**
128
+
Reports the `bcp` utility version number and copyright.
129
+
130
+
**-w**
131
+
Uses Unicode characters to do the bulk copy operation.
132
+
133
+
In this release, Latin-1 and UTF-16 characters are supported.
134
+
135
+
## Unavailable options
136
+
137
+
In the current release, the following syntax and options aren't available:
138
+
139
+
**-C**
140
+
Specifies the code page of the data in the data file.
141
+
142
+
**-h***hint*
143
+
Specifies the hint or hints used during a bulk import of data into a table or view.
144
+
145
+
**-i***input_file*
146
+
Specifies the name of a response file.
147
+
148
+
**-N**
149
+
Uses the native (database) data types of the data for noncharacter data, and Unicode characters for character data.
150
+
151
+
**-o***output_file*
152
+
Specifies the name of a file that receives output redirected from the command prompt.
153
+
154
+
**-V** (80 | 90 | 100)
155
+
Uses data types from an earlier version of [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)].
156
+
157
+
**-x**
158
+
Used with the format and -f format_file options, generates an XML-based format file instead of the default non-XML format file.
159
+
160
+
## See also
154
161
155
-
[Connecting with **sqlcmd**](connecting-with-sqlcmd.md)
156
-
[Release Notes](release-notes-tools.md)
162
+
[Connecting with sqlcmd](connecting-with-sqlcmd.md)
0 commit comments