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

virtualMachineProfile.osProfile.customData always returns null

Open justin-vanwinkle opened this issue 8 years ago • 12 comments

Setup

A VM or VMSS that has a cloud-init config defined in virtualMachineProfile.osProfile.customData (or any other data).

Issue

Running the command az vm show --resource-group <rg> --name <name> or az vmss show --resource-group <rg> --name <name> will return a null value for virtualMachineProfile.osProfile.customData.

Any subsequent attempts to update this value with the command az vmss update --resource-group <rg> --name <name> --set virtualMachineProfile.osProfile.customData=<val> will leave the resulting value shown as null.

I was able to verify that the initial custom data (a cloud config) was handed over to the VM and that after an update, my updated cloud config was handed over. So I am certain that the value of customData is not null, however, the azure-cli does not show this way.


Environment summary

Install Method: apt-get OS version: Ubuntu 17.10 Shell Type: zsh

azure-cli (2.0.29)

acr (2.0.22)
acs (2.0.28)
advisor (0.5.0)
appservice (0.1.29)
backup (1.0.7)
batch (3.1.11)
batchai (0.1.6)
billing (0.1.7)
cdn (0.0.13)
cloud (2.0.12)
cognitiveservices (0.1.11)
command-modules-nspkg (2.0.1)
configure (2.0.14)
consumption (0.2.2)
container (0.1.19)
core (2.0.29)
cosmosdb (0.1.19)
dla (0.0.18)
dls (0.0.19)
eventgrid (0.1.11)
eventhubs (0.1.0)
extension (0.0.10)
feedback (2.1.0)
find (0.2.8)
interactive (0.3.17)
iot (0.1.18)
keyvault (2.0.20)
lab (0.0.17)
monitor (0.1.3)
network (2.0.25)
nspkg (3.0.2)
profile (2.0.20)
rdbms (0.1.0)
redis (0.2.11)
reservations (0.1.1)
resource (2.0.25)
role (2.0.20)
servicebus (0.1.0)
servicefabric (0.0.11)
sql (2.0.23)
storage (2.0.27)
vm (2.0.28)

Python location '/opt/az/bin/python3'
Extensions directory '/home/justin/.azure/cliextensions'

Python (Linux) 3.6.1 (default, Mar 10 2018, 17:48:57) 
[GCC 4.7.2]

justin-vanwinkle avatar Mar 20 '18 20:03 justin-vanwinkle

You could try running it with -d. Otherwise, the service deliberately chooses not to return these values, which is very often the case for credentials.

tjprescott avatar Mar 20 '18 22:03 tjprescott

CLI's vm show command doesn't do anything to deliberately hide the data. I would agree with @tjprescott on why the service end would not return the data as the data could be credential related. I am closing this issue, but mark it as serviceattn. If you have any scenarios blocked on this, please let us know

yugangw-msft avatar Apr 06 '18 23:04 yugangw-msft

On a second thought, i will remove the serviceattn, and will add back if there are solid user scenarios get blocked on this

yugangw-msft avatar Apr 06 '18 23:04 yugangw-msft

Ran into this today with the Python SDK returning None for custom_data also.. what gives?

slikk66 avatar Dec 08 '18 01:12 slikk66

Hello,

I think I am facing this exact same issue : PS /home/julien/> az vmss show --resource-group rancher --name ranchervmss | grep -i "custom" "customData": null, I tried to add a "-d" switch on my command line without any success... Is there any workaround for this ? I want to be able to manage the cloud-config files deployed in production and compare it to the ones I am about to upload to double check everything that has changed...

Best Regards,

Julien Plaquevent Thales Alenia Space

Plaquevent avatar Nov 04 '19 15:11 Plaquevent

@yugangw-msft could you please help me ? :)

Plaquevent avatar Nov 04 '19 15:11 Plaquevent

@qwordy please take a look.

yonzhan avatar Nov 05 '19 01:11 yonzhan

@qwordy please take a look.

OK

qwordy avatar Nov 05 '19 01:11 qwordy

The issue still persists with version 2.0.80

az vmss show --subscription *** --name *** --resource-group ***| grep customData
      "customData": null

Also there seems to be no -d switch anymore.

slomo avatar Jan 16 '20 10:01 slomo

ran into this same issue with gosdk as well, customdata is just returned null

vpatelsj avatar Jan 28 '20 20:01 vpatelsj

ran into this same issue with gosdk as well, customdata is just returned null

If other SDK also has this problem, highly suspect it's a service problem.

qwordy avatar Mar 16 '20 05:03 qwordy

Even I am facing this issue . I am not able to see **osProfile.customData** .

Any workarounds or way to fetch this.

anaik91 avatar Aug 06 '20 19:08 anaik91