Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Adds a new
databricks dsccommand providing Microsoft Desired State Configuration compatible resources for managing Databricks workspace resources.The structure of the command operations is as follows:
To generate the schemas (and manifest), users can:
databricks dsc manifestordatabricks dsc schema --resource <type>.Before implementing many more resources, this initial PR includes:
Databricks.DSC/Secret- Manage secrets in a scope through DSCDatabricks.DSC/SecretScope- Manage secret scopes through DSCDatabricks.DSC/SecretAcl- Manage secret ACLs through DSCDatabricks.DSC/User- Manage workspace users through DSCIt re-uses existing Databricks SDK types directly and uses the
_existproperty for declarative create/delete semantics if hooked intodsc.exe.Why
I choose to integrate DSC resources directly into the executable rather than creating separate DSC resources (or exes) because it has significant advantages. Firstly, users can add
databricks.exeto their PATH once, and all DSC resources are available immediately. Then, when users want to leverage it throughdsc.exe, they can produce the resource manifest and hook it into the semantics ofdsc.exe. Lastly, it simplifies the maintenance because it is added to one codebase and leverages existing SDK types + authentication.I explored several designs:
databricks dsc secret get), but this doesn't align with how DSC manifests specify commands - DSC expects a single executable with arguments that include the resource type.--resourceflag allows the manifest to specify["dsc", "get", "--resource", "Databricks.DSC/Secret", {"jsonInputArg": "--input"}]which DSC understands natively.--inputflag (with-ishorthand) accepts JSON directly or via stdin, matching DSC'sjsonInputArgpattern.This PR demonstrates how easy it is to add new DSC resources - each resource is a single file implementing the
ResourceHandlerinterface withGet,Set,Delete, andExportmethods. For more complex resources, it might be beneficial to includeTestif the synthetic test thatdsc.exeexecuted doesn't provide the proper details.Tests
_existproperty injection)