繁体   English   中英

Python Azure function app in cd/ci pipelines getting build but in azure portal couldnt see the files

[英]Python Azure function app in cd/ci pipelines getting build but in azure portal couldnt see the files

我正在尝试通过 cd/ci 管道部署 azure function 应用程序

当我尝试使用 ZADCDBD79A8D84175C229B192AADC02 部署 python azure function 应用程序时,ZADCDBD79A8D84175C229B192AADC02 中的构建文件成功

构建和发布成功,但我可以在门户中看到文件

这是我的 yaml 文件

pool:
  name: Azure Pipelines
steps:
- bash: |
   if [ -f extensions.csproj ]
   then
       dotnet build extensions.csproj --output ./bin
   fi
  displayName: 'Build extensions'

- task: UsePythonVersion@0
  displayName: 'Use Python 3.6'
  inputs:
    versionSpec: 3.6

- bash: 'pip install --target="./.python_packages/lib/site-packages" -r ./requirements.txt'
  displayName: 'Install Application Dependencies'

- task: ArchiveFiles@2
  displayName: 'Archive files'
  inputs:
    rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
    includeRootFolder: false

- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact: drop'

发布成功,但是在azure门户中看不到文件

我无法在此处粘贴 img 以显示 azure 门户

您可以在 Function -> 开发部分查看 Azure function 文件。

  1. Function 在 VS 代码上创建

在此处输入图像描述

  1. Azure 开发运维 CI/CD在此处输入图像描述

  2. 检查 azure 门户上的 function 文件。在此处输入图像描述

参考。 该链接可进一步了解如何查看部署的 Azure function 文件 由markxa回答。

我没有在您的问题中找到 CD 部分。

CI管道:

trigger:
- none

pool:
  vmImage: 'windows-latest'

#CI step.
steps:

- task: ArchiveFiles@2
  inputs:
    rootFolderOrFile: '$(System.DefaultWorkingDirectory)/azurefunction'
    includeRootFolder: true
    archiveType: 'zip'
    archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
    replaceExistingArchive: true
- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'drop'
    publishLocation: 'Container'

CD管道:

#Trigger and pool definition here.

steps:
- task: DownloadBuildArtifacts@1
  inputs:
    buildType: 'specific'
    project: 'c6358b04-e91a-4bd1-a894-1adb543134d6'
    pipeline: '195'
    buildVersionToDownload: 'latest'
    downloadType: 'single'
    downloadPath: '$(System.ArtifactsDirectory)'
- script: |
    dir
  displayName: 'Run a multi-line script'
- task: AzureFunctionApp@1
  inputs:
    azureSubscription: 'xxx'
    appType: 'functionAppLinux'
    appName: 'xxx'
    package: '$(System.DefaultWorkingDirectory)/azurefunction'
    runtimeStack: 'PYTHON|3.9'

我的回购结构:

在此处输入图像描述

成功地站在我这边:

在此处输入图像描述

暂无
暂无

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

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