MicrosoftDocs / mslearn-mr-adt-in-unity

This is a repo that holds the sample code for the Mixed Reality and Azure Digital Twins in Unity Learn Path
Creative Commons Attribution 4.0 International
65 stars 55 forks source link

azuredeploy.bicep issue #19

Closed cyborg-ape closed 1 year ago

cyborg-ape commented 1 year ago

I'm having a issue with the azure deploy.bicep, deployment have done as instructed and exactly as the tutorial but have consistently received the same error. Thanks for any help

Here is out put from running the azure deploy.bicep

C:\Users\blank\Desktop\mslearn-mr-adt-in-unity\ARM-Template\azuredeploy.bicep(6,16) : Warning no-loc-expr-outside-params: Use a parameter here instead of 'resourceGroup().location'. 'resourceGroup().location' and 'deployment().location' should only be used as a default value for parameters. [https://aka.ms/bicep/linter/no-loc-expr-outside-params] C:\Users\blank\Desktop\mslearn-mr-adt-in-unity\ARM-Template\azuredeploy.bicep(16,5) : Warning no-unused-vars: Variable "eventGridName" is declared but never used. [https://aka.ms/bicep/linter/no-unused-vars] C:\Users\blank\Desktop\mslearn-mr-adt-in-unity\ARM-Template\azuredeploy.bicep(75,5) : Warning no-unnecessary-dependson: Remove unnecessary dependsOn entry 'storage'. [https://aka.ms/bicep/linter/no-unnecessary-dependson] C:\Users\blank\Desktop\mslearn-mr-adt-in-unity\ARM-Template\azuredeploy.bicep(154,105) : Warning BCP241: The "providers" function is deprecated and will be removed in a future release of Bicep. Please add a comment to https://github.com/Azure/bicep/issues/2017 if you believe this will impact your workflow. C:\Users\blank\Desktop\mslearn-mr-adt-in-unity\ARM-Template\azuredeploy.bicep(158,105) : Warning BCP241: The "providers" function is deprecated and will be removed in a future release of Bicep. Please add a comment to https://github.com/Azure/bicep/issues/2017 if you believe this will impact your workflow. C:\Users\blank\Desktop\mslearn-mr-adt-in-unity\ARM-Template\azuredeploy.bicep(176,5) : Warning no-unnecessary-dependson: Remove unnecessary dependsOn entry 'adt'. [https://aka.ms/bicep/linter/no-unnecessary-dependson] C:\Users\blank\Desktop\mslearn-mr-adt-in-unity\ARM-Template\azuredeploy.bicep(178,5) : Warning no-unnecessary-dependson: Remove unnecessary dependsOn entry 'appInsights'. [https://aka.ms/bicep/linter/no-unnecessary-dependson] C:\Users\blank\Desktop\mslearn-mr-adt-in-unity\ARM-Template\azuredeploy.bicep(192,25) : Warning BCP081: Resource type "Microsoft.Web/sites/extensions@2015-08-01" does not have types available. C:\Users\blank\Desktop\mslearn-mr-adt-in-unity\ARM-Template\azuredeploy.bicep(200,5) : Warning no-unnecessary-dependson: Remove unnecessary dependsOn entry 'funcApp'. [https://aka.ms/bicep/linter/no-unnecessary-dependson] C:\Users\blank\Desktop\mslearn-mr-adt-in-unity\ARM-Template\azuredeploy.bicep(212,5) : Warning no-unnecessary-dependson: Remove unnecessary dependsOn entry 'iot'. [https://aka.ms/bicep/linter/no-unnecessary-dependson] C:\Users\blank\Desktop\mslearn-mr-adt-in-unity\ARM-Template\azuredeploy.bicep(253,5) : Warning no-unnecessary-dependson: Remove unnecessary dependsOn entry 'eventGridIngestTopic'. [https://aka.ms/bicep/linter/no-unnecessary-dependson] C:\Users\blank\Desktop\mslearn-mr-adt-in-unity\ARM-Template\azuredeploy.bicep(256,5) : Warning no-unnecessary-dependson: Remove unnecessary dependsOn entry 'funcApp'. [https://aka.ms/bicep/linter/no-unnecessary-dependson] C:\Users\blank\Desktop\mslearn-mr-adt-in-unity\ARM-Template\azuredeploy.bicep(306,5) : Warning no-unnecessary-dependson: Remove unnecessary dependsOn entry 'funcApp'. [https://aka.ms/bicep/linter/no-unnecessary-dependson] C:\Users\blank\Desktop\mslearn-mr-adt-in-unity\ARM-Template\azuredeploy.bicep(333,13) : Warning no-loc-expr-outside-params: Use a parameter here instead of 'resourceGroup().location'. 'resourceGroup().location' and 'deployment().location' should only be used as a default value for parameters. [https://aka.ms/bicep/linter/no-loc-expr-outside-params] C:\Users\blank\Desktop\mslearn-mr-adt-in-unity\ARM-Template\azuredeploy.bicep(353,5) : Warning no-unnecessary-dependson: Remove unnecessary dependsOn entry 'iot'. [https://aka.ms/bicep/linter/no-unnecessary-dependson]

{"code": "InvalidTemplate", "message": "Deployment template validation failed: 'The template resource '' of type 'Microsoft.Authorization/roleAssignments' at line '344' and column '5' is not valid. The name property cannot be null or empty. Please see https://aka.ms/arm-template/#resources for usage details.'.", "additionalInfo": [{"type": "TemplateViolation", "info": {"lineNumber": 344, "linePosition": 5, "path": "properties.template.resources[17]"}}]

Jinding-X commented 1 year ago

Hi, do you know how to resolve this issue? I got exactly the same error information.

ChristianBeier commented 1 year ago

I figured out few issues with the instruction and the bicep script:

  1. Queries in step 4 are wrong. There is no objectId returned. Instead, the query should be on "id" $objectid=$(az ad sp list --display-name ${appreg} --query [0].id --output tsv) $userid=$(az ad signed-in-user show --query id -o tsv)
  2. Ensure that the variables you pass for the parameters $projectname, $userid, $objectid are set.
Jinding-X commented 1 year ago

Thank you so much! This works.

adamlash commented 1 year ago

Hey All,

Thanks for opening up this issue, and thanks @ChristianBeier for providing a solution! I am going to go through an update on all these scripts and documentation this week to make sure everything is up to date and functioning as expected. Your solutions are much appreciated!

Best Regards, Adam Lash