|
1 | | - |
2 | 1 | # Azure CLI Neon Extension # |
| 2 | + |
3 | 3 | This is an extension to Azure CLI to manage Neon Postgres resources. |
4 | 4 |
|
5 | 5 | ## How to use ## |
6 | | -#### Install the extension #### |
| 6 | + |
| 7 | +### Install the extension ### |
| 8 | + |
7 | 9 | Install this extension using the below CLI command: |
8 | 10 | ``` |
9 | 11 | az extension add --name neon |
10 | 12 | ``` |
11 | 13 |
|
12 | | -#### Check the version #### |
| 14 | +### Check the version ### |
| 15 | + |
13 | 16 | ``` |
14 | 17 | az extension show --name neon --query version |
15 | 18 | ``` |
16 | 19 |
|
17 | | -#### Connect to Azure subscription #### |
| 20 | +### Connect to Azure subscription ### |
| 21 | + |
18 | 22 | ``` |
19 | 23 | az login |
20 | 24 | az account set -s {subs_id} |
21 | 25 | ``` |
22 | 26 |
|
23 | | -#### Create a resource group (or use an existing one) #### |
| 27 | +### Create a resource group (or use an existing one) ### |
| 28 | + |
24 | 29 | ``` |
25 | 30 | az group create -n demoResourceGroup -l eastus |
26 | 31 | ``` |
27 | 32 |
|
28 | 33 | ## Available Commands ## |
29 | 34 |
|
30 | | -### Create a Neon Postgres Instance ### |
| 35 | +### Organization Commands ### |
| 36 | + |
| 37 | +#### Create a Neon Postgres Organization #### |
| 38 | + |
31 | 39 | ``` |
32 | | -az neon postgres create --resource-group {resource_group} --name {resource_name} --user-details '{"first-name": "{user_first_name}", "last-name": "{user_last_name}", "email-address": "{user_email}", "upn": "{user_upn}", "phone-number": "{user_phone}"}' --company-details '{"company-name": "{company_name}", "office-address": "{office_address}", "country": "{country}", "domain": "{domain}", "number-of-employees": {number_of_employee}}' --partner-organization-properties '{"organization-id": "{org_id}", "org-name": "{partner_org_name}", "single-sign-on-properties": {"single-sign-on-state": "{sso_state}", "enterprise-app-id": "{app_id}", "single-sign-on-url": "{sso_url}", "aad-domains": ["{domain}"]}}' --tags "{key:value}" --location {location} |
| 40 | +az neon postgres organization create --resource-group {resource_group} --name {resource_name} --user-details '{{"first-name": "{user_first_name}", "last-name": "{user_last_name}", "email-address": "{user_email}", "upn": "{user_upn}", "phone-number": "{user_phone}"}}' --marketplace-details '{{"subscription-id": "{subscription_id}", "subscription-status": "{subscription_status}", "offer-details": {{"publisher-id": "{publisher_id}", "offer-id": "{offer_id}", "plan-id": "{plan_id}", "plan-name": "{plan_name}", "term-unit": "{term_unit}", "term-id": "{term_id}"}}}}' --company-details '{{"company-name": "{company_name}", "office-address": "{office_address}", "country": "{country}", "domain": "{domain}", "number-of-employees": {number_of_employee}}}' --partner-organization-properties '{{"organization-id": "{org_id}", "org-name": "{partner_org_name}", "single-sign-on-properties": {{"single-sign-on-state": "{sso_state}", "enterprise-app-id": "{app_id}", "single-sign-on-url": "{sso_url}", "aad-domains": ["{domain}"]}}}}' --tags "{key:value}" --location {location} |
33 | 41 | ``` |
34 | 42 |
|
35 | | -### Show a Neon Postgres Organization ### |
| 43 | +#### Show a Neon Postgres Organization #### |
| 44 | + |
36 | 45 | ``` |
37 | 46 | az neon postgres organization show --resource-group {resource_group} --name {resource_name} |
38 | 47 | ``` |
39 | 48 |
|
40 | | -### Delete a Neon Postgres Organization ### |
| 49 | +#### Delete a Neon Postgres Organization #### |
| 50 | + |
41 | 51 | ``` |
42 | 52 | az neon postgres organization delete --resource-group {resource_group} --name {resource_name} |
43 | 53 | ``` |
44 | 54 |
|
45 | | -### List Neon resources by subscription ID ### |
| 55 | +#### List Neon Organizations by Subscription #### |
| 56 | + |
46 | 57 | ``` |
47 | 58 | az neon postgres organization list --subscription {subscription_id} --resource-group {resource_group} |
48 | 59 | ``` |
49 | 60 |
|
50 | | -### Update a Neon Postgres Organization (without location and marketplace details) ### |
| 61 | +#### Update a Neon Postgres Organization #### |
| 62 | + |
| 63 | +``` |
| 64 | +az neon postgres organization create --resource-group {resource_group} --name {resource_name} --user-details '{{"first-name": "{user_first_name}", "last-name": "{user_last_name}", "email-address": "{user_email}", "upn": "{user_upn}", "phone-number": "{user_phone}"}}' --marketplace-details '{{"subscription-id": "{subscription_id}", "subscription-status": "{subscription_status}", "offer-details": {{"publisher-id": "{publisher_id}", "offer-id": "{offer_id}", "plan-id": "{plan_id}", "plan-name": "{plan_name}", "term-unit": "{term_unit}", "term-id": "{term_id}"}}}}' --company-details '{{"company-name": "{company_name}", "office-address": "{office_address}", "country": "{country}", "domain": "{domain}", "number-of-employees": {number_of_employee}}}' --partner-organization-properties '{{"organization-id": "{org_id}", "org-name": "{partner_org_name}", "single-sign-on-properties": {{"single-sign-on-state": "{sso_state}", "enterprise-app-id": "{app_id}", "single-sign-on-url": "{sso_url}", "aad-domains": ["{domain}"]}}}}' --tags "{key:value}" --location {location} |
| 65 | +``` |
| 66 | + |
| 67 | +### Project Commands ### |
| 68 | + |
| 69 | +#### Create a Neon Postgres Project with in an Organization #### |
| 70 | + |
| 71 | +``` |
| 72 | +az neon postgres project create --resource-group {resource_group} --organization-name {organization_name} --name {project_name} --region {region} --pg-version {pg_version} --branch '{{"branch-name": "{banch_name}", "database-name": "{database_name}", "role-name": "{reole_name}""}}' |
| 73 | +``` |
| 74 | + |
| 75 | +#### Show a Neon Postgres Project in an Organization #### |
| 76 | + |
| 77 | +``` |
| 78 | +az neon postgres project show --resource-group {resource_group} --organization-name {organization_name} --project-id {project_id} |
| 79 | +``` |
| 80 | + |
| 81 | +#### List Neon Postgres Projects under an Organization #### |
| 82 | + |
| 83 | +``` |
| 84 | +az neon postgres project list --resource-group {resource_group} --organization-name {organization_name} |
| 85 | +``` |
| 86 | + |
| 87 | +#### Delete a Neon Postgres Project in an Organization #### |
| 88 | + |
| 89 | +``` |
| 90 | +az neon postgres project delete --resource-group {resource_group} --organization-name {organization_name} --project-id {project_id} |
| 91 | +``` |
| 92 | + |
| 93 | +### Branch Commands ### |
| 94 | + |
| 95 | +#### Create a Branch in a Neon Postgres Project #### |
| 96 | + |
| 97 | +``` |
| 98 | +az neon postgres branch create --resource-group {resource_group} --organization-name {organization_name} --project-name {project_id} --project-id {project_id} --branch-name {branch_name} --role-name {role_name} --database-name {database_name} |
| 99 | +``` |
| 100 | + |
| 101 | +#### Show a Branch in a Neon Postgres Project #### |
| 102 | + |
| 103 | +``` |
| 104 | +az neon postgres branch show --resource-group {resource_group} --organization-name {organization_name} --project-id {project_id} --branch-id {branch_id} |
| 105 | +``` |
| 106 | + |
| 107 | +#### List Branches in a Neon Postgres Project #### |
| 108 | + |
| 109 | +``` |
| 110 | +az neon postgres branch list --resource-group {resource_group} --organization-name {organization_name} --project-id {project_id} |
51 | 111 | ``` |
52 | | -az neon postgres organization update --resource-group {resource_group} --name {resource_name} --user-details '{"first-name": "{user_first_name}", "last-name": "{user_last_name}", "email-address": "{user_email}", "upn": "{user_upn}", "phone-number": "{user_phone}"}' --company-details '{"company-name": "{company_name}", "office-address": "{office_address}", "country": "{country}", "domain": "{domain}", "number-of-employees": {number_of_employee}}' --partner-organization-properties '{"organization-id": "{org_id}", "org-name": "{partner_org_name}", "single-sign-on-properties": {"single-sign-on-state": "{sso_state}", "enterprise-app-id": "{app_id}", "single-sign-on-url": "{sso_url}", "aad-domains": ["{domain}"]}}' --tags "{key:value}" |
| 112 | + |
| 113 | +#### Delete a Branch in a Neon Postgres Project #### |
| 114 | + |
| 115 | +``` |
| 116 | +az neon postgres branch delete --resource-group {resource_group} --organization-name {organization_name} --project-id {project_id} --branch-id {branch_id} |
| 117 | +``` |
| 118 | + |
| 119 | +### Neon Database Commands ### |
| 120 | + |
| 121 | +#### List Databases in a Neon Postgres Branch #### |
| 122 | + |
| 123 | +``` |
| 124 | +az neon postgres database list --resource-group {resource_group} --organization-name {organization_name} --project-id {project_id} --branch-id {branch_id} |
| 125 | +``` |
| 126 | + |
| 127 | +### Neon Role Commands ### |
| 128 | + |
| 129 | +#### List Roles in a Neon Postgres Branch #### |
| 130 | + |
| 131 | +``` |
| 132 | +az neon postgres neon-role list --resource-group {resource_group} --organization-name {organization_name} --project-id {project_id} --branch-id {branch_id} |
| 133 | +
|
53 | 134 | ``` |
54 | 135 |
|
55 | 136 | If you have issues, please give feedback by opening an issue at https://github.com/Azure/azure-cli-extensions/issues. |
0 commit comments