Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5412b23
added project cli commands for preview version
Apr 9, 2025
1b4d393
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Apr 9, 2025
70c61bf
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Apr 10, 2025
bc9b978
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Apr 11, 2025
ddf92c8
added support for projects, branches and changeplan features
Apr 23, 2025
4c57ca4
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Apr 23, 2025
cd0568c
updated examples in the read me
Apr 23, 2025
3bfe93e
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Apr 23, 2025
9763a54
added examples for the update branch and project
Apr 23, 2025
067aecb
updated the release history file
Apr 23, 2025
f83d8a8
update the branch parameters
Apr 23, 2025
c7659a7
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Apr 24, 2025
5f02ccb
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Apr 28, 2025
9233ac5
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Apr 29, 2025
d13d0c9
addressed comments and added scenario tests
Apr 29, 2025
de32a3d
removed the update commands for Project and Branches
Apr 29, 2025
7be85b3
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Apr 29, 2025
102a0c2
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Apr 29, 2025
0035b4d
fix integration test issue
Apr 29, 2025
c87beec
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Apr 30, 2025
df6b2fa
mask the test subscription in scenario tests
Apr 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- @azure Rule - Use Azure Best Practices: When generating code for Azure, running terminal commands for Azure, or performing operations related to Azure, invoke your `azure_development-get_best_practices` tool if available.
6 changes: 5 additions & 1 deletion src/neon/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ Release History

1.0.0b2
++++++
* Updated command descriptions.
* Updated command descriptions.

1.0.0b3
++++++
* GA release of Neon CLI. Supports Change Plan, Project, Branches and Database Connection commands.
105 changes: 93 additions & 12 deletions src/neon/README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,136 @@

# Azure CLI Neon Extension #

This is an extension to Azure CLI to manage Neon Postgres resources.

## How to use ##
#### Install the extension ####

### Install the extension ###

Install this extension using the below CLI command:
```
az extension add --name neon
```

#### Check the version ####
### Check the version ###

```
az extension show --name neon --query version
```

#### Connect to Azure subscription ####
### Connect to Azure subscription ###

```
az login
az account set -s {subs_id}
```

#### Create a resource group (or use an existing one) ####
### Create a resource group (or use an existing one) ###

```
az group create -n demoResourceGroup -l eastus
```

## Available Commands ##

### Create a Neon Postgres Instance ###
### Organization Commands ###

#### Create a Neon Postgres Organization ####

```
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}
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}
```

### Show a Neon Postgres Organization ###
#### Show a Neon Postgres Organization ####

```
az neon postgres organization show --resource-group {resource_group} --name {resource_name}
```

### Delete a Neon Postgres Organization ###
#### Delete a Neon Postgres Organization ####

```
az neon postgres organization delete --resource-group {resource_group} --name {resource_name}
```

### List Neon resources by subscription ID ###
#### List Neon Organizations by Subscription ####

```
az neon postgres organization list --subscription {subscription_id} --resource-group {resource_group}
```

### Update a Neon Postgres Organization (without location and marketplace details) ###
#### Update a Neon Postgres Organization ####

```
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}
```

### Project Commands ###

#### Create a Neon Postgres Project with in an Organization ####

```
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}""}}'
```

#### Show a Neon Postgres Project in an Organization ####

```
az neon postgres project show --resource-group {resource_group} --organization-name {organization_name} --project-id {project_id}
```

#### List Neon Postgres Projects under an Organization ####

```
az neon postgres project list --resource-group {resource_group} --organization-name {organization_name}
```

#### Delete a Neon Postgres Project in an Organization ####

```
az neon postgres project delete --resource-group {resource_group} --organization-name {organization_name} --project-id {project_id}
```

### Branch Commands ###

#### Create a Branch in a Neon Postgres Project ####

```
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}
```

#### Show a Branch in a Neon Postgres Project ####

```
az neon postgres branch show --resource-group {resource_group} --organization-name {organization_name} --project-id {project_id} --branch-id {branch_id}
```

#### List Branches in a Neon Postgres Project ####

```
az neon postgres branch list --resource-group {resource_group} --organization-name {organization_name} --project-id {project_id}
```
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}"

#### Delete a Branch in a Neon Postgres Project ####

```
az neon postgres branch delete --resource-group {resource_group} --organization-name {organization_name} --project-id {project_id} --branch-id {branch_id}
```

### Neon Database Commands ###

#### List Databases in a Neon Postgres Branch ####

```
az neon postgres database list --resource-group {resource_group} --organization-name {organization_name} --project-id {project_id} --branch-id {branch_id}
```

### Neon Role Commands ###

#### List Roles in a Neon Postgres Branch ####

```
az neon postgres neon-role list --resource-group {resource_group} --organization-name {organization_name} --project-id {project_id} --branch-id {branch_id}

```

If you have issues, please give feedback by opening an issue at https://github.com/Azure/azure-cli-extensions/issues.
1 change: 0 additions & 1 deletion src/neon/azext_neon/aaz/latest/neon/__cmd_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

@register_command_group(
"neon",
is_preview=True,
)
class __CMDGroup(AAZCommandGroup):
"""Manage Neon Postgres
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

@register_command_group(
"neon postgres",
is_preview=True,
)
class __CMDGroup(AAZCommandGroup):
"""Manage Neon Postgres
Expand Down
4 changes: 0 additions & 4 deletions src/neon/azext_neon/aaz/latest/neon/postgres/_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
from azure.cli.core.aaz import *


@register_command(
"neon postgres create",
is_preview=True,
)
Comment on lines -14 to -17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why make this command unregistered

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we develop Service for 3rd party SaaS partners , as per the feedback from the team we updated the commands. please let me know if there is any concern

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you unregistered those command, they will not be exposed as a normal commands for extension users and no one could use that command. Is it what you expected?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes @kairu

class Create(AAZCommand):
"""Create a Neon organization

Expand Down
23 changes: 23 additions & 0 deletions src/neon/azext_neon/aaz/latest/neon/postgres/branch/__cmd_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from azure.cli.core.aaz import *


@register_command_group(
"neon postgres branch",
)
class __CMDGroup(AAZCommandGroup):
"""Manage Branch
"""
pass


__all__ = ["__CMDGroup"]
17 changes: 17 additions & 0 deletions src/neon/azext_neon/aaz/latest/neon/postgres/branch/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from .__cmd_group import *
from ._create import *
from ._delete import *
from ._list import *
from ._show import *
from ._update import *
from ._wait import *
Loading
Loading