Home / Companies / Octopus Deploy / Blog / Post Details
Content Deep Dive

Using classes in custom step templates

Blog post from Octopus Deploy

Post Details
Company
Date Published
Author
Shawn Sesna
Word Count
959
Language
English
Hacker News Points
-
Summary

Shawn Sesna's blog post discusses how to create a new DACPAC step template to support Azure Active Directory Managed Identity authentication using PowerShell and a custom class, without modifying existing templates to avoid breaking changes. The process involves provisioning an Azure SQL Server and a Virtual Machine (VM), configuring the VM to use Managed Identity, and granting authentication to the SQL Server either by setting the VM as the Active Directory admin or by adding it as an external login to a database. Sesna explains the use of .NET objects for SQL Server interaction, highlighting the need for an access token for managed identity authentication that cannot be included in the connection string. He further illustrates creating custom classes in PowerShell, overcoming limitations by defining classes in C# syntax and adding type references, thus enabling successful deployment of the DACPAC step template using managed identity. The post aims to guide users in implementing similar solutions and improving their PowerShell use in DevOps environments.