Azure / DevOps-Self-Hosted

This repository contains solutions to create and operate self-hosted agents for DevOps environments
MIT License
61 stars 16 forks source link

Remove `Az.Resources` dependency from cleanup tasks to enable a shift to an AzurePowerShell task #21

Closed AlexanderSehr closed 1 year ago

AlexanderSehr commented 1 year ago

Recently, it appears that PowerShell reacts in odd ways on MS-hosted agents that have multiple versions of e.g. Az.Accounts & Az.Resources installed.

We may be able to mitigate these issues by removing the Az.Resources dependency whereever we can. In case of, for example, the Image Template cleanupt task, we could even shift the Task from an AzureCLI to an AzurePowerShell task if we get rid of the Search-AzGraph -Query "Resources | where resourceGroup == '$resourcegroupName' | where name startswith '$imageTemplateName'" command in favor of, for example the REST API.