My Blog

Sharing programming insights since 2015. 160 articles (and counting!) filled with real-world experience and practical tips.

    The "No user assigned or delegated managed identity found for specified clientid/resourceid/principalid" in Azure and how to solve it

    When working with Managed Identities in Azure you might encounter the error No user assigned or delegated managed identity found for specified clientid/resourceid/principalid.

    But first of all let us see what a Managed Identity is and does.

    Read the complete article

    How to use the existing keyword for accessing Azure resources in your Bicep files

    When working with Azure Bicep, you can safely reference an existing Azure resource using the existing keyword. This eliminates the risk of unintended modifications or deletions.

    Here’s the syntax to retrieve an existing resource:

    Read the complete article

    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.

    Read the complete article

    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.

    Read the complete article

    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:

    1. Instantiating a New Mock
    2. Setting up / Mocking the response of a method
    3. Setting up properties
    4. Passing the Mock as a parameter to a class
    5. Replacing the Protected method of Moq
    6. Verifying method calls
    Read the complete article