繁体   English   中英

在 windows 图像上使用 Azure DevOps 管道运行 Azurite

[英]Run Azurite with Azure DevOps Pipelines on windows image

我正在尝试从 Azure DevOps 管道运行并连接到 azurite。 这就是我的管道的样子

trigger:
  - '*'

stages:
  - stage: 'test'
    displayName: 'test'
    jobs:
     - job: 'Build_job'
       displayName: 'Build job'
       pool:
         vmImage: 'windows-2022'
       steps:
              
          - task: NodeTool@0
            displayName: 'Use Node.js'
            inputs:
              versionSpec: '16.*'

          - task: PowerShell@2
            displayName: 'Install and launch Azurite'
            inputs:
              targetType: 'inline'
              script: |
                npm install -g azurite 
                mkdir c:/azurite
                Start-Job -ScriptBlock { azurite --silent --location c:\azurite --debug c:\azurite\debug.log  }
              pwsh: true

          - task: PowerShell@2
            displayName: 'Check Azurite availability'
            inputs:
              targetType: 'inline'
              script: |
                curl 127.0.0.1:10000
                curl localhost:10000
              pwsh: true

它在可用性检查中失败。 在此处输入图像描述

相同的管道在 ubuntu 图像上工作正常,但我的项目对 Windows 有一些依赖性。如何连接到 windows 图像上的 azurite?

当您使用共享的 Microsoft windows 代理时,您无法执行端口连接,因为 Microsoft 禁止这些资源。 您将需要在专用代理上安装该工具才能执行相同的任务。

您可以通过从 .netstat 获取有关侦听端口的 output 来验证这一点。

netstat -ano | findstr "LISTENING"

在此处输入图像描述

附上相同的答案:

如何在 VSTS 构建代理的本地主机上打开 TCP 端口?

Azure Devops azure 管道代理 TCP 连接失败

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM