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

Cannot create Web-APP according to exercise instructions #20938

Closed
buentead opened this issue Jan 10, 2022 · 6 comments
Closed

Cannot create Web-APP according to exercise instructions #20938

buentead opened this issue Jan 10, 2022 · 6 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team. Web Apps az webapp

Comments

@buentead
Copy link

This is autogenerated. Please review and update as needed.

Describe the bug

Exercise on https://docs.microsoft.com/en-us/learn/modules/secure-app-with-oidc-and-azure-ad/5-exercise-deploy-app-with-oidc-auth
In section "Configure and deploy the application that uses OpenID Connect to authenticate users" cannot successfully execute step #6

Command Name

az webapp up \
    --resource-group learn-a6cf3b96-6d66-4d37-8701-e6d4554bd064 \
    --location centralus \
    --sku F1 \
    --name educationapp-$RANDOM

Errors:

The webapp 'educationapp-13409' doesn't exist
The command failed with an unexpected error. Here is the traceback:
list index out of range
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 658, in execute
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 713, in _run_job
    return cmd_copy.exception_handler(ex)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/commands.py", line 38, in _ex_handler
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 3959, in webapp_up
    plan=plan)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/_create_util.py", line 385, in get_plan_to_use
    return _determine_if_default_plan_to_use(cmd, _default_asp, resource_group_name, loc, sku, create_rg)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/_create_util.py", line 404, in _determine_if_default_plan_to_use
    _asp_generic = plan_name[:-len(plan_name.split("_")[4])]
IndexError: list index out of range

To Reproduce:

Follow the steps according to the training documentation:
https://docs.microsoft.com/en-us/learn/modules/secure-app-with-oidc-and-azure-ad/5-exercise-deploy-app-with-oidc-auth

Expected Behavior

The app deployment will fail with "The webapp 'educationapp-nnnnn' doesn't exist"

Environment Summary

Linux-5.4.0-1065-azure-x86_64-with-debian-10.2 (Cloud Shell), Common Base Linux Delridge (quinault)
Python 3.6.10
Installer: DEB

azure-cli 2.31.0 *

Extensions:
ai-examples 0.2.5
ssh 1.0.0

Additional Context

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Jan 10, 2022
@yonzhan yonzhan added the Web Apps az webapp label Jan 10, 2022
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Jan 10, 2022
@yonzhan yonzhan added Service Attention This issue is responsible by Azure service team. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jan 10, 2022
@ghost
Copy link

ghost commented Jan 10, 2022

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzureAppServiceCLI, @antcp.

Issue Details

This is autogenerated. Please review and update as needed.

Describe the bug

Exercise on https://docs.microsoft.com/en-us/learn/modules/secure-app-with-oidc-and-azure-ad/5-exercise-deploy-app-with-oidc-auth
In section "Configure and deploy the application that uses OpenID Connect to authenticate users" cannot successfully execute step #6

Command Name

az webapp up \
    --resource-group learn-a6cf3b96-6d66-4d37-8701-e6d4554bd064 \
    --location centralus \
    --sku F1 \
    --name educationapp-$RANDOM

Errors:

The webapp 'educationapp-13409' doesn't exist
The command failed with an unexpected error. Here is the traceback:
list index out of range
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 658, in execute
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 713, in _run_job
    return cmd_copy.exception_handler(ex)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/commands.py", line 38, in _ex_handler
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 3959, in webapp_up
    plan=plan)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/_create_util.py", line 385, in get_plan_to_use
    return _determine_if_default_plan_to_use(cmd, _default_asp, resource_group_name, loc, sku, create_rg)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/_create_util.py", line 404, in _determine_if_default_plan_to_use
    _asp_generic = plan_name[:-len(plan_name.split("_")[4])]
IndexError: list index out of range

To Reproduce:

Follow the steps according to the training documentation:
https://docs.microsoft.com/en-us/learn/modules/secure-app-with-oidc-and-azure-ad/5-exercise-deploy-app-with-oidc-auth

Expected Behavior

The app deployment will fail with "The webapp 'educationapp-nnnnn' doesn't exist"

Environment Summary

Linux-5.4.0-1065-azure-x86_64-with-debian-10.2 (Cloud Shell), Common Base Linux Delridge (quinault)
Python 3.6.10
Installer: DEB

azure-cli 2.31.0 *

Extensions:
ai-examples 0.2.5
ssh 1.0.0

Additional Context

Author: buentead
Assignees: -
Labels:

Web Apps, Service Attention, customer-reported

Milestone: -

@yonzhan
Copy link
Collaborator

yonzhan commented Jan 10, 2022

route to service team

@panchagnula
Copy link
Contributor

@StrawnSC this is a slightly older version but can you check this logic - that could lead to this exception? asp_generic = plan_name[:-len(plan_name.split("")[4])]
IndexError: list index out of range

@StrawnSC
Copy link
Contributor

I'll double-check, but IIRC this was a known error with az webapp up ( when no --plan argument was provided) that was fixed in a recent version

@StrawnSC
Copy link
Contributor

@buentead sorry you're running into this issue. Please upgrade your CLI with: az upgrade and retry the command. The issue was solved in a recent release.

Please reopen the issue if you're still encountering the same bug.

@StrawnSC
Copy link
Contributor

@StrawnSC this is a slightly older version but can you check this logic - that could lead to this exception? asp_generic = plan_name[:-len(plan_name.split("")[4])]
IndexError: list index out of range

That line was corrected to _asp_generic = plan_name[:plan_name.rindex("_")] so it doesn't error out if the generic ASP plan name can't be split on "_" into at least five parts. This was causing an issue because the generic ASP name was changed to have only two underscores

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team. Web Apps az webapp
Projects
None yet
Development

No branches or pull requests

4 participants