Skip to content

Commit d1676f6

Browse files
authored
Hybrid connections improve error/help msg (#18843)
1 parent 77f07ec commit d1676f6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/azure-cli/azure/cli/command_modules/appservice/_help.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@
692692

693693
helps['functionapp hybrid-connection add'] = """
694694
type: command
695-
short-summary: add a hybrid-connection to a functionapp
695+
short-summary: add an existing hybrid-connection to a functionapp
696696
examples:
697697
- name: add a hybrid-connection to a functionapp
698698
text: az functionapp hybrid-connection add -g MyResourceGroup -n MyWebapp --namespace [HybridConnectionNamespace] --hybrid-connection [HybridConnectionName] -s [slot]
@@ -1751,7 +1751,7 @@
17511751

17521752
helps['webapp hybrid-connection add'] = """
17531753
type: command
1754-
short-summary: add a hybrid-connection to a webapp
1754+
short-summary: add an existing hybrid-connection to a webapp
17551755
examples:
17561756
- name: add a hybrid-connection to a webapp
17571757
text: az webapp hybrid-connection add -g MyResourceGroup -n MyWebapp --namespace [HybridConnectionNamespace] --hybrid-connection [HybridConnectionName] -s [slot]

src/azure-cli/azure/cli/command_modules/appservice/custom.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3317,20 +3317,20 @@ def list_hc(cmd, name, resource_group_name, slot=None):
33173317

33183318
def add_hc(cmd, name, resource_group_name, namespace, hybrid_connection, slot=None):
33193319
HybridConnection = cmd.get_models('HybridConnection')
3320-
linux_webapp = show_webapp(cmd, resource_group_name, name, slot)
3321-
is_linux = linux_webapp.reserved
3322-
if is_linux:
3323-
return logger.warning("hybrid connections not supported on a linux app.")
33243320

33253321
web_client = web_client_factory(cmd.cli_ctx)
33263322
hy_co_client = hycos_mgmt_client_factory(cmd.cli_ctx, cmd.cli_ctx)
33273323
namespace_client = namespaces_mgmt_client_factory(cmd.cli_ctx, cmd.cli_ctx)
33283324

33293325
hy_co_id = ''
33303326
for n in namespace_client.list():
3327+
logger.warning(n.name)
33313328
if n.name == namespace:
33323329
hy_co_id = n.id
33333330

3331+
if hy_co_id == '':
3332+
raise ResourceNotFoundError('Azure Service Bus Relay namespace {} was not found.'.format(namespace))
3333+
33343334
i = 0
33353335
hy_co_resource_group = ''
33363336
hy_co_split = hy_co_id.split("/")

0 commit comments

Comments
 (0)