Today I was very happy to find a neat solution to handle configuration data for a DSC configuration. I was facing the following challenge:
In a SharePoint DSC Configuration I want to reuse several SQL Aliases that are created during run time of the DSC configuration based on the configuration data.
In recent DSC setups my configuration did look like this:
and I created the SQL Alias with the following lines of code:
This far there was no struggle at all. Creating a SQL Alias with DSC is very straight forward, even if there is the need to create more than one.
The struggle got real the moment I had to reuse the Alias Name in SharePoint. How do I properly access the Alias? Do I iterate over all aliases again and filter or do I hard code the alias name or…? None of the before felt right.
My solutions is pretty simple: Why not change the array to another hash table – A hash table allows to access the data more easily. 🙂
Final challenge: How can I iterate over a hash table? A hash table object has two properties: keys and values:
So what changed in my SharePointDsc configuration part? Now I can address my SQL Alias properly without having any troubles:
Convert your existing AutoSPInstaller XML File to a SharePointDsc configuration
Today the first preview of a web based AutoSpInstaller to SharePoint DSC converter got released.
There are still some limitations, as the mapping of the xml file to SharePointDsc is not complete jet. This is a preview to demonstrate the capabilities.
The converter targets the following use case:
As a user with an AutoSpInstaller XML available I want want to switch to SharePointDsc.
Currently the converter is able to create a multi node SharePoint DSC configuration based on the input of the contents of the AutoSPInstaller XML file. The configuration will contain the following elements:
- one node block for each server name. If you are using localhost mixed with real server names, there will be an additional node for localhost.
- On each node the following configuration is placed:
- SharePoint Prerequistes
- SharePoint Binary Installation
- Farm create or join
- The following components are currently extracted from the AutoSPInstaller xml file:
- Basic Farm setup
- Managed Accounts
- Web Applications
- Site Collections
- Managed Paths
- Diagnostics Logging Service
- State Service Application
- Sandboxed Code Service
- Claims to Windows Token Service
- Outgoing Mail
- Distributed Cache
- Workflow Timer Setting
- Update 2018/04/19 – There are the following additions:
- Creation of Application Pools for Web Applications, Search, Serivces
- User Profile Service Application
- Search Service Application
- Managed Metadata Service Application