Skip to main content

Posts

Getting started with DSC 3.0 – Part 6: Using the DSC MCP server with your AI coding tools

Throughout this series I ran into the same kind of problem again and again. Which resource type do I need? What is the exact name and casing of a property? Which adapter runs it? Names also change between versions. The Windows PowerShell adapter got a new name in 3.2, and the dsc mcp command became dsc server in 3.3. An AI assistant that writes DSC YAML for you can easily get this wrong. It guesses, based on what it saw during training. DSC 3.0 has a built-in answer for that: an MCP server that lets the assistant ask DSC itself. Note: this post is part of a bigger series on Microsoft Desired State Configuration. Getting started with DSC 3.0 – Part 1: What is DSC and what changed? Getting started with DSC 3.0 – Part 2: Managing a Windows service end to end Getting started with DSC 3.0 – Part 3: Capturing the current state with dsc config export Getting started with DSC 3.0 – Part 4: Configuring IIS with multiple resources and dependsOn Getting started with DSC 3.0 – Part 5: Guard...
Recent posts

Getting started with DSC 3.0 – Part 5: Guarding your configuration with Assertion

At the end of the previous post I said that dependsOn only decides the order in which resources are processed. It doesn't check that the resource you depend on is actually in the desired state. Sometimes that's not enough. You want to say "only touch this machine if it's Windows Server 2025", or "only configure the website if IIS is really installed". That's what the Microsoft.DSC/Assertion resource is for. Note: this post is part of a bigger series on Microsoft Desired State Configuration. Getting started with DSC 3.0 – Part 1: What is DSC and what changed? Getting started with DSC 3.0 – Part 2: Managing a Windows service end to end Getting started with DSC 3.0 – Part 3: Capturing the current state with dsc config export Getting started with DSC 3.0 – Part 4: Configuring IIS with multiple resources and dependsOn Getting started with DSC 3.0 – Part 5: Guarding your configuration with Assertion (this post) What is an assertion? An assertio...

Getting started with DSC 3.0 – Part 4: Configuring IIS with multiple resources and dependsOn

Until now we configured one resource at a time. A real server needs several, and they depend on each other. You can't create a website before IIS is installed, and you can't attach a web application to a website that doesn't exist yet. In this post we set up IIS, an application pool, a website and a web application in a single configuration document, and use dependsOn to control the order. Note: this post is part of a bigger series on Microsoft Desired State Configuration. Getting started with DSC 3.0 – Part 1: What is DSC and what changed? Getting started with DSC 3.0 – Part 2: Managing a Windows service end to end Getting started with DSC 3.0 – Part 3: Capturing the current state with dsc config export Getting started with DSC 3.0 – Part 4: Configuring IIS with multiple resources and dependsOn (this post) What we are building Six resource instances, with these dependencies: IIS (Windows feature): no dependencies Site folder and App f...

Getting started with DSC 3.0 – Part 3: Capturing the current state with dsc config export

In the previous post we wrote a configuration document for a single service by hand. That works when you know exactly what you want to manage. But what if you inherit a machine and have no idea what's configured on it? Or you have one server that works fine and you want the others to look the same? Writing the document from scratch is slow and you will forget things. That's what dsc config export is for. Note: this post is part of a bigger series on Microsoft Desired State Configuration. Getting started with DSC 3.0 – Part 1: What is DSC and what changed? Getting started with DSC 3.0 – Part 2: Managing a Windows service end to end Getting started with DSC 3.0 – Part 3: Capturing the current state with dsc config export (this post) What does export do? The export command inspects the system and generates a configuration document that contains every instance of the resources you ask for. The result is a normal configuration document, so you can use it ...

Getting started with DSC 3.0 – Part 2: Managing a Windows service end to end

In the previous post we looked at what DSC is and what changed in 3.0. Time to put it to work. A Windows service is a good first example. It's something most teams have, and it's easy to break without anybody noticing. Someone sets the start type to Manual while troubleshooting, forgets to put it back, and a few weeks later the service doesn't come up after a reboot. Let's use DSC to describe the state we want and keep it that way. Note: this post is part of a bigger series on Microsoft Desired State Configuration: Getting started with DSC 3.0 – Part 1: What is DSC and what changed? Getting started with DSC 3.0 – Part 2: Managing a Windows service end to end (this post) What you need DSC v3.3 or later, because Microsoft.Windows/Service was added in that release A Windows machine An elevated terminal for the set operation Check your version first: dsc --version Remark: the resource can only manage services that are already regis...

Getting started with DSC 3.0 – Part 1: What is DSC and what changed?

If you've worked with PowerShell DSC before, you probably remember writing a Configuration block, generating a MOF file and hoping the Local Configuration Manager did what you expected.  DSC 3.0 throws most of that away and provides a more modern incarnation of infrastructure-as-code.  Let me explain what it is, and what makes 3.0 different. What is DSC? Desired State Configuration is a declarative way to manage a system. You describe what the system should look like, not how to get there. DSC figures out the rest. It is kind of the first incarnation of Infrastructure as Code. Three concepts are enough to understand DSC: Configuration document: a file that describes the desired state Resource: the piece that knows how to read and change one specific thing (a registry key, a service, a package, ...) Operations: what you can do with a resource: get , test , set and export So the question becomes: if the concepts stays the same, what changed in 3.0?...

Don't know what to do while your agents work? The VS Code team has an answer.

Agents write most of my code these days. That leaves me with this question: what do I do with all this free time? I considered learning a new framework, but that sounds suspiciously like work. Luckily, the VS Code team has a better idea. They gave me something to take care of. What is the VS Code pet? The pet is an interactive character that sits above the chat input box. It reacts to chat activity and to whatever you do to it. So while the agent works, the pet watches. Before, I was the only one staring at the progress indicator while pretending to supervise. Now I have company. Remark: The pet is marked as experimental, so it might change or be removed. Don't get too attached. (I got attached within five minutes.) Adopting your pet Type /vscode-pet in the chat input to show or hide it. In the new-session view of the Agents window, you can also right-click outside the input box and select Pet (/vscode-pet) . Show or hide. That's the entire commitment. As fa...