Azure Pipeline Yaml错误:当前操作系统无法运行此任务 [英] Azure Pipeline Yaml Error: The current operating system is not capable of running this task

查看:83
本文介绍了Azure Pipeline Yaml错误:当前操作系统无法运行此任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我编写的用于将文件复制到我的Azure blob的任务,它在Windows上可以正常工作,但对于mac和linux,它给我错误,因为当前操作系统无法运行此任务.通常,这意味着该任务仅针对Windows编写.我该如何解决?

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?

出现错误的Yaml任务:

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)

任务:

 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

推荐答案

Azure CLI任务作为替代.

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.

这篇关于Azure Pipeline Yaml错误:当前操作系统无法运行此任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆