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

nit: getting name after my command #11

Open
khenidak opened this issue Jun 8, 2018 · 4 comments
Open

nit: getting name after my command #11

khenidak opened this issue Jun 8, 2018 · 4 comments

Comments

@khenidak
Copy link

khenidak commented Jun 8, 2018

$ az vm create -n vvv1 -g selfdestructtest --image Centos --zone 1 --self-destruct 10m
You've activated a self-destruct sequence! This resource will be deleted at 2018-06-08 01:06:25.788711 UTC
'name'

Not sure why i am getting name print.

@khenidak
Copy link
Author

khenidak commented Jun 8, 2018

The name thing i had was actually hiding a bigger issue
Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x7f0a50456140>, <function _x509_from_base64_to_hex_transform at 0x7f0a504560c8>, <function self_destruct_transform_handler at 0x7f0a4f953050>] 'name'
The VM is created but no destruction resources were created

I run paython 2.7, should i upgrade?

@noelbundick
Copy link
Owner

Yeah. I’ll check on this - but all my Python friends have been hating on 2.7 when I ask them about these issues

@noelbundick
Copy link
Owner

I was able to repro this! Will get you a fix soon

@noelbundick
Copy link
Owner

Turns out az vm create doesn't return an ARM response, but instead captures it and shows you some abbreviated output instead

Latest release should fix things
https://github.com/noelbundick/azure-cli-extension-noelbundick/releases/tag/v0.0.9

When using a command like

az vm create -n vvv1 -g trash1-1h --image Centos --self-destruct 10m --admin-username noel --admin-password Password#1234

You should see output like

You've activated a self-destruct sequence! This resource will be deleted at 2018-06-09 00:24:36.479494 UTC
Creating Logic App self-destruct-virtualMachines-trash1-1h-vvv1 to delete /subscriptions/6c1f4f3b-f65f-4667-8f9e-b9c48e09cd6b/resourceGroups/trash1-1h/providers/Microsoft.Compute/virtualMachines/vvv1 at 2018-06-09 00:24:36.479494
{
  "fqdns": "",
  "id": "/subscriptions/6c1f4f3b-f65f-4667-8f9e-b9c48e09cd6b/resourceGroups/trash1-1h/providers/Microsoft.Compute/virtualMachines/vvv1",
  "location": "eastus",
  "macAddress": "00-0D-3A-1D-21-F0",
  "powerState": "VM running",
  "privateIpAddress": "10.0.0.4",
  "publicIpAddress": "138.91.126.254",
  "resourceGroup": "trash1-1h",
  "zones": ""
}

Note - first two lines are sent via azure-cli log pipeline to STDERR so you can still do whatever you need to with the output of your original create command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants