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

running Scenario0_Hello_World ./create_resources.sh comes across "KeyError: 'resource_group'"

Open juliays opened this issue 3 years ago • 6 comments

This is autogenerated. Please review and update as needed.

Following Readme.md in Scenario0_Hello_World to run the command ./create_resources.sh

Command Name az resource create

Errors:

The command failed with an unexpected error. Here is the traceback:
'resource_group'
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/homebrew/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.43.0/libexec/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/homebrew/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/opt/homebrew/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/homebrew/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/homebrew/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/resource/custom.py", line 1645, in create_resource
    return res.create_resource(properties, location, is_full_object)
  File "/opt/homebrew/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/resource/custom.py", line 3394, in create_resource
    rg_name = parse_resource_id(self.resource_id)['resource_group']
KeyError: 'resource_group'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here...
  • az resource create --resource-type {} --id {} --api-version {} --properties {}

Expected Behavior

Environment Summary

macOS-13.0.1-arm64-arm-64bit, Darwin 22.1.0
Python 3.10.9
Installer: HOMEBREW

azure-cli 2.43.0

Extensions:
azure-iot 0.18.3
azure-devops 0.25.0
interactive 0.4.5
spring 1.5.0

Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1

Additional Context

juliays avatar Dec 21 '22 20:12 juliays

@zhoxing-ms for awareness

yonzhan avatar Dec 22 '22 00:12 yonzhan

I have the same issue, I guess it's because the signup form for using the MQTT broker private preview hasn't been processed.

mingisme avatar Dec 22 '22 12:12 mingisme

I thought I received confirmation email that I can use the preview. I updated azure Cli before running the command. I wonder if there were some incompatibility introduced with the new Cli.Sent from my iPhoneOn Dec 22, 2022, at 7:29 AM, swang @.***> wrote: I have the same issue, I guess it's because the signup form for using the MQTT broker private preview hasn't been processed.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

juliays avatar Dec 22 '22 13:12 juliays

@juliays @mingisme Could you please send the debug log (add --debug parameter) to me by email, my email address is [email protected], thanks~

zhoxing-ms avatar Dec 26 '22 08:12 zhoxing-ms

@juliays After receiving the trial confirmation email, I can successfully run all scenarios of the MQTT Broker preview.

mingisme avatar Dec 27 '22 16:12 mingisme

@mingisme Thanks for letting me know. @zhoxing-ms I removed the repo and re-ran the set up steps again and it's working for me now. Thank you!

juliays avatar Dec 27 '22 18:12 juliays