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

Generated scaffolding code is not working...

Open subbartt opened this issue 4 years ago • 3 comments

Hi All , I followed all the instructions and created the Template extension , generated code is not working ( azdev extension create NewTestOperations --local-sdk "C:\github\sdks\azure-mgmt-maps-0.1.0\azure-mgmt-maps-0.1.0" --operation-name AccountsOperations --client-name MapsManagementClient --sdk-property account_name --github-alias subbartt)

  1. az NewTestOperations -h is only displaying single command , where as commands file has mutliple command. It is only displaying first command.
  2. Running the command az NewTestOperations create is also failing with below error (env) c:\github\azure-cli-extensions\src\NewTestOperations>az NewTestOperations create The command failed with an unexpected error. Here is the traceback:

'' Traceback (most recent call last): File "c:\github\env\lib\site-packages\knack\cli.py", line 206, in invoke cmd_result = self.invocation.execute(args) File "c:\github\env\lib\site-packages\azure\cli\core\commands_init_.py", line 566, in execute command_source = self.commands_loader.command_table[command].command_source KeyError: ''

Can some check this?

Also orthogonal to this , do you have general debugging instructions how to step through the extension code while developing extension , that would help a lot.

subbartt avatar Mar 06 '20 10:03 subbartt

Hi, @subbartt. Could you show me your folder after your running az extension create and what does your SDK look like?

haroldrandom avatar Mar 08 '20 04:03 haroldrandom

Hi haroldrandom, I followed instructions same as @ https://azurecliprod.blob.core.windows.net/videos/05%20-%20AzdevExtensionCreate.mp4 , including the SDK that was used in the demo.

Can you confirm if the instructions in that video are still relevant or needs to be updated?

subbartt avatar Mar 09 '20 09:03 subbartt

will fix in https://github.com/Azure/azure-cli-dev-tools/issues/207

haroldrandom avatar Jun 11 '20 10:06 haroldrandom