Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export not working for on-premises versions of Azure DevOps #4

Open
hideintheclouds opened this issue Jun 30, 2021 · 4 comments
Open

Comments

@hideintheclouds
Copy link

@tsteenbakkers The current configuration does not support Azure DevOps on premises, due to the hardcoding of the host in Get-AzdoAPIURL.ps1 ( $sb.Append('dev.azure.com') | Out-Null)
I was able to make minimal changes to have this working with On-premises AzDO, by adding the following changes:

  • Get-AzdoAPIURL.ps1 (starting with line 16):

    `$profile = Get-AzdoAPIToolsProfile -profilename $profilename
     $subdomain = $profile.Organization
     $baseUrl = If ([string]::IsNullOrWhiteSpace($profile.collectionUrl)) {'dev.azure.com'} Else {$profile.collectionurl}
     
     $sb = New-Object System.Text.StringBuilder
    
     $sb.Append('https://') | Out-Null
     if($area -eq 'Release'){
        $sb.Append('vsrm.') | Out-Null
     }
     $sb.Append($baseUrl) | Out-Null`
    
  • Get-AzdoAPIURL.ps1 (adding a new variable for the collectionUrl):
    $collectionUrl = Read-Host -prompt "Optional: Please provide the collection url if the instance of Azure DevOps is on premisses(tfs.yourlocalserver/tfs). The protocol is not needed"

@tsteenbakkers
Copy link
Collaborator

tsteenbakkers commented Jul 1, 2021 via email

@hideintheclouds
Copy link
Author

hideintheclouds commented Jul 1, 2021

Hey Tobi,

According to the Azure DevOps REST api documentation (https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-6.1):

A REST API request/response pair can be separated into five components:

The request URI, in the following form: VERB https://{instance}[/{team-project}]/_apis[/{area}]/{resource}?api-version={version}

instance: The Azure DevOps Services organization or TFS server you're sending the request to. They are structured as follows:
Azure DevOps Services: dev.azure.com/{organization}
TFS: {server:port}/tfs/{collection} (the default port is 8080, and the value for collection should be DefaultCollection but can be any collection)

I think the rest of the calls should be the same, just have to set the instance to {server:port}/tfs/. In my example, I am using the organization in the config for the {collection} above.

I have tested this partially with an on-premises instance of Azure DevOps (without internet connection) and it seems to work nicely for extracting and saving the TaskGroups and BuildDefinitions.
I have not tested the other methods (i.e. variables, triggers, etc).

I am not sure I have rights to commit/create pull requests, so I have forked the repo and commited the change here:

hideintheclouds@ca11f9c

Please let me know if there is anything I could do for the PR.

Thanks,
Adrian

@tsteenbakkers
Copy link
Collaborator

tsteenbakkers commented Jul 7, 2021 via email

@hideintheclouds
Copy link
Author

Hi Tobi,

Regarding the Azure Devops Server and the updating process, I think you are spot on, and that each client will apply their updates manually.

I am not sure how many companies are still using TFS, probably some of them have already migrated to Azure Devops Server.
Note: I have tested the previous change with Azure DevOps Server 2020, unfortunately I cannot use an older version, like TFS to confirm that it above work as expected.

In regards to the Github profile mentioning, that's not a problem at all.

Kind regards,
Adrian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants