Home > Software engineering >  Azure CLI command not returning GUID values for a variable
Azure CLI command not returning GUID values for a variable

Time:10-02

I am trying to follow a MSFT documentation tutorial

(enter image description hereNot sure why its not displaying the object id.

CodePudding user response:

The property name has changed, it's no longer objectId. Instead, it was renamed to id. I confirmed it was still objectId in az CLI version 2.28.0, but after upgrading to 2.40, the property was different.

So instead of:

$objectid=$(az ad sp list --display-name ${appreg} --query [0].objectId --output tsv)

Try:

$objectid=$(az ad sp list --display-name ${appreg} --query [0].id --output tsv)
  • Related