Problem
The organization parameter is defined in the PowerShell script backup-repos.ps1 but is never used. The script relies on Azure CLI configuration instead.
Current State
- PowerShell Script: The
organization parameter is defined but not used
- run.sh: Sets the organization via
az devops configure --defaults organization=https://dev.azure.com/$AZURE_DEVOPS_EXT_ORG
- README.md: Documents the parameter, but it's misleading since it's not actually used
Possible Solutions
Option 1: Use the parameter
The PowerShell script should use the organization parameter to set the Azure CLI configuration:
if ($organization) {
az devops configure --defaults organization=https://dev.azure.com/$organization
}
Option 2: Alternative approaches for setting organization
-
Azure CLI Configuration (currently used):
az devops configure --defaults organization=https://dev.azure.com/[ORG]
-
Environment Variable AZURE_DEVOPS_EXT_ORG (used in Docker container):
export AZURE_DEVOPS_EXT_ORG=contoso
-
Parameter with each az devops command:
az devops project list --organization https://dev.azure.com/[ORG]
Recommended Solution
- Use the
organization parameter in the PowerShell script
- Update README.md to document all available options
- Implement fallback logic: Parameter → Environment Variable → Configuration
Affected Files
backup-repos.ps1: Use the parameter
README.md: Update documentation
run.sh: Possibly adjust for consistent parameter passing
Additional Context
The current implementation causes confusion because:
- Users pass the
-organization parameter but it has no effect
- The actual organization is set via environment variable or CLI configuration
- Documentation doesn't reflect the actual behavior
Problem
The
organizationparameter is defined in the PowerShell scriptbackup-repos.ps1but is never used. The script relies on Azure CLI configuration instead.Current State
organizationparameter is defined but not usedaz devops configure --defaults organization=https://dev.azure.com/$AZURE_DEVOPS_EXT_ORGPossible Solutions
Option 1: Use the parameter
The PowerShell script should use the
organizationparameter to set the Azure CLI configuration:Option 2: Alternative approaches for setting organization
Azure CLI Configuration (currently used):
Environment Variable AZURE_DEVOPS_EXT_ORG (used in Docker container):
export AZURE_DEVOPS_EXT_ORG=contosoParameter with each az devops command:
Recommended Solution
organizationparameter in the PowerShell scriptAffected Files
backup-repos.ps1: Use the parameterREADME.md: Update documentationrun.sh: Possibly adjust for consistent parameter passingAdditional Context
The current implementation causes confusion because:
-organizationparameter but it has no effect