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: articles/postgresql/single-server/connect-rust.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ ms.author: sunila
8
8
author: sunilagarwal
9
9
ms.devlang: rust
10
10
ms.custom: kr2b-contr-experiment
11
-
ms.date: 06/24/2022
11
+
ms.date: 01/29/2024
12
12
---
13
13
14
14
# Quickstart: Use Rust to interact with Azure Database for PostgreSQL - Single Server
@@ -25,7 +25,7 @@ For this quickstart, you need:
25
25
26
26
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free).
27
27
- A recent version of [Rust](https://www.rust-lang.org/tools/install) installed.
28
-
- An Azure Database for PostgreSQL single server. Create one using [Azure portal](./quickstart-create-server-database-portal.md) <br/> or [Azure CLI](./quickstart-create-server-database-azure-cli.md).
28
+
- An Azure Database for PostgreSQL single server. Create one using [Azure CLI](./quickstart-create-server-database-azure-cli.md).
29
29
- Based on whether you are using public or private access, complete **ONE** of the actions below to enable connectivity.
deleted item info: id = 4, name = item-4, quantity = 16
323
323
```
324
324
325
-
4. To confirm, you can also connect to Azure Database for PostgreSQL [using psql](./quickstart-create-server-database-portal.md#connect-to-the-server-with-psql) and run queries against the database, for example:
325
+
4. To confirm, you can also connect to Azure Database for PostgreSQL [using psql](./quickstart-create-server-database-azure-cli.md#connect-to-the-azure-database-for-postgresql-server-by-using-psql) and run queries against the database, for example:
Azure Database for PostgreSQL is a managed service that you use to run, manage, and scale highly available PostgreSQL databases in the cloud. This quickstart shows you how to create a single Azure Database for PostgreSQL server and connect to it.
20
-
21
-
## Prerequisites
22
-
23
-
An Azure subscription is required. If you don't have an Azure subscription, create a [free Azure account](https://azure.microsoft.com/free/) before you begin.
24
-
25
-
## Create an Azure Database for PostgreSQL server
26
-
27
-
Go to the [Azure portal](https://portal.azure.com/) to create an Azure Database for PostgreSQL Single Server database. Search for and select *Azure Database for PostgreSQL servers*.
28
-
29
-
>[!div class="mx-imgBorder"]
30
-
> :::image type="content" source="./media/quickstart-create-database-portal/search-postgres.png" alt-text="Find Azure Database for PostgreSQL.":::
31
-
32
-
1. Select **+ Create**.
33
-
34
-
2. On the Create an Azure Database for PostgreSQL page, select **Single server**.
35
-
36
-
>[!div class="mx-imgBorder"]
37
-
> :::image type="content" source="./media/quickstart-create-database-portal/select-single-server.png" alt-text="Select single server":::
38
-
39
-
3. Now enter the **Basics** form with the following information.
40
-
41
-
> [!div class="mx-imgBorder"]
42
-
> :::image type="content" source="./media/quickstart-create-database-portal/create-basics.png" alt-text="Screenshot that shows the Basics tab for creating a single server.":::
43
-
44
-
|Setting|Suggested value|Description|
45
-
|:---|:---|:---|
46
-
|Subscription|your subscription name|select the desired Azure Subscription.|
47
-
|Resource group|*myresourcegroup*| A new or an existing resource group from your subscription.|
48
-
|Server name |*mydemoserver*|A unique name that identifies your Azure Database for PostgreSQL server. The domain name *postgres.database.azure.com* is appended to the server name that you provide. The server can contain only lowercase letters, numbers, and the hyphen (-) character. It must contain 3 to 63 characters.|
49
-
|Data source | None | Select **None** to create a new server from scratch. Select **Backup** only if you were restoring from a geo-backup of an existing server.|
50
-
|Admin username |*myadmin*| Enter your server admin username. It can't start with **pg_** and these values are not allowed: **azure_superuser**, **azure_pg_admin**, **admin**, **administrator**, **root**, **guest**, or **public**.|
51
-
|Password |your password| A new password for the server admin user. It must contain 8 to 128 characters from three of the following categories: English uppercase letters, English lowercase letters, numbers (0 through 9), and non-alphanumeric characters (for example, !, $, #, %).|
52
-
|Location|your desired location| Select a location from the dropdown list.|
53
-
|Version|The latest major version| The latest PostgreSQL major version, unless you have specific requirements otherwise.|
54
-
|Compute + storage |*use the defaults*| The default pricing tier is **General Purpose** with **4 vCores** and **100 GB** storage. Backup retention is set to **7 days** with **Geographically Redundant** backup option.<br/>Learn about the [pricing](https://azure.microsoft.com/pricing/details/postgresql/server/) and update the defaults if needed.|
55
-
56
-
> [!NOTE]
57
-
> Consider using the Basic pricing tier if light compute and I/O are adequate for your workload. Note that servers created in the Basic pricing tier can't later be scaled to General Purpose or Memory Optimized.
58
-
59
-
5. Select **Review + create** to review your selections. Select **Create** to provision the server. This operation might take a few minutes.
60
-
> [!NOTE]
61
-
> An empty database, **postgres**, is created. You'll also find an **azure_maintenance** database that's used to separate the managed service processes from user actions. You can't access the **azure_maintenance** database.
[Having issues? Let us know.](https://aka.ms/postgres-doc-feedback)
67
-
68
-
## Configure a firewall rule
69
-
70
-
By default, the server that you create is not publicly accessible. You need to give permissions to your IP address. Go to your server resource in the Azure portal and select **Connection security** from left-side menu for your server resource. If you're not sure how to find your resource, see [Open resources](../../azure-resource-manager/management/manage-resources-portal.md#open-resources).
71
-
72
-
> [!div class="mx-imgBorder"]
73
-
> :::image type="content" source="./media/quickstart-create-database-portal/add-current-ip-firewall.png" alt-text="Screenshot that shows firewall rules for connection security.":::
74
-
75
-
Select **Add current client IP address**, and then select **Save**. You can add more IP addresses or provide an IP range to connect to your server from those IP addresses. For more information, see [Firewall rules in Azure Database for PostgreSQL](./concepts-firewall-rules.md).
76
-
77
19
> [!NOTE]
78
-
> To avoid connectivity issues, check if your network allows outbound traffic over port 5432. Azure Database for PostgreSQL uses that port.
79
-
80
-
[Having issues? Let us know.](https://aka.ms/postgres-doc-feedback)
81
-
82
-
## Connect to the server with psql
83
-
84
-
You can use [psql](http://postgresguide.com/utilities/psql.html) or [pgAdmin](https://www.pgadmin.org/docs/pgadmin4/latest/connecting.html), which are popular PostgreSQL clients. For this quickstart, we'll connect by using psql in [Azure Cloud Shell](../../cloud-shell/overview.md) within the Azure portal.
85
-
86
-
1. Make a note of your server name, server admin login name, password, and subscription ID for your newly created server from the **Overview** section of your server.
2. Open Azure Cloud Shell in the portal by selecting the icon on the upper-left side.
91
-
92
-
> [!NOTE]
93
-
> If you're opening Cloud Shell for the first time, you'll see a prompt to create a resource group and a storage account. This is a one-time step and will be automatically attached for all sessions.
94
-
95
-
> [!div class="mx-imgBorder"]
96
-
> :::image type="content" source="media/quickstart-create-database-portal/use-in-cloud-shell.png" alt-text="Screenshot that shows server information and the icon for opening Azure Cloud Shell.":::
97
-
98
-
3. Run the following command in the Azure Cloud Shell terminal. Replace values with your actual server name and admin user login name. Use the empty database **postgres** with admin user in this format: `<admin-username>@<servername>`.
4. In the same Azure Cloud Shell terminal, create a database called **guest**.
124
-
125
-
```bash
126
-
postgres=> CREATE DATABASE guest;
127
-
```
128
-
129
-
5. Switch connections to the newly created **guest** database.
130
-
131
-
```bash
132
-
\c guest
133
-
```
134
-
6. Type `\q`, and thenselectthe Enter key to close psql.
135
-
136
-
[Having issues? Let us know.](https://aka.ms/postgres-doc-feedback)
137
-
138
-
## Clean up resources
139
-
140
-
You've successfully created an Azure Database for PostgreSQL server in a resource group. If you don't expect to need these resources in the future, you can delete them by deleting either the resource group or the PostgreSQL server.
141
-
142
-
To delete the resource group:
143
-
144
-
1. In the Azure portal, search for and select**Resource groups**.
145
-
2. In the resource group list, choose the name of your resource group.
146
-
3. On the **Overview** page of your resource group, select**Delete resource group**.
147
-
4. In the confirmation dialog box, enter the name of your resource group, and thenselect**Delete**.
148
-
149
-
To delete the server, selectthe**Delete** button on the **Overview** page of your server:
150
-
151
-
> [!div class="mx-imgBorder"]
152
-
> :::image type="content" source="media/quickstart-create-database-portal/12-delete.png" alt-text="Screenshot that shows the button for deleting a server.":::
153
-
154
-
[Having issues? Let us know.](https://aka.ms/postgres-doc-feedback)
155
-
156
-
## Next steps
157
-
158
-
> [!div class="nextstepaction"]
159
-
> [Migrate your database using export and import](./how-to-migrate-using-export-and-import.md) <br/>
20
+
> Please be aware that as part of the ongoing retirement process for Azure Database for PostgreSQL - Single Server, the option to create new instances via the Azure portal is no longer available.
21
+
> While portal-based creation is discontinued, you can continue to create Single Server instances using methods such as [Azure CLI](quickstart-create-server-database-azure-cli.md), [Azure CLI up command](quickstart-create-server-up-azure-cli.md) or the [ARM template](quickstart-create-postgresql-server-database-using-arm-template.md). However, please note that as of March 2025, these methods will also no longer be used for creating new instances.
160
22
161
-
> [!div class="nextstepaction"]
162
-
> [Design a database](./tutorial-design-database-using-azure-portal.md#create-tables-in-the-database)
23
+
163
24
164
-
[Cannot find what you are looking for? Let us know.](https://aka.ms/postgres-doc-feedback)
0 commit comments