ZZZSharePoint
ZZZSharePoint

Reputation: 1341

Azure Pipeline Yaml Error: The current operating system is not capable of running this task

below is the task I have written to copy files to my Azure blob, it works fine with Windows but for mac and linux it gives me error as "The current operating system is not capable of running this task. That typically means the task was written for Windows only" How could I fix this?

The Yaml task where I get the error:

strategy:
          matrix:
            win:
              imageName:            'windows-2019'
              RootSuffix:           'x64-windows-staticlib'
              osSuffix:             'windows'
              LibFT4222Suffix:      'windows'
              matlabVersion:        '9.6.0-2'
              extraCmakeOptions:    ''
            mac:
              imageName:            'macOS-10.15'
              RootSuffix:           'x64-osx'
              osSuffix:             'osx'
              LibFT4222Suffix:      'x64-osx'
              matlabVersion:        '9.5.0'
              extraCmakeOptions:    ''
            linux:
              imageName:            'ubuntu-18.04'
              RootSuffix:           'x64-linux'
              osSuffix:             'linux'
              LibFT4222Suffix:      'linux'
              matlabVersion:        '9.5.0'
              extraCmakeOptions:    ''

        pool:
          vmImage: $(imageName)

And the task:

 task: AzureFileCopy@2
          displayName: 'Publish ABC to Blob'
          inputs:
            SourcePath: '$(Build.SourcesDirectory)/ABC-$(osSuffix)'
            azureSubscription: 'Azure CICD'
            Destination: AzureBlob
            storage: '$(BlobStorageAccount)'
            ContainerName: '$(BlobContainer)'
            BlobPrefix: '$(BlobPrefix)/ABC/$(DeploymentVersion)'
            AdditionalArgumentsForBlobCopy: '/V /S'
            outputStorageUri: BlobUri
            outputStorageContainerSasToken: BlobSASToken

Upvotes: 1

Views: 3493

Answers (1)

Edward Han-MSFT
Edward Han-MSFT

Reputation: 3185

This Azure File Copy task is written in PowerShell and thus works only when run on Windows agents. If your pipelines require Linux agents and need to copy files to an Azure Storage Account, consider running az storage blob commands in the Azure CLI task as an alternative.

Upvotes: 2

Related Questions