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

App create no need to patch again #6200

Merged
merged 5 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions src/spring/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Release History
===============
1.11.2
---
* Refine `az spring app create` command from 3 steps to 2 steps.

1.11.1
---
* Add argument `--ca-cert-name` in `az spring application-accelerator customized-accelerator update` and command `az spring application-accelerator customized-accelerator sync-cert`.
Expand Down
2 changes: 1 addition & 1 deletion src/spring/azext_spring/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def load_arguments(self, _):
c.argument('assign_public_endpoint',
arg_type=get_three_state_flag(),
help='If true, assign endpoint URL which could be accessed out of virtual network for vnet injection instance app.')
c.argument('https_only', arg_type=get_three_state_flag(), help='If true, access app via https', default=False)
c.argument('https_only', arg_type=get_three_state_flag(), help='If true, access app via https')
c.argument('enable_ingress_to_app_tls', arg_type=get_three_state_flag(),
help='If true, enable ingress to app tls',
options_list=['--enable-ingress-to-app-tls', c.deprecate(target='--enable-end-to-end-tls', redirect='--enable-ingress-to-app-tls', hide=True)])
Expand Down
26 changes: 6 additions & 20 deletions src/spring/azext_spring/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,6 @@ def app_create(cmd, client, resource_group, service, name,
'scale_rule_metadata': scale_rule_metadata,
'scale_rule_auth': scale_rule_auth,
}
update_app_kwargs = {
'enable_persistent_storage': enable_persistent_storage,
'public': assign_endpoint,
'public_for_vnet': assign_public_endpoint,
'ingress_read_timeout': ingress_read_timeout,
'ingress_send_timeout': ingress_send_timeout,
'session_affinity': session_affinity,
'session_max_age': session_max_age,
'backend_protocol': backend_protocol,
'client_auth_certs': client_auth_certs
}

deployable = deployable_selector(**create_deployment_kwargs, **basic_kwargs)
create_deployment_kwargs['source_type'] = deployable.get_source_type(**create_deployment_kwargs, **basic_kwargs)
Expand All @@ -173,23 +162,20 @@ def app_create(cmd, client, resource_group, service, name,
deployment_factory.validate_instance_count(instance_count)

app_resource = app_factory.format_resource(**create_app_kwargs, **basic_kwargs)
logger.warning('[1/3] Creating app {}'.format(name))
banner_deployment_name = deployment_name or DEFAULT_DEPLOYMENT_NAME
deployment_resource = deployment_factory.format_resource(**create_deployment_kwargs, **basic_kwargs)

logger.warning('[1/2] Creating app {}'.format(name))
app_poller = client.apps.begin_create_or_update(resource_group, service, name, app_resource)
wait_till_end(cmd, app_poller)

banner_deployment_name = deployment_name or DEFAULT_DEPLOYMENT_NAME
logger.warning('[2/3] Creating default deployment with name "{}"'.format(banner_deployment_name))
deployment_resource = deployment_factory.format_resource(**create_deployment_kwargs, **basic_kwargs)
logger.warning('[2/2] Creating default deployment with name "{}"'.format(banner_deployment_name))
poller = client.deployments.begin_create_or_update(resource_group,
service,
name,
banner_deployment_name,
deployment_resource)
logger.warning('[3/3] Updating app "{}" (this operation can take a while to complete)'.format(name))
app_resource = app_factory.format_resource(**update_app_kwargs, **basic_kwargs)
app_poller = client.apps.begin_update(resource_group, service, name, app_resource)

wait_till_end(cmd, poller, app_poller)
wait_till_end(cmd, poller)
logger.warning('App create succeeded')
return app_get(cmd, client, resource_group, service, name)

Expand Down
2 changes: 1 addition & 1 deletion src/spring/azext_spring/tests/latest/custom_preparers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from datetime import datetime
from azure.cli.testsdk.preparers import (
NoTrafficRecordingPreparer,
ResourceGroupPreparer
ResourceGroupPreparer,
)
from azure.cli.testsdk.scenario_tests import (
SingleValueReplacer,
Expand Down
2,022 changes: 164 additions & 1,858 deletions src/spring/azext_spring/tests/latest/recordings/test_api_portal.yaml

Large diffs are not rendered by default.

Loading