-
Notifications
You must be signed in to change notification settings - Fork 498
/
Copy pathflexible-server.yml
1442 lines (1386 loc) · 74.2 KB
/
flexible-server.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
### YamlMime:AzureCLIGroup
uid: az_postgres_flexible-server
name: az postgres flexible-server
importantNote: >-
> [!NOTE]
> This command group has commands that are defined in both Azure CLI and at least one extension. Install each extension to benefit from its extended capabilities. [Learn more](https://learn.microsoft.com/cli/azure/azure-cli-extensions-overview) about extensions.
summary: |-
Manage Azure Database for PostgreSQL Flexible Servers.
status: GA
sourceType: Core and Extension
directCommands:
- uid: az_postgres_flexible-server_connect
name: az postgres flexible-server connect
summary: |-
Connect to a flexible server.
status: GA
sourceType: Extension
syntax: >-
az postgres flexible-server connect --admin-user
--name
[--admin-password]
[--database-name]
[--interactive]
[--querytext]
requiredParameters:
- isRequired: true
name: --admin-user -u
summary: |-
The login username of the administrator.
- isRequired: true
name: --name -n
summary: |-
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
optionalParameters:
- name: --admin-password -p
summary: |-
The login password of the administrator.
- name: --database-name -d
summary: |-
The name of a database.
- name: --interactive
summary: |-
Pass this parameter to connect to database in interactive mode.
- name: --querytext -q
summary: |-
A query to run against the flexible server.
isDeprecated: true
deprecateInfo: Argument 'querytext' has been deprecated and will be removed in a future release. Use 'execute' instead.
- uid: az_postgres_flexible-server_create
name: az postgres flexible-server create
summary: |-
Create a PostgreSQL flexible server.
description: |-
Create a PostgreSQL flexible server with custom or default configuration. For more information for network configuration, see
- Configure public access
https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-manage-firewall-cli
- Configure private access
https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-manage-virtual-network-cli.
status: GA
sourceType: Core
syntax: >-
az postgres flexible-server create [--active-directory-auth {Disabled, Enabled}]
[--address-prefixes]
[--admin-password]
[--admin-user]
[--backup-identity]
[--backup-key]
[--backup-retention]
[--cluster-option {ElasticCluster, Server}]
[--create-default-database {Disabled, Enabled}]
[--database-name]
[--geo-redundant-backup {Disabled, Enabled}]
[--high-availability {Disabled, SameZone, ZoneRedundant}]
[--identity]
[--iops]
[--key]
[--location]
[--name]
[--node-count]
[--password-auth {Disabled, Enabled}]
[--performance-tier]
[--private-dns-zone]
[--public-access]
[--resource-group]
[--sku-name]
[--standby-zone]
[--storage-auto-grow {Disabled, Enabled}]
[--storage-size]
[--storage-type {PremiumV2_LRS, Premium_LRS}]
[--subnet]
[--subnet-prefixes]
[--tags]
[--throughput]
[--tier]
[--version]
[--vnet]
[--yes]
[--zone]
examples:
- summary: |-
Create a PostgreSQL flexible server with custom parameters
syntax: >-
az postgres flexible-server create --location northeurope --resource-group testGroup \
--name testserver --admin-user username --admin-password password \
--sku-name Standard_D2s_v3 --tier GeneralPurpose --public-access 153.24.26.117 --storage-size 128 \
--tags "key=value" --version 17 --high-availability ZoneRedundant --zone 1 \
--standby-zone 3
- summary: |-
Create a PostgreSQL flexible server using Premium SSD v2 Disks.
syntax: >-
# set storage type to "PremiumV2_LRS" and provide values for Storage size (in GiB), IOPS (operations/sec), and Throughput (MB/sec).
az postgres flexible-server create --location northeurope --resource-group testGroup \
--name testserver --admin-user username --admin-password password \
--sku-name Standard_B1ms --tier Burstable --storage-type PremiumV2_LRS --storage-size 128 --iops 3000 --throughput 125
- summary: |-
Create a PostgreSQL flexible server with default parameters and public access enabled by default. Resource group, server name, username, password, and default database will be created by CLI
syntax: az postgres flexible-server create
- summary: |-
Create a PostgreSQL flexible server with public access and add the range of IP address to have access to this server. The --public-access parameter can be 'Disabled', 'Enabled', 'All', 'None', <startIpAddress>, or <startIpAddress>-<endIpAddress>
syntax: az postgres flexible-server create --resource-group testGroup --name testserver --public-access 125.23.54.31-125.23.54.35
- summary: |-
Create a PostgreSQL flexible server with private access. If provided virtual network and subnet do not exists, virtual network and subnet with the specified address prefixes will be created.
syntax: az postgres flexible-server create --resource-group testGroup --name testserver --vnet myVnet --subnet mySubnet --address-prefixes 10.0.0.0/16 --subnet-prefixes 10.0.0.0/24
- summary: |-
Create a PostgreSQL flexible server using a new subnet resource ID and new private DNS zone resource ID. The subnet and DNS zone can be created in different subscription or resource group.
syntax: >-
az postgres flexible-server create \
--resource-group testGroup --name testserver \
--subnet /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNetName}/subnets/{SubnetName} \
--private-dns-zone /subscriptions/{SubID}/resourceGroups/{resourceGroup}/providers/Microsoft.Network/privateDnsZones/testPostgreSQLFlexibleDnsZone.private.postgres.database.azure.com \
--address-prefixes 172.0.0.0/16 --subnet-prefixes 172.0.0.0/24
- summary: |-
Create a PostgreSQL flexible server using existing network resources in the same resource group. The provided subnet should not have any other resource deployed in it and this subnet will be delegated to Microsoft.DBforPostgreSQL/flexibleServers, if not already delegated. The private DNS zone will be linked to the virtual network if not already linked.
syntax: >-
# create vnet
az network vnet create --resource-group testGroup --name testVnet --location testLocation --address-prefixes 172.0.0.0/16
# create subnet
az network vnet subnet create --resource-group testGroup --vnet-name testVnet --address-prefixes 172.0.0.0/24 --name testSubnet
# create private dns zone
az network private-dns zone create -g testGroup -n testDNS.private.postgres.database.azure.com
az postgres flexible-server create --resource-group testGroup \
--name testserver --location testLocation \
--subnet /subscriptions/{SubId}/resourceGroups/{testGroup}/providers/Microsoft.Network/virtualNetworks/tesetVnet/subnets/testSubnet \
--private-dns-zone /subscriptions/{SubId}/resourceGroups/{testGroup}/providers/Microsoft.Network/privateDnsZones/testDNS.postgres.database.azure.com\
az postgres flexible-server create --resource-group testGroup --name testserver \
--vnet testVnet --subnet testSubnet --location testLocation \
--private-dns-zone /subscriptions/{SubId}/resourceGroups/{testGroup}/providers/Microsoft.Network/privateDnsZones/testDNS.postgres.database.azure.com
- summary: |-
Create a PostgreSQL flexible server using existing network resources in the different resource group / subscription.
syntax: >-
az postgres flexible-server create --resource-group testGroup \
--name testserver --location testLocation \
--subnet /subscriptions/{SubId2}/resourceGroups/{testGroup2}/providers/Microsoft.Network/virtualNetworks/tesetVnet/subnets/testSubnet \
--private-dns-zone /subscriptions/{SubId2}/resourceGroups/{testGroup2}/providers/Microsoft.Network/privateDnsZones/testDNS.postgres.database.azure.com
- summary: |-
Create a PostgreSQL flexible server with data encryption.
syntax: >-
# create keyvault
az keyvault create -g testGroup -n testVault --location testLocation \
--enable-purge-protection true
# create key in keyvault and save its key identifier
keyIdentifier=$(az keyvault key create --name testKey -p software \
--vault-name testVault --query key.kid -o tsv)
# create identity and save its principalId
identityPrincipalId=$(az identity create -g testGroup --name testIdentity \
--location testLocation --query principalId -o tsv)
# add testIdentity as an access policy with key permissions 'Wrap Key', 'Unwrap Key', 'Get' and 'List' inside testVault
az keyvault set-policy -g testGroup -n testVault --object-id $identityPrincipalId \
--key-permissions wrapKey unwrapKey get list
# create flexible server with data encryption enabled
az postgres flexible-server create -g testGroup -n testServer --location testLocation \
--key $keyIdentifier --identity testIdentity
- summary: |-
Create a PostgreSQL flexible server with active directory auth as well as password auth.
syntax: >-
# create flexible server with aad auth and password auth enabled
az postgres flexible-server create -g testGroup -n testServer --location testLocation \
--active-directory-auth Enabled
- summary: |-
Create a PostgreSQL flexible server with active directory auth only.
syntax: >-
# create flexible server with aad only auth and password auth disabled
az postgres flexible-server create -g testGroup -n testServer --location testLocation \
--active-directory-auth Enabled --password-auth Disabled
- summary: |-
Create a PostgreSQL flexible server with public access, geo-redundant backup enabled and add the range of IP address to have access to this server. The --public-access parameter can be 'All', 'None', <startIpAddress>, or <startIpAddress>-<endIpAddress>
syntax: az postgres flexible-server create --resource-group testGroup --name testserver --geo-redundant-backup Enabled --public-access 125.23.54.31-125.23.54.35
- summary: |-
Create a PostgreSQL flexible server with data encryption for geo-rundundant backup enabled server.
syntax: >-
# create keyvault
az keyvault create -g testGroup -n testVault --location testLocation \
--enable-purge-protection true
# create key in keyvault and save its key identifier
keyIdentifier=$(az keyvault key create --name testKey -p software \
--vault-name testVault --query key.kid -o tsv)
# create identity and save its principalId
identityPrincipalId=$(az identity create -g testGroup --name testIdentity \
--location testLocation --query principalId -o tsv)
# add testIdentity as an access policy with key permissions 'Wrap Key', 'Unwrap Key', 'Get' and 'List' inside testVault
az keyvault set-policy -g testGroup -n testVault --object-id $identityPrincipalId \
--key-permissions wrapKey unwrapKey get list
# create keyvault in geo-paired region
az keyvault create -g testGroup -n geoVault --location geoPairedLocation \
--enable-purge-protection true
# create key in keyvault and save its key identifier
geoKeyIdentifier=$(az keyvault key create --name geoKey -p software \
--vault-name geoVault --query key.kid -o tsv)
# create identity in geo-raired location and save its principalId
geoIdentityPrincipalId=$(az identity create -g testGroup --name geoIdentity \
--location geoPairedLocation --query principalId -o tsv)
# add testIdentity as an access policy with key permissions 'Wrap Key', 'Unwrap Key', 'Get' and 'List' inside testVault
az keyvault set-policy -g testGroup -n geoVault --object-id $geoIdentityPrincipalId \
--key-permissions wrapKey unwrapKey get list
# create flexible server with data encryption enabled for geo-backup Enabled server
az postgres flexible-server create -g testGroup -n testServer --location testLocation --geo-redundant-backup Enabled \
--key $keyIdentifier --identity testIdentity --backup-key $geoKeyIdentifier --backup-identity geoIdentity
- summary: |-
Create flexible server with custom storage performance tier. Accepted values "P4", "P6", "P10", "P15", "P20", "P30", \ "P40", "P50", "P60", "P70", "P80". Actual allowed values depend on the --storage-size selection for flexible server creation. \ Default value for storage performance tier depends on the --storage-size selected for flexible server creation.
syntax: az postgres flexible-server create -g testGroup -n testServer --location testLocation --performance-tier P15
- summary: |-
Create flexible server with storage auto-grow as Enabled. Accepted values Enabled / Disabled. Default value for storage auto-grow is "Disabled".
syntax: az postgres flexible-server create -g testGroup -n testServer --location testLocation --storage-auto-grow Enabled
- summary: |-
Create elastic cluster with node count of 5. Default node count is 2 when --cluster-option is "ElasticCluster".
syntax: az postgres flexible-server create -g testGroup -n testCluster --location testLocation --cluster-option ElasticCluster --node-count 5
optionalParameters:
- name: --active-directory-auth
defaultValue: "Disabled"
parameterValueGroup: "Disabled, Enabled"
summary: |-
Whether Azure Active Directory authentication is enabled.
- name: --address-prefixes
summary: |-
The IP address prefix to use when creating a new virtual network in CIDR format. Default value is 10.0.0.0/16.
- name: --admin-password -p
summary: |-
The password of the administrator. Minimum 8 characters and maximum 128 characters. Password must contain characters from three of the following categories: English uppercase letters, English lowercase letters, numbers, and non-alphanumeric characters.
- name: --admin-user -u
defaultValue: "sadcoconut7"
summary: |-
Administrator username for the server. Once set, it cannot be changed.
- name: --backup-identity
summary: |-
The name or resource ID of the geo backup user identity for data encryption. The identity needs to be in the same region as the backup region.
- name: --backup-key
summary: |-
The resource ID of the geo backup keyvault key for data encryption. The key needs to be in the same region as the backup region.
- name: --backup-retention
defaultValue: "7"
summary: |-
The number of days a backup is retained. Range of 7 to 35 days. Default is 7 days.
- name: --cluster-option
defaultValue: "Server"
parameterValueGroup: "ElasticCluster, Server"
summary: |-
Cluster option for the server. Servers are for workloads that can fit on one node. Elastic clusters provides schema- and row-based sharding on a database. Default value is Server.
- name: --create-default-database -c
defaultValue: "Enabled"
parameterValueGroup: "Disabled, Enabled"
summary: |-
Enable or disable the creation of default database flexibleserverdb. Default value is Enabled.
- name: --database-name -d
summary: |-
The name of the database to be created when provisioning the database server.
- name: --geo-redundant-backup
defaultValue: "Disabled"
parameterValueGroup: "Disabled, Enabled"
summary: |-
Whether or not geo redundant backup is enabled.
- name: --high-availability
defaultValue: "Disabled"
parameterValueGroup: "Disabled, SameZone, ZoneRedundant"
summary: |-
Enable (ZoneRedundant or SameZone) or disable high availability feature.
- name: --identity
summary: |-
The name or resource ID of the user assigned identity for data encryption.
- name: --iops
summary: |-
Value of IOPS in (operations/sec) to be allocated for this server. This value can only be updated if flexible server is using Premium SSD v2 Disks.
- name: --key
summary: |-
The resource ID of the primary keyvault key for data encryption.
- name: --location -l
summary: |-
Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=<location>`.
- name: --name -n
summary: |-
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
- name: --node-count
summary: |-
The number of nodes for elastic cluster. Range of 1 to 10. Default is 2 nodes.
- name: --password-auth
defaultValue: "Enabled"
parameterValueGroup: "Disabled, Enabled"
summary: |-
Whether password authentication is enabled.
- name: --performance-tier
summary: |-
Performance tier of the server.
- name: --private-dns-zone
summary: |-
This parameter only applies for a server with private access. The name or id of new or existing private dns zone. You can use the private dns zone from same resource group, different resource group, or different subscription. If you want to use a zone from different resource group or subscription, please provide resource Id. CLI creates a new private dns zone within the same resource group as virtual network if not provided by users.
- name: --public-access
summary: |-
Determines the public access. Enter single or range of IP addresses to be included in the allowed list of IPs. IP address ranges must be dash-separated and not contain any spaces. Specifying 0.0.0.0 allows public access from any resources deployed within Azure to access your server. Setting it to "None" sets the server in public access mode but does not create a firewall rule. Acceptable values are 'Disabled', 'Enabled', 'All', 'None','{startIP}' and '{startIP}-{destinationIP}' where startIP and destinationIP ranges from 0.0.0.0 to 255.255.255.255.
- name: --resource-group -g
summary: |-
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.
- name: --sku-name
defaultValue: "Standard_D2s_v3"
summary: |-
The name of the compute SKU. Follows the convention Standard_{VM name}. Examples: Standard_B1ms.
- name: --standby-zone
summary: |-
The availability zone information of the standby server when high availability is enabled.
- name: --storage-auto-grow
defaultValue: "Disabled"
parameterValueGroup: "Disabled, Enabled"
summary: |-
Enable or disable autogrow of the storage. Default value is Enabled.
- name: --storage-size
defaultValue: "128"
summary: |-
The storage capacity of the server. Minimum is 32 GiB and max is 16 TiB.
- name: --storage-type
parameterValueGroup: "PremiumV2_LRS, Premium_LRS"
summary: |-
Storage type for the server. Allowed values are Premium_LRS and PremiumV2_LRS. Default value is Premium_LRS.Must set iops and throughput if using PremiumV2_LRS.
- name: --subnet
summary: |-
Name or resource ID of a new or existing subnet. If you want to use a subnet from different resource group or subscription, please provide resource ID instead of name. Please note that the subnet will be delegated to flexibleServers. After delegation, this subnet cannot be used for any other type of Azure resources.
- name: --subnet-prefixes
summary: |-
The subnet IP address prefix to use when creating a new subnet in CIDR format. Default value is 10.0.0.0/24.
- name: --tags
summary: |-
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
- name: --throughput
summary: |-
Storage throughput in (MB/sec) for the server. This value can only be updated if flexible server is using Premium SSD v2 Disks.
- name: --tier
defaultValue: "GeneralPurpose"
summary: |-
Compute tier of the server. Accepted values: Burstable, GeneralPurpose, MemoryOptimized.
- name: --version
defaultValue: "16"
summary: |-
Server major version.
- name: --vnet
summary: |-
Name or ID of a new or existing virtual network. If you want to use a vnet from different resource group or subscription, please provide a resource ID. The name must be between 2 to 64 characters. The name must begin with a letter or number, end with a letter, number or underscore, and may contain only letters, numbers, underscores, periods, or hyphens.
- name: --yes -y
defaultValue: "False"
summary: |-
Do not prompt for confirmation.
- name: --zone -z
summary: |-
Availability zone into which to provision the resource.
- uid: az_postgres_flexible-server_delete
name: az postgres flexible-server delete
summary: |-
Delete a flexible server.
status: GA
sourceType: Core
syntax: >-
az postgres flexible-server delete [--ids]
[--name]
[--resource-group]
[--subscription]
[--yes]
examples:
- summary: |-
Delete a flexible server.
syntax: az postgres flexible-server delete --resource-group testGroup --name testserver
- summary: |-
Delete a flexible server without prompt or confirmation.
syntax: az postgres flexible-server delete --resource-group testGroup --name testserver --yes
optionalParameters:
- name: --ids
summary: |-
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
- name: --name -n
summary: |-
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
- name: --resource-group -g
summary: |-
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.
- name: --subscription
summary: |-
Name or ID of subscription. You can configure the default subscription using `az account set -s NAME_OR_ID`.
- name: --yes -y
defaultValue: "False"
summary: |-
Do not prompt for confirmation.
- uid: az_postgres_flexible-server_execute
name: az postgres flexible-server execute
summary: |-
Connect to a flexible server.
status: GA
sourceType: Extension
syntax: >-
az postgres flexible-server execute --admin-password
--admin-user
--name
[--database-name]
[--file-path]
[--querytext]
requiredParameters:
- isRequired: true
name: --admin-password -p
summary: |-
The login password of the administrator.
- isRequired: true
name: --admin-user -u
summary: |-
The login username of the administrator.
- isRequired: true
name: --name -n
summary: |-
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
optionalParameters:
- name: --database-name -d
summary: |-
The name of a database.
- name: --file-path -f
summary: |-
The path of the sql file to execute.
- name: --querytext -q
summary: |-
A query to run against the flexible server.
- uid: az_postgres_flexible-server_geo-restore
name: az postgres flexible-server geo-restore
summary: |-
Geo-restore a flexible server from backup.
status: GA
sourceType: Core
syntax: >-
az postgres flexible-server geo-restore --location
--source-server
[--address-prefixes]
[--backup-identity]
[--backup-key]
[--geo-redundant-backup {Disabled, Enabled}]
[--identity]
[--ids]
[--key]
[--name]
[--no-wait]
[--private-dns-zone]
[--resource-group]
[--restore-time]
[--subnet]
[--subnet-prefixes]
[--subscription]
[--vnet]
[--yes]
[--zone]
examples:
- summary: |-
Geo-restore public access server 'testserver' to a new server 'testserverNew' in location 'newLocation' with public access.
syntax: az postgres flexible-server geo-restore --resource-group testGroup --name testserverNew --source-server testserver --location newLocation
- summary: |-
Geo-restore private access server 'testserver' as a new server 'testserverNew' with new subnet. New vnet, subnet, and private dns zone for the restored server will be provisioned. Please refer to 'flexible-server create' command for more private access scenarios.
syntax: >-
az postgres flexible-server geo-restore --resource-group testGroup --name testserverNew \
--source-server testserver --vnet newVnet --subnet newSubnet \
--address-prefixes 172.0.0.0/16 --subnet-prefixes 172.0.0.0/24 \
--private-dns-zone testDNS.postgres.database.azure.com --location newLocation
- summary: |-
Geo-restore 'testserver' to current point-in-time as a new server 'testserverNew' in a different subscription / resource group. \ Here --resource-group is for the target server's resource group, and --source-server must be passed as resource ID. \ This resource ID can be in a subscription different than the subscription used for az account set.
syntax: >-
az postgres flexible-server geo-restore --resource-group testGroup --name testserverNew --location newLocation \
--source-server /subscriptions/{sourceSubscriptionId}/resourceGroups/{sourceResourceGroup}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{sourceServerName}
requiredParameters:
- isRequired: true
name: --location -l
summary: |-
Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=<location>`.
- isRequired: true
name: --source-server
summary: |-
The name or resource ID of the source server to restore from.
optionalParameters:
- name: --address-prefixes
summary: |-
The IP address prefix to use when creating a new virtual network in CIDR format. Default value is 10.0.0.0/16.
- name: --backup-identity
summary: |-
The name or resource ID of the geo backup user identity for data encryption. The identity needs to be in the same region as the backup region.
- name: --backup-key
summary: |-
The resource ID of the geo backup keyvault key for data encryption. The key needs to be in the same region as the backup region.
- name: --geo-redundant-backup
defaultValue: "Disabled"
parameterValueGroup: "Disabled, Enabled"
summary: |-
Whether or not geo redundant backup is enabled.
- name: --identity
summary: |-
The name or resource ID of the user assigned identity for data encryption.
- name: --ids
summary: |-
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
- name: --key
summary: |-
The resource ID of the primary keyvault key for data encryption.
- name: --name -n
summary: |-
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
- name: --no-wait
defaultValue: "False"
summary: |-
Do not wait for the long-running operation to finish.
- name: --private-dns-zone
summary: |-
This parameter only applies for a server with private access. The name or id of new or existing private dns zone. You can use the private dns zone from same resource group, different resource group, or different subscription. If you want to use a zone from different resource group or subscription, please provide resource Id. CLI creates a new private dns zone within the same resource group as virtual network if not provided by users.
- name: --resource-group -g
summary: |-
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.
- name: --restore-time
defaultValue: "2025-03-05T11:15:57+00:00"
summary: |-
The point in time in UTC to restore from (ISO8601 format), e.g., 2017-04-26T02:10:00+00:00The default value is set to current time.
- name: --subnet
summary: |-
Name or resource ID of a new or existing subnet. If you want to use a subnet from different resource group or subscription, please provide resource ID instead of name. Please note that the subnet will be delegated to flexibleServers. After delegation, this subnet cannot be used for any other type of Azure resources.
- name: --subnet-prefixes
summary: |-
The subnet IP address prefix to use when creating a new subnet in CIDR format. Default value is 10.0.0.0/24.
- name: --subscription
summary: |-
Name or ID of subscription. You can configure the default subscription using `az account set -s NAME_OR_ID`.
- name: --vnet
summary: |-
Name or ID of a new or existing virtual network. If you want to use a vnet from different resource group or subscription, please provide a resource ID. The name must be between 2 to 64 characters. The name must begin with a letter or number, end with a letter, number or underscore, and may contain only letters, numbers, underscores, periods, or hyphens.
- name: --yes -y
defaultValue: "False"
summary: |-
Do not prompt for confirmation.
- name: --zone -z
summary: |-
Availability zone into which to provision the resource.
- uid: az_postgres_flexible-server_list
name: az postgres flexible-server list
summary: |-
List available flexible servers.
status: GA
sourceType: Core
syntax: >-
az postgres flexible-server list [--resource-group]
[--show-cluster]
examples:
- summary: |-
List all PostgreSQL flexible servers in a subscription.
syntax: az postgres flexible-server list
- summary: |-
List all PostgreSQL flexible servers in a resource group.
syntax: az postgres flexible-server list --resource-group testGroup
- summary: |-
List all PostgreSQL flexible servers in a resource group in table format.
syntax: az postgres flexible-server list --resource-group testGroup --output table
optionalParameters:
- name: --resource-group -g
summary: |-
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.
- name: --show-cluster
summary: |-
Only show elastic clusters.
- uid: az_postgres_flexible-server_list-skus
name: az postgres flexible-server list-skus
summary: |-
Lists available sku's in the given region.
status: GA
sourceType: Core
syntax: az postgres flexible-server list-skus --location
requiredParameters:
- isRequired: true
name: --location -l
summary: |-
Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=<location>`.
- uid: az_postgres_flexible-server_restart
name: az postgres flexible-server restart
summary: |-
Restart a flexible server.
status: GA
sourceType: Core
syntax: >-
az postgres flexible-server restart [--failover]
[--ids]
[--name]
[--resource-group]
[--subscription]
examples:
- summary: |-
Restart a flexible server.
syntax: az postgres flexible-server restart --resource-group testGroup --name testserver
- summary: |-
Restart a server with planned failover
syntax: az postgres flexible-server restart --resource-group testGroup --name testserver --failover Planned
- summary: |-
Restart a server with forced failover
syntax: az postgres flexible-server restart --resource-group testGroup --name testserver --failover Forced
optionalParameters:
- name: --failover
summary: |-
Forced or planned failover for server restart operation. Allowed values: Forced, Planned.
- name: --ids
summary: |-
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
- name: --name -n
summary: |-
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
- name: --resource-group -g
summary: |-
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.
- name: --subscription
summary: |-
Name or ID of subscription. You can configure the default subscription using `az account set -s NAME_OR_ID`.
- uid: az_postgres_flexible-server_restore
name: az postgres flexible-server restore
summary: |-
Restore a flexible server from backup.
status: GA
sourceType: Core
syntax: >-
az postgres flexible-server restore --source-server
[--address-prefixes]
[--backup-identity]
[--backup-key]
[--geo-redundant-backup {Disabled, Enabled}]
[--identity]
[--ids]
[--key]
[--name]
[--no-wait]
[--private-dns-zone]
[--resource-group]
[--restore-time]
[--storage-type {PremiumV2_LRS}]
[--subnet]
[--subnet-prefixes]
[--subscription]
[--vnet]
[--yes]
[--zone]
examples:
- summary: |-
Restore 'testserver' to a specific point-in-time as a new server 'testserverNew'.
syntax: az postgres flexible-server restore --resource-group testGroup --name testserverNew --source-server testserver --restore-time "2017-06-15T13:10:00Z"
- summary: |-
Restore 'testserver' to current point-in-time as a new server 'testserverNew'.
syntax: az postgres flexible-server restore --resource-group testGroup --name testserverNew --source-server testserver
- summary: |-
Restore 'testserver' to current point-in-time as a new server 'testserverNew' in a different resource group. \ Here --resource-group is for the target server's resource group, and --source-server must be passed as resource ID.
syntax: >-
az postgres flexible-server restore --resource-group testGroup --name testserverNew \
--source-server /subscriptions/{testSubscription}/resourceGroups/{sourceResourceGroup}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{sourceServerName}
- summary: |-
Restore 'testserver' to current point-in-time as a new server 'testserverNew' in a different subscription. \ Here --resource-group is for the target server's resource group, and --source-server must be passed as resource ID. \ This resource ID can be in a subscription different than the subscription used for az account set.
syntax: >-
az postgres flexible-server restore --resource-group testGroup --name testserverNew \
--source-server /subscriptions/{sourceSubscriptionId}/resourceGroups/{sourceResourceGroup}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{sourceServerName}
- summary: |-
Restore 'testserver' to current point-in-time as a new server 'testserverNew' using Premium SSD v2 Disks by setting storage type to "PremiumV2_LRS"
syntax: az postgres flexible-server restore --resource-group testGroup --name testserverNew --source-server testserver --storage-type PremiumV2_LRS
requiredParameters:
- isRequired: true
name: --source-server
summary: |-
The name or resource ID of the source server to restore from.
optionalParameters:
- name: --address-prefixes
summary: |-
The IP address prefix to use when creating a new virtual network in CIDR format. Default value is 10.0.0.0/16.
- name: --backup-identity
summary: |-
The name or resource ID of the geo backup user identity for data encryption. The identity needs to be in the same region as the backup region.
- name: --backup-key
summary: |-
The resource ID of the geo backup keyvault key for data encryption. The key needs to be in the same region as the backup region.
- name: --geo-redundant-backup
defaultValue: "Disabled"
parameterValueGroup: "Disabled, Enabled"
summary: |-
Whether or not geo redundant backup is enabled.
- name: --identity
summary: |-
The name or resource ID of the user assigned identity for data encryption.
- name: --ids
summary: |-
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
- name: --key
summary: |-
The resource ID of the primary keyvault key for data encryption.
- name: --name -n
summary: |-
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
- name: --no-wait
defaultValue: "False"
summary: |-
Do not wait for the long-running operation to finish.
- name: --private-dns-zone
summary: |-
This parameter only applies for a server with private access. The name or id of new or existing private dns zone. You can use the private dns zone from same resource group, different resource group, or different subscription. If you want to use a zone from different resource group or subscription, please provide resource Id. CLI creates a new private dns zone within the same resource group as virtual network if not provided by users.
- name: --resource-group -g
summary: |-
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.
- name: --restore-time
defaultValue: "2025-03-05T11:15:57+00:00"
summary: |-
The point in time in UTC to restore from (ISO8601 format), e.g., 2017-04-26T02:10:00+00:00The default value is set to current time.
- name: --storage-type
parameterValueGroup: "PremiumV2_LRS"
summary: |-
Storage type for the new server. Allowed value is PremiumV2_LRS. Default value is none.
- name: --subnet
summary: |-
Name or resource ID of a new or existing subnet. If you want to use a subnet from different resource group or subscription, please provide resource ID instead of name. Please note that the subnet will be delegated to flexibleServers. After delegation, this subnet cannot be used for any other type of Azure resources.
- name: --subnet-prefixes
summary: |-
The subnet IP address prefix to use when creating a new subnet in CIDR format. Default value is 10.0.0.0/24.
- name: --subscription
summary: |-
Name or ID of subscription. You can configure the default subscription using `az account set -s NAME_OR_ID`.
- name: --vnet
summary: |-
Name or ID of a new or existing virtual network. If you want to use a vnet from different resource group or subscription, please provide a resource ID. The name must be between 2 to 64 characters. The name must begin with a letter or number, end with a letter, number or underscore, and may contain only letters, numbers, underscores, periods, or hyphens.
- name: --yes -y
defaultValue: "False"
summary: |-
Do not prompt for confirmation.
- name: --zone -z
summary: |-
Availability zone into which to provision the resource.
- uid: az_postgres_flexible-server_revive-dropped
name: az postgres flexible-server revive-dropped
summary: |-
Revive a dropped flexible server from backup.
status: GA
sourceType: Core
syntax: >-
az postgres flexible-server revive-dropped --location
--source-server
[--address-prefixes]
[--backup-identity]
[--backup-key]
[--geo-redundant-backup {Disabled, Enabled}]
[--identity]
[--ids]
[--key]
[--name]
[--no-wait]
[--private-dns-zone]
[--resource-group]
[--subnet]
[--subnet-prefixes]
[--subscription]
[--vnet]
[--yes]
[--zone]
examples:
- summary: |-
Revive dropped public access server 'testserver' to a new server 'testserverNew' in location 'newLocation' with public access.
syntax: az postgres flexible-server revive-dropped --resource-group testGroup --name testserverNew --source-server /subscriptions/{SubId}/resourceGroups/{testGroup}/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver --location newLocation
- summary: |-
Revive dropped public access server 'testserver' with data encryption enabled as a new server 'testserverNew' with data encryption.
syntax: >-
az postgres flexible-server revive-dropped -l testLocation --resource-group testGroup --name testserverNew \
--source-server testserver --key newKeyIdentifier --identity newIdentity
requiredParameters:
- isRequired: true
name: --location -l
summary: |-
Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=<location>`.
- isRequired: true
name: --source-server
summary: |-
The name or resource ID of the source server to restore from.
optionalParameters:
- name: --address-prefixes
summary: |-
The IP address prefix to use when creating a new virtual network in CIDR format. Default value is 10.0.0.0/16.
- name: --backup-identity
summary: |-
The name or resource ID of the geo backup user identity for data encryption. The identity needs to be in the same region as the backup region.
- name: --backup-key
summary: |-
The resource ID of the geo backup keyvault key for data encryption. The key needs to be in the same region as the backup region.
- name: --geo-redundant-backup
defaultValue: "Disabled"
parameterValueGroup: "Disabled, Enabled"
summary: |-
Whether or not geo redundant backup is enabled.
- name: --identity
summary: |-
The name or resource ID of the user assigned identity for data encryption.
- name: --ids
summary: |-
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
- name: --key
summary: |-
The resource ID of the primary keyvault key for data encryption.
- name: --name -n
summary: |-
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
- name: --no-wait
defaultValue: "False"
summary: |-
Do not wait for the long-running operation to finish.
- name: --private-dns-zone
summary: |-
This parameter only applies for a server with private access. The name or id of new or existing private dns zone. You can use the private dns zone from same resource group, different resource group, or different subscription. If you want to use a zone from different resource group or subscription, please provide resource Id. CLI creates a new private dns zone within the same resource group as virtual network if not provided by users.
- name: --resource-group -g
summary: |-
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.
- name: --subnet
summary: |-
Name or resource ID of a new or existing subnet. If you want to use a subnet from different resource group or subscription, please provide resource ID instead of name. Please note that the subnet will be delegated to flexibleServers. After delegation, this subnet cannot be used for any other type of Azure resources.
- name: --subnet-prefixes
summary: |-
The subnet IP address prefix to use when creating a new subnet in CIDR format. Default value is 10.0.0.0/24.
- name: --subscription
summary: |-
Name or ID of subscription. You can configure the default subscription using `az account set -s NAME_OR_ID`.
- name: --vnet
summary: |-
Name or ID of a new or existing virtual network. If you want to use a vnet from different resource group or subscription, please provide a resource ID. The name must be between 2 to 64 characters. The name must begin with a letter or number, end with a letter, number or underscore, and may contain only letters, numbers, underscores, periods, or hyphens.
- name: --yes -y
defaultValue: "False"
summary: |-
Do not prompt for confirmation.
- name: --zone -z
summary: |-
Availability zone into which to provision the resource.
- uid: az_postgres_flexible-server_show
name: az postgres flexible-server show
summary: |-
Get the details of a flexible server.
status: GA
sourceType: Core
syntax: >-
az postgres flexible-server show [--ids]
[--name]
[--resource-group]
[--subscription]
examples:
- summary: |-
Get the details of a flexible server
syntax: az postgres flexible-server show --resource-group testGroup --name testserver
optionalParameters:
- name: --ids
summary: |-
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
- name: --name -n
summary: |-
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
- name: --resource-group -g
summary: |-
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.
- name: --subscription
summary: |-
Name or ID of subscription. You can configure the default subscription using `az account set -s NAME_OR_ID`.
- uid: az_postgres_flexible-server_show-connection-string
name: az postgres flexible-server show-connection-string
summary: |-
Show the connection strings for a PostgreSQL flexible-server database.
status: GA
sourceType: Core
syntax: >-
az postgres flexible-server show-connection-string [--admin-password]
[--admin-user]
[--database-name]
[--ids]
[--pg-bouncer]
[--server-name]
[--subscription]
examples:
- summary: |-
Show connection strings for cmd and programming languages.
syntax: az postgres flexible-server show-connection-string -s testserver -u username -p password -d databasename
- summary: |-
Show connection strings for cmd and programming languages with PgBouncer enabled.
syntax: az postgres flexible-server show-connection-string -s testserver -u username -p password -d databasename --pg-bouncer
optionalParameters:
- name: --admin-password -p
defaultValue: "{password}"
summary: |-
The password of the administrator. Minimum 8 characters and maximum 128 characters. Password must contain characters from three of the following categories: English uppercase letters, English lowercase letters, numbers, and non-alphanumeric characters.
- name: --admin-user -u
defaultValue: "{login}"
summary: |-
Administrator username for the server. Once set, it cannot be changed.
- name: --database-name -d
defaultValue: "{database}"
summary: |-
The name of the database to be created when provisioning the database server.
- name: --ids
summary: |-
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
- name: --pg-bouncer
defaultValue: "False"
summary: |-
Show connection strings for PgBouncer.
- name: --server-name -s
defaultValue: "{server}"
summary: |-
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
- name: --subscription
summary: |-
Name or ID of subscription. You can configure the default subscription using `az account set -s NAME_OR_ID`.
- uid: az_postgres_flexible-server_start
name: az postgres flexible-server start
summary: |-
Start a flexible server.
status: GA
sourceType: Core
syntax: >-
az postgres flexible-server start [--ids]
[--name]
[--no-wait]
[--resource-group]
[--subscription]
examples:
- summary: |-
Start a flexible server.
syntax: az postgres flexible-server start --resource-group testGroup --name testserver
optionalParameters:
- name: --ids
summary: |-
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
- name: --name -n
summary: |-
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
- name: --no-wait
defaultValue: "False"
summary: |-
Do not wait for the long-running operation to finish.
- name: --resource-group -g
summary: |-
Name of resource group. You can configure the default group using `az configure --defaults group=<name>`.
- name: --subscription
summary: |-
Name or ID of subscription. You can configure the default subscription using `az account set -s NAME_OR_ID`.
- uid: az_postgres_flexible-server_stop
name: az postgres flexible-server stop
summary: |-