-
Notifications
You must be signed in to change notification settings - Fork 520
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
Key Parameters of resources . E.g. AADApplication: Current Key results in configuration that can not be compiled. #2006
Comments
It is indeed an error I encountered myself on a regular basis. I am opened to suggestions on how to address this, but it doesn't appear to be a simple fix. Keep in mind that we need to support the cloning scenario, which means unique identifier such as IDs cannot be a key parameter. |
It’s the repeating issue with dsc resources and key parameters. Null values for IDs are not practical as we would need to change this value later on or would run in the same issue as at the moment (Id: null, display name: not unique). Just some thoughts for starting a discussion: Could we handle this issue by introducing an additional and not really functional parameter: DisplayNameId: “ThisIsAnAwesomeName==123454321”. That value could be any value - just for uniqueness. If the object within AAD would allow custom properties, we could even store this value. |
Trying to revive this thread. I like this idea. It would clearly be a breaking change across multiple resource however. We should start building a list of resources that are in this bucket. I would recommend that if we move forward with this, that we use a clear, common and distinct name or it. Something like M365DSCUniqueID |
Name is great 👍 I was wondering if there is any tenant wide storage location we could use to store the M365DSCUniqueId for exports. |
Not to my knowledge. The unique ids would end up being GUID which will ensure there are no conflicts. We could always keep a registry of already used GUID during the Export process to ensure we don't by some miracle re-use the same one inside the same configuration but that would be overkill in my opinion. |
Following a list of prefixes of resources that could need an additional key parameter:
Resources not included:
|
Closing this one as other threads are also covering this. Also, we introduced the -Validate switch on the Export-M365DSCConfiguration cmdlet to assist with this. |
Details of the scenario you tried and the problem that is occurring
Currently the export of AADApplication can cause configurations that can't be compiled. The resource AADApplication uses the display name as key within the resource. Equal Display names can be present various times within AAD. AAD uses the ObjectId to make sure these objects are unique.
There were similar issues with TeamsTeam and TeamsChannel: #1416 and #1716 that already mentioned AADApplication.
Verbose logs showing the problem
Suggested solution to the issue
We need to evaluate options on how to handle resources properly, that use the display name as key. I would add the ObjectId or unique ID within M365 as a second key to these resources. For creating new objects, we would need to set this Guid to be any value or
00000000-0000-0000-0000-000000000000
. After the creation of the object, the user would need to change the Guid to a value that should be returned within the Set-Method of these resources. This would further more allow a proper Export and Import (Cloning) of tenants.The DSC configuration that is used to reproduce the issue (as detailed as possible)
The operating system the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)
1.22.525.1
The text was updated successfully, but these errors were encountered: