Backstage
    Preparing search index...

    Function getAzureFileFetchUrl

    • Given a URL pointing to a file on a provider, returns a URL that is suitable for fetching the contents of the data.

      Parameters

      • url: string

        A URL pointing to a file

      Returns string

      Converts

      • from: https://dev.azure.com/{organization}/{project}/_git/reponame?path={path}&version=GB{branch}&_a=contents
      • to: https://dev.azure.com/{organization}/{project}/_apis/git/repositories/reponame/items?path={path}&versionDescriptor.version={branch}&versionDescriptor.versionType=branch

      Branch (GB) and tag (GT) references retain their name and type in the download URL. URLs without a reference use the default branch.