-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Neon CLI Support for GA Features - Change Plan, Projects and Branches #8679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kairu-ms
merged 21 commits into
Azure:main
from
alluri02:sralluri-cli-ext-neon-ga-release
Apr 30, 2025
Merged
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
1b4d393
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
70c61bf
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
bc9b978
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
ddf92c8
added support for projects, branches and changeplan features
4c57ca4
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
cd0568c
updated examples in the read me
3bfe93e
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
9763a54
added examples for the update branch and project
067aecb
updated the release history file
f83d8a8
update the branch parameters
c7659a7
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
5f02ccb
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
9233ac5
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
d13d0c9
addressed comments and added scenario tests
de32a3d
removed the update commands for Project and Branches
7be85b3
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
102a0c2
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
0035b4d
fix integration test issue
c87beec
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
df6b2fa
mask the test subscription in scenario tests
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/neon/azext_neon/aaz/latest/neon/postgres/branch/__cmd_group.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
17
src/neon/azext_neon/aaz/latest/neon/postgres/branch/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 * |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes @kairu