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

[AVM Module Issue]: Enhance documentation and input validation of Intune-enrollment property #4126

Open
1 task done
janegilring opened this issue Jan 6, 2025 · 5 comments
Assignees
Labels
Class: Resource Module 📦 This is a resource module Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue Type: Bug 🐛 Something isn't working

Comments

@janegilring
Copy link

janegilring commented Jan 6, 2025

Check for previous/existing GitHub issues

  • I have checked for previous/existing GitHub issues

Issue Type?

Bug

Module Name

avm/res/compute/virtual-machine

(Optional) Module Version

0.11.0

Description

I was assisting in a scenario where there was issues getting AVD session hosts enrolled into Intune when deploying them using Bicep.
After testing the Bicep-template being used (which leverages the res/compute/virtual-machine module), I found that the mdmId-property was not specified at the correct location - which is this:

    extensionAadJoinConfig: {
        enabled: true
        settings: {
          mdmId: '0000000a-0000-0000-c000-000000000000'
        }
      }

It was defined like this:

    extensionAadJoinConfig: {
        enabled: true
        mdmId: '0000000a-0000-0000-c000-000000000000'    
      }

The invalid syntax did not produce any errors, but the Intune-enrollment simply didn`t work.

Looking at the documentation for the module, the syntax which was being leveraged seemed correct:

Parameter Type Description
extensionAadJoinConfig object The configuration for the [AAD Join] extension. Must at least contain the ["enabled": true] property to be executed. To enroll in Intune, add the setting mdmId: "0000000a-0000-0000-c000-000000000000".

However, looking at the code for the module, I noticed that the setting needs to be defined inside of a settings-block.

Any thoughts on how we could enhance the user experience?
In addition to updating the documentation, would leveraging user defined types for input validation be an option?

(Optional) Correlation Id

No response

@janegilring janegilring added Needs: Triage 🔍 Maintainers need to triage still Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue labels Jan 6, 2025
@github-project-automation github-project-automation bot moved this to Needs: Triage in AVM - Module Issues Jan 6, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Type: Bug 🐛 Something isn't working label Jan 6, 2025
@avm-team-linter avm-team-linter bot added the Class: Resource Module 📦 This is a resource module label Jan 6, 2025
Copy link

@janegilring, thanks for submitting this issue for the avm/res/compute/virtual-machine module!

Important

A member of the @Azure/avm-res-compute-virtualmachine-module-owners-bicep or @Azure/avm-res-compute-virtualmachine-module-contributors-bicep team will review it soon!

@rahalan rahalan removed the Needs: Triage 🔍 Maintainers need to triage still label Jan 6, 2025
@rahalan
Copy link
Contributor

rahalan commented Jan 6, 2025

@janegilring after reviewing the documentation, I can't find a flaw. It explicity states, the setting need to be in the "settings" object, see Image

The setting is actually not set by the module or in any test. Can you refer to a line in code, where you found that bug? Thanks.

@janegilring
Copy link
Author

janegilring commented Jan 6, 2025

@rahalan Putting on the "end user hat" (the module consumer), go to the module documentation and search for extensionAadJoinConfig.

I get the following results:

Image

Image

Image

Image

Image

Image

Image

Image

Image

Image

Image

Image

Image

Image

Image

Image

The only way I could determine that a settings-object exists was looking at the module-code:

Image

https://github.com/Azure/bicep-registry-modules/blob/main/avm/res/compute/virtual-machine/extension/main.bicep#L30
https://github.com/Azure/bicep-registry-modules/blob/main/avm/res/compute/virtual-machine/extension/main.bicep#L61

Maybe I am missing something?

Without knowing that the settings-object/parameter exists, I would interpret this:
"To enroll in Intune, add the setting mdmId: "0000000a-0000-0000-c000-000000000000".

As this:

    extensionAadJoinConfig: {
        enabled: true
        mdmId: '0000000a-0000-0000-c000-000000000000'    
      }

@rahalan
Copy link
Contributor

rahalan commented Jan 6, 2025

@janegilring very good point. I will add a test, which will then also show up in the documentation to clarify, how it needs to be set up. Thanks!

@janegilring
Copy link
Author

@rahalan Awesome, sounds good! 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Class: Resource Module 📦 This is a resource module Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue Type: Bug 🐛 Something isn't working
Projects
Status: Needs: Triage
Development

No branches or pull requests

2 participants