How to use the checkout keyword with dynamic parameters in Azure pipelines
When working with Azure Pipelines, the checkout keyword is typically used to reference a Git repository with a fixed name. For example in your Azure Pipeline you will add the following line:
-checkout:git://MyProject/MyRepository
While this works well for static scenarios, what if you’re working with multiple repositories? For instance, when automating tasks that iterate over a list of repositories, hardcoding each repository name becomes inefficient and error-prone.
Understanding the $LASTEXITCODE and exit codes in PowerShell
When working with Azure DevOps pipelines you will often want your tasks to run PowerShell scripts. Since the execution of the upcoming tasks can be dependent to the result of the current task, your script will have to inform about success or error.
For this task you can use exit codes, which indicate the success or failure of a command or script. We are also going to learn how to use the $LASTEXITCODE variable to determine the outcome of your commands.
How to replace the Moq framework with FakeItEasy in your unit-tests codebase
When working with unit tests in .NET, you might find yourself using the Moq framework to create mock objects. However, there are alternative frameworks like FakeItEasy that offer similar functionalities using a different approach. In this article, we’ll explore how to replace Moq with FakeItEasy, focusing on the following changes:
How to pass parameters at registration time in Autofac
Autofac is a powerful Inversion of Control (IoC) container for .NET applications that simplifies dependency injection (DI), and although it tends to be replaced by the .NET Core out-of-the-box DI, it is still in use in many web applications. You use Autofac to register concrete implementations to interfaces, so that at runtime these implementation are picked without the needing to use the new keyword.
More complex registrations often require to pass a list of parameters to the constructor of the concrete class. Today we are going to see how to do that.
How to solve the "Please remove the lock and try again error" in Azure
When working with Azure, you might encounter the error message Error: The scope ... cannot perform delete operation because following scope(s) are locked: ... Please remove the lock and try again while attempting to delete a resource. This error typically occurs when a resource is locked by another operation, preventing its deletion. In our example we will try to delete a Subnet in a Virtual Network.