Skip to main content

Posts

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...
Recent posts

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...

Upgrading Dependency Track from v4 to v5

Dependency Track is an open source component analysis platform from OWASP. You upload the SBOM of your application, and Dependency Track keeps track of the components inside it. It checks those components against vulnerability sources like the National Vulnerability Database, GitHub Advisories and OSV. It also lets you define policies and send notifications when something new shows up. In short: it tells you which of your applications are affected when the next vulnerable library hits the news. Recently Dependency Track got an upgrade and version 5 was released. So, time to upgrade! However, that turned out not to be as easy as expected. It took us 2 attempts. Our first attempt failed completely, so we took a different route. Here is what we tried and the two things that cost us the most time. Big shout out to Jef, who looked over my shoulder during the upgrade and helped tackling the issues when we got stuck. Two approaches in the documentation The Dependency Track documenta...

Docker: No space left on device

Recently I tried to spin up a new container and Docker refused with this error: OSError: [Errno 28] No space left on device: Not the most helpful message, but the root cause was simple: the disk used by the Docker engine was full. As you can see in the screenshot below, I was eating up almost the full 250GB available for Docker: Where did my disk space go? Before deleting anything, let's find out what is actually using the space. Docker has a built-in command for this: docker system df This gives you a summary of the space used by images, containers, local volumes and build cache. Want more detail per item? Add the verbose flag: docker system df -v In my case, the usual suspects were to blame: old images, stopped containers and build cache that had been piling up for months. Cleaning up Start with the safest options and work your way up. Remove all stopped containers: docker container prune Remove dangling images (untagged layers that are no longer refer...