Skip to content

Commit e9f9620

Browse files
authored
Merge pull request #292250 from Clare-Zheng82/1219-Update_Azure_DB_PostgreSQL_v2
[New feature] Add Azure Database for PostgreSQL v2 content
2 parents 9ec2dae + 02c0c68 commit e9f9620

File tree

2 files changed

+103
-10
lines changed

2 files changed

+103
-10
lines changed

articles/data-factory/connector-azure-database-for-postgresql.md

Lines changed: 103 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: jianleishen
77
ms.subservice: data-movement
88
ms.topic: conceptual
99
ms.custom: synapse
10-
ms.date: 11/19/2024
10+
ms.date: 12/19/2024
1111
---
1212

1313
# 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
1616

1717
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).
1818

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+
1922
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).
2023

2124
## Supported capabilities
@@ -30,11 +33,10 @@ This Azure Database for PostgreSQL connector is supported for the following capa
3033

3134
*① Azure integration runtime ② Self-hosted integration runtime*
3235

33-
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/).
3437

35-
* [Single Server](/azure/postgresql/single-server/)
36-
* [Flexible Server](/azure/postgresql/flexible-server/)
37-
* [Hyperscale (Citus)](/azure/postgresql/hyperscale/)
38+
> [!IMPORTANT]
39+
> 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.
3840
3941
## Getting started
4042

@@ -68,15 +70,99 @@ The following sections offer details about properties that are used to define Da
6870

6971
## Linked service properties
7072

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:
7281

7382
| Property | Description | Required |
7483
|:--- |:--- |:--- |
7584
| 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 |
77163
| 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 |
78164

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:
80166

81167
| Property | Description | Options | Required |
82168
|:--- |:--- |:--- |:--- |
@@ -90,8 +176,9 @@ A typical connection string is `Server=<server>.postgres.database.azure.com;Data
90176
"name": "AzurePostgreSqlLinkedService",
91177
"properties": {
92178
"type": "AzurePostgreSql",
179+
"version": "1.0",
93180
"typeProperties": {
94-
"connectionString": "Server=<server>.postgres.database.azure.com;Database=<database>;Port=<port>;UID=<username>;Password=<Password>"
181+
"connectionString": "host=<server>.postgres.database.azure.com;database=<database>;port=<port>;uid=<username>;password=<password>"
95182
}
96183
}
97184
}
@@ -106,8 +193,9 @@ A typical connection string is `Server=<server>.postgres.database.azure.com;Data
106193
"name": "AzurePostgreSqlLinkedService",
107194
"properties": {
108195
"type": "AzurePostgreSql",
196+
"version": "1.0",
109197
"typeProperties": {
110-
"connectionString": "Server=<server>.postgres.database.azure.com;Database=<database>;Port=<port>;UID=<username>;",
198+
"connectionString": "host=<server>.postgres.database.azure.com;database=<database>;port=<port>;uid=<username>;",
111199
"password": { 
112200
"type": "AzureKeyVaultSecret", 
113201
"store": { 
@@ -372,5 +460,10 @@ IncomingStream sink(allowSchemaDrift: true,
372460

373461
For more information about the properties, see [Lookup activity](control-flow-lookup-activity.md).
374462

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+
375468
## Related content
376469
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).
Loading

0 commit comments

Comments
 (0)