Skip to content
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

Add "Spring" extension and deprecate "Spring-Cloud" extension #4770

Merged
merged 13 commits into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
94 changes: 51 additions & 43 deletions src/spring/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
Release History
===============
4.0.0
---
* Rename extension name to "Spring".

yuwzho marked this conversation as resolved.
Show resolved Hide resolved
3.1.6
---
* Mark command as deprecated implicitly because command group 'spring' is deprecated and will be removed in a future release. Use 'spring' instead.

3.1.5
---
* [BREAKING CHANGE] The argument '--build-env' accepts key[=value] instead of json.
Expand All @@ -11,7 +19,7 @@ Release History

3.1.3
---
* Revert new RBAC requirement for Standard and Basic sku Spring resource for `az spring-cloud app set-deployment` and `az spring-cloud app unset-deployment` commands.
* Revert new RBAC requirement for Standard and Basic sku Spring resource for `az spring app set-deployment` and `az spring app unset-deployment` commands.

3.1.2
---
Expand All @@ -24,24 +32,24 @@ Release History

3.0.1
---
* `az spring-cloud app deploy` has new preview argument "--build-env" to specify build module and jvm version and so on.
* Raise error when `az spring-cloud app deploy` setting "--target-modules" and "--runtime-version for enterprise tier.
* `az spring app deploy` has new preview argument "--build-env" to specify build module and jvm version and so on.
* Raise error when `az spring app deploy` setting "--target-modules" and "--runtime-version for enterprise tier.
* Fix the jvm option clearance in enterprise tier.

3.0.0
---
* New preview argument `az spring-cloud create` has new argument "--sku=Enterprise" to support Azure Spring Cloud Enterprise creation.
* New preview argument `az spring-cloud create` has new argument "--zone-redundant" to support creating Azure Spring Cloud in Azure availability zone.
* New preview command group `az spring-cloud api-portal` to manage API portal in Azure Spring Cloud Enterprise tier.
* New preview command group `az spring-cloud application-configuration-service` to manage Application Configuration Service in Azure Spring Cloud Enterprise tier.
* New preview command group `az spring-cloud gateway` to manage gateway in Azure Spring Cloud Enterprise tier.
* New preview command group `az spring-cloud service-registry` to mmanage Service Registry in Azure Spring Cloud Enterprise tier.
* [BREAKING CHANGE] `az spring-cloud app` command output: Remove "properties.activeDeploymentName", use "properties.activeDeployment.name" instead.
* [BREAKING CHANGE] `az spring-cloud app` command output: Remove "properties.createdTime", use "systemData.createdAt" instead.
* [BREAKING CHANGE] `az spring-cloud app` command output: Remove "properties.activeDeployment.properties.deploymentSettings.jvmOptions", use "properties.activeDeployment.properties.source.jvmOptions" instead.
* [BREAKING CHANGE] `az spring-cloud app` command output: Remove "properties.activeDeployment.properties.deploymentSettings.runtimeVersion", use "properties.activeDeployment.properties.source.runtimeVersion" instead.
* [BREAKING CHANGE] `az spring-cloud app` command output: Remove "properties.activeDeployment.properties.deploymentSettings.netCoreMainEntryPath", use "properties.activeDeployment.properties.source.netCoreMainEntryPath" instead.
* [BREAKING CHANGE] RBAC change requirement for `az spring-cloud app set-deployment` and `az spring-cloud app unset-deployment` commands.
* New preview argument `az spring create` has new argument "--sku=Enterprise" to support Azure Spring Apps Enterprise creation.
* New preview argument `az spring create` has new argument "--zone-redundant" to support creating Azure Spring Apps in Azure availability zone.
* New preview command group `az spring api-portal` to manage API portal in Azure Spring Apps Enterprise tier.
* New preview command group `az spring application-configuration-service` to manage Application Configuration Service in Azure Spring Apps Enterprise tier.
* New preview command group `az spring gateway` to manage gateway in Azure Spring Apps Enterprise tier.
* New preview command group `az spring service-registry` to mmanage Service Registry in Azure Spring Apps Enterprise tier.
* [BREAKING CHANGE] `az spring app` command output: Remove "properties.activeDeploymentName", use "properties.activeDeployment.name" instead.
* [BREAKING CHANGE] `az spring app` command output: Remove "properties.createdTime", use "systemData.createdAt" instead.
* [BREAKING CHANGE] `az spring app` command output: Remove "properties.activeDeployment.properties.deploymentSettings.jvmOptions", use "properties.activeDeployment.properties.source.jvmOptions" instead.
* [BREAKING CHANGE] `az spring app` command output: Remove "properties.activeDeployment.properties.deploymentSettings.runtimeVersion", use "properties.activeDeployment.properties.source.runtimeVersion" instead.
* [BREAKING CHANGE] `az spring app` command output: Remove "properties.activeDeployment.properties.deploymentSettings.netCoreMainEntryPath", use "properties.activeDeployment.properties.source.netCoreMainEntryPath" instead.
* [BREAKING CHANGE] RBAC change requirement for `az spring app set-deployment` and `az spring app unset-deployment` commands.

2.12.3
---
Expand All @@ -57,28 +65,28 @@ Release History

2.12.0
-----
* Add --disable-probe argument into 'az spring-cloud app create', 'az spring-cloud app update', 'az spring-cloud app deploy' and 'az spring-cloud app deployment create'
* Add --disable-probe argument into 'az spring app create', 'az spring app update', 'az spring app deploy' and 'az spring app deployment create'

2.11.2
-----
* Add support to stop and start Azure Spring Cloud service instance
* Add new command `spring-cloud stop` to stop a running Azure Spring Cloud service instance
* Add new command `spring-cloud start` to start a stopped Azure Spring Cloud service instance
* Add support to stop and start Azure Spring Apps service instance
* Add new command `spring stop` to stop a running Azure Spring Apps service instance
* Add new command `spring start` to start a stopped Azure Spring Apps service instance

2.11.1
-----
* Add support for Diagnostic Operation. Heap dump: 'spring-cloud app deployment generate-heap-dump'. Thread Dump: 'spring-cloud app deployment generate-thread-dump'. JFR: 'spring-cloud app deployment start-jfr'
* Add support for Diagnostic Operation. Heap dump: 'spring app deployment generate-heap-dump'. Thread Dump: 'spring app deployment generate-thread-dump'. JFR: 'spring app deployment start-jfr'
* Add support for public certificate crud, source could be either key vault or local file
* Application could load public certificate by using argument `--loaded_public_certificate_file` in batch or
directly using `spring-cloud app append-loaded-public-certificate` one by one
* Add support to list all apps which have loaded the certificate `spring-cloud certificate list-reference-app`
directly using `spring app append-loaded-public-certificate` one by one
* Add support to list all apps which have loaded the certificate `spring certificate list-reference-app`

2.11.0
-----
* Support functions for Persistent Storage feature.
* Add new command group 'az spring-cloud storage' to register your own storage to Azure Spring Cloud
* Add new command `append-persistent-storage` into 'az spring-cloud app' to append persistent storage to applications
* Add new parameter `--persistent-storage` into 'az spring-cloud app create' and 'az spring-cloud app update' to accept a json file to create persistent storages
* Add new command group 'az spring storage' to register your own storage to Azure Spring Apps
* Add new command `append-persistent-storage` into 'az spring app' to append persistent storage to applications
* Add new parameter `--persistent-storage` into 'az spring app create' and 'az spring app update' to accept a json file to create persistent storages

2.10.0
-----
Expand All @@ -87,17 +95,17 @@ Release History
and we recommended to use `connection_string`.
* Enabling In-Process Agent is equivalent to enabling application insights.
* Mark `enable-java-agent` as deprecated, since IPA is GA-ed.
* Mark application insights related parameter as deprecated in `az spring-cloud update`,
* Mark application insights related parameter as deprecated in `az spring update`,
it's still supported, but will de decommissioned in the future,
and we recommended to use `az spring-cloud app-insights update`.
* Support `--sampling-rate` in `az spring-cloud create`.
and we recommended to use `az spring app-insights update`.
* Support `--sampling-rate` in `az spring create`.
* Decommissioned `disable-distributed-tracing` parameter.

2.9.0
-----
* Add --source-path argument into 'az spring-cloud app deploy' and 'az spring-cloud app deployment create'
* Deprecate source code deploy without --source-path argument in 'az spring-cloud app deploy' and 'az spring-cloud app deployment create'
* Add Support to create banner deployment in 'az spring-cloud app deployment create'
* Add --source-path argument into 'az spring app deploy' and 'az spring app deployment create'
* Deprecate source code deploy without --source-path argument in 'az spring app deploy' and 'az spring app deployment create'
* Add Support to create banner deployment in 'az spring app deployment create'

2.8.0
-----
Expand Down Expand Up @@ -147,13 +155,13 @@ Release History

2.1.2
-----
* Add optional '--deployment' to 'az spring-cloud app logs' command
* Add a parameter '--assign-endpoint' into 'az spring-cloud app create' and 'az spring-cloud app update'
* Deprecate the parameter '--is-public' in 'az spring-cloud app create' and 'az spring-cloud app update'
* Add optional '--deployment' to 'az spring app logs' command
* Add a parameter '--assign-endpoint' into 'az spring app create' and 'az spring app update'
* Deprecate the parameter '--is-public' in 'az spring app create' and 'az spring app update'

2.1.1
-----
* Remove preview parameter '--enable-java-agent' from 'az spring-cloud update'.
* Remove preview parameter '--enable-java-agent' from 'az spring update'.
* Fix warning message of '--disable-distributed-tracing'.

2.1.0
Expand All @@ -162,7 +170,7 @@ Release History

2.0.1
-----
* Fix 'az spring-cloud app list' command issues.
* Fix 'az spring app list' command issues.

2.0.0
-----
Expand Down Expand Up @@ -199,7 +207,7 @@ Release History

0.4.0
-----
* Remove 'cpu', 'memory' and 'instance-count' from 'az spring-cloud app deploy' command
* Remove 'cpu', 'memory' and 'instance-count' from 'az spring app deploy' command
* Fix log streaming feature proxy issues

0.3.1
Expand All @@ -209,7 +217,7 @@ Release History
0.3.0
-----
* Enable distributed tracing by default when creating the service
* Enable to update tags and distributed tracing settings by using "az spring-cloud update"
* Enable to update tags and distributed tracing settings by using "az spring update"

0.2.6
-----
Expand All @@ -221,26 +229,26 @@ Release History

0.2.4
-----
* Add command "az spring-cloud app identity" to support Managed Identity feature
* Add command "az spring app identity" to support Managed Identity feature

0.2.3
-----
* Add command "az spring-cloud app custom-domain" and "az spring-cloud certificate" to support Custom Domain feature.
* Add command "az spring app custom-domain" and "az spring certificate" to support Custom Domain feature.

0.2.2
-----
* Remove the limitation of max compatible cli core version

0.2.1
-----
* Add command "az spring-cloud app logs" to replace "az spring-cloud app log tail" for log streaming.
* "az spring-cloud app log tail" will be deprecated in a future release
* Add command "az spring app logs" to replace "az spring app log tail" for log streaming.
* "az spring app log tail" will be deprecated in a future release
* Fix Python 3 and Python 2 compatible issues.

0.2.0
-----
* Support the log streaming feature.
* Add command for log streaming: az spring-cloud app log tail.
* Add command for log streaming: az spring app log tail.

0.1.1
-----
Expand Down
12 changes: 6 additions & 6 deletions src/spring/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Microsoft Azure CLI 'spring-cloud' Extension
Microsoft Azure CLI 'spring' Extension
==========================================

This package is for the 'spring-cloud' extension.
i.e. 'az spring-cloud'
This package is for the 'spring' extension.
i.e. 'az spring'

### How to use ###
Install this extension using the below CLI command
```
az extension add --name spring-cloud
az extension add --name spring
```

### Sample Commands ###
Create a service and not wait
```
az spring-cloud create -n <service name> --no-wait
az spring create -n <service name> --no-wait
```
Create a green deployment with default configuration
```
az spring-cloud app deployment create --app <app name> -n <deployment name> --jar-path <jar path>
az spring app deployment create --app <app name> -n <deployment name> --jar-path <jar path>
```
12 changes: 6 additions & 6 deletions src/spring/README_CONTAINER.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ Added the following arguments:
--registry-username : The username of the container registry.
```

Use `az spring-cloud app deploy`
Use `az spring app deploy`

Deploy a container image on Docker Hub to an app.
```
az spring-cloud app deploy -n MyApp -s MyCluster -g MyResourceGroup --container-image contoso/your-app:v1
az spring app deploy -n MyApp -s MyCluster -g MyResourceGroup --container-image contoso/your-app:v1
```

Deploy a container image on a private registry to an app.
```
az spring-cloud app deploy -n MyApp -s MyCluster -g MyResourceGroup --container-image contoso/your-app:v1 --container-registry myacr.azurecr.io --registry-username <username> --registry-password <password>
az spring app deploy -n MyApp -s MyCluster -g MyResourceGroup --container-image contoso/your-app:v1 --container-registry myacr.azurecr.io --registry-username <username> --registry-password <password>
```

Or `az spring-cloud app deployment create`
Or `az spring app deployment create`

Deploy a container image on Docker Hub to an app.
```
az spring-cloud app deployment create -n green-deployment --app MyApp -s MyCluster -g MyResourceGroup --container-image contoso/your-app:v1
az spring app deployment create -n green-deployment --app MyApp -s MyCluster -g MyResourceGroup --container-image contoso/your-app:v1
```

Deploy a container image on a private registry to an app.
```
az spring-cloud app deployment create -n green-deployment --app MyApp -s MyCluster -g MyResourceGroup --container-image contoso/your-app:v1 --container-registry myacr.azurecr.io --registry-username <username> --registry-password <password>
az spring app deployment create -n green-deployment --app MyApp -s MyCluster -g MyResourceGroup --container-image contoso/your-app:v1 --container-registry myacr.azurecr.io --registry-username <username> --registry-password <password>
```
20 changes: 10 additions & 10 deletions src/spring/azext_spring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
from azure.cli.core import AzCommandsLoader

from azure.cli.core.commands import CliCommandType
from azext_spring_cloud._help import helps # pylint: disable=unused-import
from azext_spring_cloud._client_factory import cf_spring_cloud
from azext_spring_cloud.commands import load_command_table
from azext_spring_cloud._params import load_arguments
from azext_spring._help import helps # pylint: disable=unused-import
from azext_spring._client_factory import cf_spring
from azext_spring.commands import load_command_table
from azext_spring._params import load_arguments


class spring_cloudCommandsLoader(AzCommandsLoader):
class springCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
spring_cloud_custom = CliCommandType(
operations_tmpl='azext_spring_cloud.custom#{}',
client_factory=cf_spring_cloud)
super(spring_cloudCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=spring_cloud_custom)
spring_custom = CliCommandType(
operations_tmpl='azext_spring.custom#{}',
client_factory=cf_spring)
super(springCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=spring_custom)

def load_command_table(self, args):
load_command_table(self, args)
Expand All @@ -28,4 +28,4 @@ def load_arguments(self, command):
load_arguments(self, command)


COMMAND_LOADER_CLS = spring_cloudCommandsLoader
COMMAND_LOADER_CLS = springCommandsLoader
2 changes: 1 addition & 1 deletion src/spring/azext_spring/_app_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def _get_persistent_disk_size(self, enable_persistent_storage, **_):
class EnterpriseTierApp(DefaultApp):
def _get_persistent_disk_size(self, enable_persistent_storage, **_):
if enable_persistent_storage:
raise InvalidArgumentValueError('Enterprise tier Spring-Cloud instance does not support --enable-persistent-storage')
raise InvalidArgumentValueError('Enterprise tier Spring instance does not support --enable-persistent-storage')


def app_selector(sku, **_):
Expand Down
16 changes: 8 additions & 8 deletions src/spring/azext_spring/_app_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
from msrestazure.azure_exceptions import CloudError
from azure.core.exceptions import (ResourceNotFoundError)
from ._resource_quantity import (validate_cpu as validate_cpu_value, validate_memory as validate_memory_value)
from ._client_factory import cf_spring_cloud_20220101preview
from ._client_factory import cf_spring_20220101preview


logger = get_logger(__name__)


# pylint: disable=line-too-long,raise-missing-from
NO_PRODUCTION_DEPLOYMENT_ERROR = "No production deployment found, use --deployment to specify deployment or create deployment with: az spring-cloud app deployment create"
NO_PRODUCTION_DEPLOYMENT_SET_ERROR = "This app has no production deployment, use \"az spring-cloud app deployment create\" to create a deployment and \"az spring-cloud app set-deployment\" to set production deployment."
NO_PRODUCTION_DEPLOYMENT_ERROR = "No production deployment found, use --deployment to specify deployment or create deployment with: az spring app deployment create"
NO_PRODUCTION_DEPLOYMENT_SET_ERROR = "This app has no production deployment, use \"az spring app deployment create\" to create a deployment and \"az spring app set-deployment\" to set production deployment."


def fulfill_deployment_param(cmd, namespace):
client = cf_spring_cloud_20220101preview(cmd.cli_ctx)
client = cf_spring_20220101preview(cmd.cli_ctx)
name = _get_app_name_from_namespace(namespace)
if not name or not namespace.service or not namespace.resource_group:
return
Expand All @@ -32,7 +32,7 @@ def fulfill_deployment_param(cmd, namespace):


def fulfill_deployment_param_or_warning(cmd, namespace):
client = cf_spring_cloud_20220101preview(cmd.cli_ctx)
client = cf_spring_20220101preview(cmd.cli_ctx)
name = _get_app_name_from_namespace(namespace)
if not name or not namespace.service or not namespace.resource_group:
return
Expand All @@ -48,7 +48,7 @@ def active_deployment_exist(cmd, namespace):
name = _get_app_name_from_namespace(namespace)
if not name or not namespace.service or not namespace.resource_group:
return
client = cf_spring_cloud_20220101preview(cmd.cli_ctx)
client = cf_spring_20220101preview(cmd.cli_ctx)
deployment = _get_active_deployment(client, namespace.resource_group, namespace.service, name)
if not deployment:
raise InvalidArgumentValueError(NO_PRODUCTION_DEPLOYMENT_SET_ERROR)
Expand All @@ -58,7 +58,7 @@ def active_deployment_exist_or_warning(cmd, namespace):
name = _get_app_name_from_namespace(namespace)
if not name or not namespace.service or not namespace.resource_group:
return
client = cf_spring_cloud_20220101preview(cmd.cli_ctx)
client = cf_spring_20220101preview(cmd.cli_ctx)
deployment = _get_active_deployment(client, namespace.resource_group, namespace.service, name)
if not deployment:
logger.warning(NO_PRODUCTION_DEPLOYMENT_SET_ERROR)
Expand All @@ -70,7 +70,7 @@ def ensure_not_active_deployment(cmd, namespace):
"""
if not namespace.deployment or not namespace.resource_group or not namespace.service or not namespace.name:
return
client = cf_spring_cloud_20220101preview(cmd.cli_ctx)
client = cf_spring_20220101preview(cmd.cli_ctx)
deployment = _ensure_deployment_exist(client, namespace.resource_group, namespace.service, namespace.name, namespace.deployment)
if deployment.properties.active:
raise InvalidArgumentValueError('Deployment {} is already the production deployment'.format(deployment.name))
Expand Down
Loading