I can't for the life of me understand what this api wan't from me ! I made a query to get the extensionId and publisherId from the cli. I connect with my tenantId because an admin PAT is not enough. Now he can't find it ?
function azLogin {
param ( [string]$organization, [string]$tenant)
az login --tenant $tenant
}
[string]$tenant = $args[0]
[string]$organization = $args[1]
[string]$extension = $args[2]
[string]$publisher = $args[3]
try {
azLogin $organization $tenant
$result = az devops extension search --search-query Timetracker | ConvertFrom-Json
$extensionId = $result.extensionId
$publisherId = $result.publisher.publisherId
Write-Host $publisherId
az devops extension install --extension-id $extensionId --publisher-id $publisherId
if ($result.PSObject.Properties.Name -notcontains 'extensionId' -or $result.PSObject.Properties.Name -notcontains 'publisherId') {
throw
}
}
catch {
Write-Error "##[ERROR] failed."
}
At this point it's supposed to install this the organisation but i get :
The requested extension 'ecbf0d3e-ca03-4972-88ad-edcd1cb4a69c.83b3c590-5cd3-495b-b401-b8b4ed6da230' doesn't exist.
How am i supposed to install an extension in my organisation using powershell and a pat only ?
Use azure devops service rest api may make things simple if you use
PAT, API REFERBelow example shows how to install azure devops extension
SonarQube(you can choose any extension you want), just copy and replace your ownuserName,PAT,orgNamemy example result: