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 and transform data in Azure Database for PostgreSQL using Azure Data Factory or Synapse Analytics
@@ -16,6 +16,9 @@ ms.date: 11/19/2024
16
16
17
17
This article outlines how to use Copy Activity in Azure Data Factory and Synapse Analytics pipelines to copy data from and to Azure Database for PostgreSQL, and use Data Flow to transform data in Azure Database for PostgreSQL. To learn more, read the introductory articles for [Azure Data Factory](introduction.md) and [Synapse Analytics](../synapse-analytics/overview-what-is.md).
18
18
19
+
> [!IMPORTANT]
20
+
> The Azure Database for PostgreSQL version 2.0 provides improved native Azure Database for PostgreSQL support. If you are using the Azure Database for PostgreSQL version 1.0 in your solution, you are recommended to [upgrade your Azure Database for PostgreSQL connector](#upgrade-the-azure-database-for-postgresql-connector) at your earliest convenience.
21
+
19
22
This connector is specialized for the [Azure Database for PostgreSQL service](/azure/postgresql/overview). To copy data from a generic PostgreSQL database located on-premises or in the cloud, use the [PostgreSQL connector](connector-postgresql.md).
20
23
21
24
## Supported capabilities
@@ -30,11 +33,10 @@ This Azure Database for PostgreSQL connector is supported for the following capa
The three activities work on all Azure Database for PostgreSQL deployment options:
36
+
The three activities work on Azure Database for PostgreSQL [Single Server](/azure/postgresql/single-server/) and [Flexible Server](/azure/postgresql/flexible-server/), as well as [Azure Cosmos DB for PostgreSQL](/azure/postgresql/hyperscale/).
> Azure Database for PostgreSQL Single Server will be retired on March 28, 2025. Please migrate to Flexible Server by that date. You can refer to this [article](/azure/postgresql/migrate/migration-service/overview-migration-service-postgresql) and [FAQ](/azure/postgresql/migrate/whats-happening-to-postgresql-single-server) for the migration guidance.
38
40
39
41
## Getting started
40
42
@@ -68,15 +70,99 @@ The following sections offer details about properties that are used to define Da
68
70
69
71
## Linked service properties
70
72
71
-
The following properties are supported for the Azure Database for PostgreSQL linked service:
73
+
The Azure Database for PostgreSQL connector version **2.0** supports TLS 1.3 and multiple SSL modes. Refer to this [section](#upgrade-the-azure-database-for-postgresql-connector) to upgrade your Azure SQL Database connector version from version 1.0. For the property details, see the corresponding sections.
74
+
75
+
-[Version 2.0](#version-20)
76
+
-[Version 1.0](#version-10)
77
+
78
+
### Version 2.0
79
+
80
+
The following properties are supported for the Azure Database for PostgreSQL linked service when you apply version 2.0:
72
81
73
82
| Property | Description | Required |
74
83
|:--- |:--- |:--- |
75
84
| type | The type property must be set to: **AzurePostgreSql**. | Yes |
76
-
| connectionString | An ODBC connection string to connect to Azure Database for PostgreSQL.<br/>You can also put a password in Azure Key Vault and pull the `password` configuration out of the connection string. See the following samples and [Store credentials in Azure Key Vault](store-credentials-in-key-vault.md) for more details. | Yes |
85
+
| version | The version that you specify. The value is `2.0`. | Yes |
86
+
| server | Specifies the host name and optionally port on which Azure Database for PostgreSQL is running. | Yes |
87
+
| port |The TCP port of the Azure Database for PostgreSQL server. The default value is `5432`. |No |
88
+
| database| The name of the Azure Database for PostgreSQL database to connect to. |Yes |
89
+
| username| The username to connect with. Not required if using IntegratedSecurity. |Yes |
90
+
| password| The password to connect with. Not required if using IntegratedSecurity. Mark this field as **SecureString** to store it securely. Or, you can [reference a secret stored in Azure Key Vault](store-credentials-in-key-vault.md). |Yes |
91
+
| sslMode | Controls whether SSL is used, depending on server support. <br/>- **Disable**: SSL is disabled. If the server requires SSL, the connection will fail.<br/>- **Allow**: Prefer non-SSL connections if the server allows them, but allow SSL connections.<br/>- **Prefer**: Prefer SSL connections if the server allows them, but allow connections without SSL.<br/>- **Require**: The connection fails if the server doesn't support SSL.<br/>- **Verify-ca**: The connection fails if the server doesn't support SSL. Also verifies server certificate.<br/>- **Verify-full**: The connection fails if the server doesn't support SSL. Also verifies server certificate with host's name. <br/>Options: Disable (0) / Allow (1) / Prefer (2) **(Default)** / Require (3) / Verify-ca (4) / Verify-full (5) | No |
92
+
| connectVia | This property represents the [integration runtime](concepts-integration-runtime.md) to be used to connect to the data store. You can use Azure Integration Runtime or Self-hosted Integration Runtime (if your data store is located in private network). If not specified, it uses the default Azure Integration Runtime.|No|
93
+
|***Additional connection properties:***|||
94
+
| schema | Sets the schema search path. | No |
95
+
| pooling | Whether connection pooling should be used. | No |
96
+
| connectionTimeout | The time to wait (in seconds) while trying to establish a connection before terminating the attempt and generating an error. | No |
97
+
| commandTimeout | The time to wait (in seconds) while trying to execute a command before terminating the attempt and generating an error. Set to zero for infinity. | No |
98
+
| trustServerCertificate | Whether to trust the server certificate without validating it. | No |
99
+
| readBufferSize | Determines the size of the internal buffer Npgsql uses when reading. Increasing may improve performance if transferring large values from the database. | No |
100
+
| timezone | Gets or sets the session timezone. | No |
101
+
| encoding | Gets or sets the .NET encoding that will be used to encode/decode PostgreSQL string data. | No |
102
+
103
+
**Example**:
104
+
105
+
```json
106
+
{
107
+
"name": "AzurePostgreSqlLinkedService",
108
+
"properties": {
109
+
"type": "AzurePostgreSql",
110
+
"version": "2.0",
111
+
"typeProperties": {
112
+
"server": "<server name>",
113
+
"port": "5432",
114
+
"database": "<database name>",
115
+
"sslMode": 2,
116
+
"username": "<user name>",
117
+
"password": {
118
+
"type": "SecureString",
119
+
"value": "<password>"
120
+
}
121
+
}
122
+
}
123
+
}
124
+
```
125
+
**Example**:
126
+
127
+
***Store password in Azure Key Vault***
128
+
129
+
```json
130
+
{
131
+
"name": "AzurePostgreSqlLinkedService",
132
+
"properties": {
133
+
"type": "AzurePostgreSql",
134
+
"version": "2.0",
135
+
"typeProperties": {
136
+
"server": "<server name>",
137
+
"port": "5432",
138
+
"database": "<database name>",
139
+
"sslMode": 2,
140
+
"username": "<user name>",
141
+
"password": {
142
+
"type": "AzureKeyVaultSecret",
143
+
"store": {
144
+
"referenceName": "<Azure Key Vault linked service name>",
145
+
"type": "LinkedServiceReference"
146
+
},
147
+
"secretName": "<secretName>"
148
+
}
149
+
}
150
+
}
151
+
}
152
+
```
153
+
154
+
### Version 1.0
155
+
156
+
The following properties are supported for the Azure Database for PostgreSQL linked service when you apply version 1.0:
157
+
158
+
| Property | Description | Required |
159
+
|:--- |:--- |:--- |
160
+
| type | The type property must be set to: **AzurePostgreSql**. | Yes |
161
+
| version | The version that you specify. The value is `1.0`. | Yes |
162
+
| connectionString |A Npgsql connection string to connect to Azure Database for PostgreSQL.<br/>You can also put a password in Azure Key Vault and pull the `password` configuration out of the connection string. See the following samples and [Store credentials in Azure Key Vault](store-credentials-in-key-vault.md) for more details. | Yes |
77
163
| connectVia | This property represents the [integration runtime](concepts-integration-runtime.md) to be used to connect to the data store. You can use Azure Integration Runtime or Self-hosted Integration Runtime (if your data store is located in private network). If not specified, it uses the default Azure Integration Runtime. |No |
78
164
79
-
A typical connection string is `Server=<server>.postgres.database.azure.com;Database=<database>;Port=<port>;UID=<username>;Password=<Password>`. Here are more properties you can set per your case:
165
+
A typical connection string is `host=<server>.postgres.database.azure.com;database=<database>;port=<port>;uid=<username>;password=<password>`. Here are more properties you can set per your case:
80
166
81
167
| Property | Description | Options | Required |
82
168
|:--- |:--- |:--- |:--- |
@@ -90,8 +176,9 @@ A typical connection string is `Server=<server>.postgres.database.azure.com;Data
For more information about the properties, see [Lookup activity](control-flow-lookup-activity.md).
374
462
463
+
464
+
## Upgrade the Azure Database for PostgreSQL connector
465
+
466
+
In **Edit linked service** page, select **2.0** under **Version** and configure the linked service by referring to [Linked service properties version 2.0](#version-20).
467
+
375
468
## Related content
376
469
For a list of data stores supported as sources and sinks by the copy activity, see [Supported data stores](copy-activity-overview.md#supported-data-stores-and-formats).
0 commit comments