liveBook · Manning

Chapter 12: AI in DevOps engineering

What you will learn in chapter 12 of AI for Everyday IT

This chapter introduces a practical-first approach to incorporating AI into existing DevOps workflows before covering GenAIOps fundamentals.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This chapter introduces a practical-first approach to incorporating AI into existing DevOps workflows before covering GenAIOps fundamentals.

Key terms: GenAIOps, DevOps principles, AI applications, PowerShell tests, bulk code changes, AI-powered testing solutions, infrastructure automation, test suites, lessons learned

12.1 Practical AI use cases in DevOps

This section introduces three practical ways DevOps engineers can add AI to their workflow: natural-language command interfaces, specialized coding assistants, and task automation.

Key terms: AI interfaces, natural language, PowerShell, kubectl, cloud CLI, Copy-DbaDatabase, coding assistants, GitHub Copilot, Cline, API Assistants

12.2 Upgrading nearly 7,000 tests: A real-world AI project

This section introduces the large-scale dbatools migration from Pester v4 to v5 and the AI-assisted approach used to make it feasible.

Key terms: Pester, Pester v4, Pester v5, dbatools, syntax, scope rules, Aider, Cline, PowerShell automation, AI-assisted development

12.2.1 Choosing our tools

This subsection explains why the project combined Aider and Cline, while noting how to recover from an occasional Aider Git-update problem.

Key terms: Aider, command-line AI coding assistant, Git, natural language, voice commands, descriptive message, Cline, Visual Studio Code integration, IDE, development features

12.2.2 Developing an effective process

This section develops an iterative, example-driven process for reliably using AI to convert Pester v4 tests to Pester v5.

Key terms: step-by-step process, batch, prompt, one file at a time, quality consistency, Pester v4, Pester v5, #Requires -Module Pester v5, BeforeAll, Assert-True

12.2.3 Implementation strategy

This section explains the staged implementation strategy used to update thousands of tests while maintaining quality and momentum.

Key terms: implementation strategy, migration strategies, key areas, larger files, adjust our strategy

12.2.4 Managing large files

This section explains how splitting large test-file conversions into focused AI passes improved accuracy while keeping costs low.

Key terms: large files, separate steps, one task, passes, complex instructions, GPT-4o mini, nine passes, 3 cents per file, cost-efficient

12.2.5 Breaking down instructions into focused passes

This section explains how breaking a large AI code-update prompt into focused passes and reusing cached context improves accuracy, speed, and cost at scale.

Key terms: focused passes, main prompt, single clear goal, BeforeAll, Pester v5, Context blocks, prompt caching, cache write, cache read, Cline

12.2.6 The results

This section reports that AI-assisted test updates finished quickly and improved consistency, clarity, and maintainability across the dbatools test suite.

Key terms: Context block names, test names, PowerShell best practices, parameter handling, splatting, consistent standards, maintain, update, open source, dbatools

12.2.7 Lessons learned

Distills the model-selection and project-management lessons from using AI to update thousands of tests.

Key terms: Sonnet, GPT-4o mini, full-file changes, specific changes, $0.007 per file, large-scale code updates, large refactoring, organized, affordable, clear process

12.2.8 Beyond test updates: Other uses for AI-assisted development

This subsection generalizes the Pester migration as evidence that context-aware AI-assisted development can handle large code changes and motivates GenAIOps for managing AI tools and applications.

Key terms: Aider, Pester migration, code context, test structure, logic, setup code, proper blocks, assertion syntax, PowerShell best practices, GenAIOps

12.3 The GenAIOps lifecycle

This section introduces GenAIOps as an iterative lifecycle for taking generative AI applications from an idea through building and into monitored operation.

Key terms: GenAIOps, DevOps, generative AI applications, AI workflows, MLOps, LLMOps, CI/CD, machine learning, LLMs, ideation

12.3.1 Applying GenAIOps: A practical workshop example

This subsection uses Microsoft’s Build a Retail Copilot workshop to show how familiar DevOps, database, and monitoring practices apply to managing AI applications.

Key terms: Build a Retail Copilot, GenAIOps, customer service chatbot, Azure OpenAI Services, relevant information, database, AI model, standard DevOps tools, monitoring, hands-on exercises

12.4 Prompts used to write this chapter

This section lists example prompts used while writing the chapter, covering code-update planning, DevOps practice, format conversion, and code examples.

Key terms: GenAIOps, MLOps, LLMOps, Markdown, AsciiDoc, summary bulletpoints, First pass, #Requires -Module Pester v5, Pester v5

12.5 Summary

This summary recaps how AI supports DevOps work through coding assistance, automation, economical large-scale changes, and the GenAIOps lifecycle.

Where this is used later

Concepts explained in this chapter

← Chapter 11: Code assistants and development tools Chapter 13: Building AI-powered applications →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.