2

I have created a build pipeline for the Unity3D project in Azure DevOps. I have successfully generated artifacts for the Unity3D project. I want to upload the artifacts of the Unity3D project into SharePoint Online using the Azure DevOps release pipeline.

So, can anyone suggest to me if there is any release task to upload files into SharePoint Online using the Azure DevOps release pipeline?

3 Answers 3

1

Yes, you can upload your artifacts on sharepoint directory. Please find the Azure devops extension which will do the work.

https://marketplace.visualstudio.com/items?itemName=halliba.az-pipelines-2-sharepoint

This extension is well documented and all the necessary steps are given.

Thanks

Sign up to request clarification or add additional context in comments.

Comments

1

You can use AzurePowerShell@5 Task to achieve this, More details here on this URL https://dev.to/kkazala/azure-devops-pipeline-with-workload-identity-federation-2gpj

Following is sample code

  - task: AzurePowerShell@5
    name: Upload Folder To SP
    inputs:
      azureSubscription: {SerivicePrincipal Name Created in ADO}
      azurePowerShellVersion: latestVersion
      ScriptType: InlineScript
      Inline: |

        try {
          $azAccessToken = Get-AzAccessToken -ResourceUrl "https://{tenantID}.sharepoint.com"
          $siteUrl = "https://{tenantID}.sharepoint.com/sites/{sitename}"
          $conn = Connect-PnPOnline -Url $siteUrl -AccessToken $azAccessToken.Token  -ReturnConnection
          Write-Host $conn.Url
        }
        catch {
            Write-Host "##[error] 1 (Connect-PnPOnline -AccessToken): $($_.Exception.Message)"
        }

        try {

          $lists = Get-PnPList -Connection $conn
          Write-Host "List names:"
          $lists | ForEach-Object { Write-Host $_.Title }
          
          $sharePointFolderUrl = "$siteUrl/Dokumente"

          Add-PnPFolder -Name $folderName -Folder $sharePointFolderUrl -Connection $conn


        }
        catch {
          Write-Host "##[error] 2 (Add-PnPFolder): $($_.Exception.Message)"
        }

Note: You have to use following command to provide permission for specific site

Grant-PnPAzureADAppSitePermission -AppId 'xxx'  -Site 'https://xx.sharepoint.com/sites/{sitename}' -Permissions Write

Comments

0

As an alternative, I described a solution using Power Automate to extract artifact from Azure Pipeline and upload to SharePoint: How to extract files from Azure Pipeline artifacts using Power Automate

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.