Skip to content
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/command_modules/azure-cli-appservice/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Release History
===============
0.2.9
+++++
* webapp: az webapp config container now honors --slot parameter

0.2.8
+++++
* webapp: adding support for az webapp up command (Preview) that helps in creating & deploying contents to app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -797,11 +797,12 @@ def update_container_settings(cmd, resource_group_name, name, docker_registry_se
if multicontainer_config_file and multicontainer_config_type:
encoded_config_file = _get_linux_multicontainer_encoded_config_from_file(multicontainer_config_file)
linux_fx_version = _format_fx_version(encoded_config_file, multicontainer_config_type)
update_site_configs(cmd, resource_group_name, name, linux_fx_version=linux_fx_version)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a test for Multi-Container slot please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

update_site_configs(cmd, resource_group_name, name, linux_fx_version=linux_fx_version, slot=slot)
elif multicontainer_config_file or multicontainer_config_type:
logger.warning('Must change both settings --multicontainer-config-file FILE --multicontainer-config-type TYPE')

return _mask_creds_related_appsettings(_filter_for_container_settings(cmd, resource_group_name, name, settings))
return _mask_creds_related_appsettings(_filter_for_container_settings(cmd, resource_group_name, name, settings,
slot=slot))


def _get_acr_cred(cli_ctx, registry_name):
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3'
services:
web:
image: "patle/python_app_slot:latest"
ports:
- "5000:5000"
redis:
image: "redis:alpine"
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,43 @@ def test_linux_webapp(self, resource_group):
self.assertEqual(result2, [])


class LinuxWebappMulticontainerSlotScenarioTest(ScenarioTest):
@ResourceGroupPreparer()
def test_linux_webapp_multicontainer_slot(self, resource_group):
webapp_name = self.create_random_name(prefix='webapp-linux-multi', length=24)
plan = self.create_random_name(prefix='plan-linux-multi', length=24)
config_file = os.path.join(TEST_DIR, 'sample-compose.yml')
slot = "stage"
slot_webapp_name = "{}-{}".format(webapp_name, slot)
slot_config_file = os.path.join(TEST_DIR, 'sample-compose-slot.yml')

self.cmd('appservice plan create -g {} -n {} --is-linux --sku S1'.format(resource_group, plan))
self.cmd("webapp create -g {} -n {} --plan {} --multicontainer-config-file \"{}\" "
"--multicontainer-config-type COMPOSE".format(resource_group, webapp_name, plan, config_file))

last_number_seen = 99999999
for x in range(0, 10):
r = requests.get('http://{}.azurewebsites.net'.format(webapp_name), timeout=240)
# verify the web page
self.assertTrue('Hello World! I have been seen' in str(r.content))
current_number = [int(s) for s in r.content.split() if s.isdigit()][0]
self.assertNotEqual(current_number, last_number_seen)
last_number_seen = current_number

self.cmd('webapp deployment slot create -g {} -n {} --slot {}'.format(resource_group, webapp_name, slot))
self.cmd("webapp config container set -g {} -n {} --slot {} --multicontainer-config-file \"{}\" "
"--multicontainer-config-type COMPOSE".format(resource_group, webapp_name, slot, slot_config_file))

last_number_seen = 99999999
for x in range(0, 10):
r = requests.get('http://{}.azurewebsites.net'.format(slot_webapp_name), timeout=240)
# verify the web page
self.assertTrue('Hello from a slot! I have been seen' in str(r.content))
current_number = [int(s) for s in r.content.split() if s.isdigit()][0]
self.assertNotEqual(current_number, last_number_seen)
last_number_seen = current_number


class WebappACRScenarioTest(ScenarioTest):
@ResourceGroupPreparer(location='japanwest')
def test_acr_integration(self, resource_group):
Expand Down
2 changes: 1 addition & 1 deletion src/command_modules/azure-cli-appservice/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
logger.warn("Wheel is not available, disabling bdist_wheel hook")
cmdclass = {}

VERSION = "0.2.8"
VERSION = "0.2.9"
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
Expand Down