Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Azure CLI command not returning GUID values for a variable

I am trying to follow a MSFT documentation tutorial

(https://learn.microsoft.com/en-us/training/modules/connect-iot-hololens-azure-digital-twins-unity/5-exercise-create-deploy-arm-template) .

But I am stuck on the below command where I am not able to get $object id.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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

**

Edit:

**
if I query

az ad sp list –display-name ${appreg}

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

>Solution :

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)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading