Skip to main content

Tag: Software

Chaining YAML Pipelines in Azure Devops

In this article, we’ll take a quick look at chaining two pipelines together in Azure Devops, so that the completion of one pipeline, triggers the other to run. Microsoft documentation is leaps and bounds ahead of where it used to be. However, I still feel like there is a lot of room for improvement, as it took me a while to figure this out. Our two pipelines will exist in the same repository.

Update Azure Devops SPN Secret

If you need to update the secret for a service principal in Azure Devops, prior to it expiring, you may be surprised to find that this cannot be done via the Azure Portal. In this article, I’ll show you two methods for updating a secret for a service principal prior to expiration. Update the secret via the Azure Devops Portal: Go to “Service Connections” in the Azure Devops portal Find the SPN you want to update, then click “Manage Service Principal” Then on the service principal page, click Certificates & Secrets Create a “New Client Secret”, take note of the value Delete the ‘old’ secret Return to the Service Connection in the Azure Devops portal Click Edit - click the verify button.

Use “replace” in go.mod to Point to a Local Module

If you want to the local version of a dependency in Go rather than one in a remote repository, use the replace keyword. The replace line goes above your require statements, like so: module github.com/rnemeth90/foo replace github.com/rnemeth90/bar => /Users/rnemeth90/Projects/bar require ( github.com/rnemeth90/bar v1.0.0 ) Now when you compile this module go build or go install, it will use your local code rather than the remote dependency. According to the docs, you do need to make sure that the code you’re pointing to also has a go.

Powershell for Devops - Querying REST APIs with Powershell

This will be a short post on querying REST APIs with Powershell. It’s hard to argue that REST APIs are the predominant technology for interacting with networked services. They provide a gateway for interacting with a 3rd party (or self-hosted) product without having to go through the exercise of a more complicated integration. REST APIs communicate in a common format, typically JSON. However, most will allow us to choose the response format by specifying an option in the ‘Accept’ header.

Reading Json Files with Go

JSON is a widely used format for representing structured data. Developers like it because it is easy to read, most common languages have a library for interacting with it, and most public APIs accept JSON in HTTP requests. In this post, we’ll look at parsing a JSON file using Go! We will be using the io/ioutil package to open a json file on local disk, and encoding/json to parse the JSON data within the file into a memory structure.