azure-cli-extensions icon indicating copy to clipboard operation
azure-cli-extensions copied to clipboard

Unable to change request URL in Classic Web Test on Application Insights

Open bandhit opened this issue 1 year ago • 3 comments

Hi friends, I ran into some trouble with application-insights: 0.1.16 extension recently. Could you give me some advice?

Describe the bug

I was attempting to change a request URL in Classic Web Test on Application Insights via az. I was able to do it with Standard Web Test on last month, but it is not worked now. I am not sure if Classic Web Test can use the same command as Standard Web Test.

Command Name az monitor app-insights web-test update Extension Name: application-insights. Version: 0.1.16.

Errors:

The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'request_url'
Traceback (most recent call last):
  File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 200, in handler
    instance = custom_function(instance=instance, **custom_func_args)
  File "/home/suksiri/.azure/cliextensions/application-insights/azext_applicationinsights/custom.py", line 550, in update_web_test
    instance.request.request_url = request_url
AttributeError: 'NoneType' object has no attribute 'request_url'

To Reproduce:

Please note that argument values have been redacted, as they may contain sensitive information.

  • Create Application Insights via Azure Portal
  • Under Availability menu, add Classic test with URL ping SKU plan
  • Note the resource name and back to terminal, run az monitor app-insights web-test update --web-test-name {} --resource-group {} --request-url {}
  • Error occurred

Expected Behavior

It should run successful without error, if and only if the resource exists.

Environment Summary

Linux-5.4.0-1086-azure-x86_64-with-glibc2.28 (Cloud Shell), Common Base Linux Delridge (quinault)
Python 3.10.5
Installer: DEB

azure-cli 2.38.0

Extensions:
application-insights 0.1.16
cosmosdb-preview 0.9.0
ai-examples 0.2.5
ssh 1.1.2

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1

bandhit avatar Jul 28 '22 11:07 bandhit

monitor

yonzhan avatar Jul 28 '22 13:07 yonzhan

Any clues here?

bandhit avatar Aug 04 '22 13:08 bandhit

Thanks for the feedback. We will fix it. Could you use az monitor app-insights web-test create command as a workaround.

kairu-ms avatar Aug 08 '22 01:08 kairu-ms