2017-03-09 59 views
0

使用appveyor是簡單的,如本文所描述部署蔚藍的功能來部署與蔚藍的功能以及自定義DLL - https://alastairchristian.com/deploying-azure-functions-from-appveyor-75fe03771d0c#.x7stvprna如何使用appveyor

而且什麼我無法弄清楚是如何部署自定義DLL(/bin文件夾中的相同庫的一部分)以便能夠使用#r並使用該引用。

手動過程只是使用Kudu複製/ bin文件夾中的dll文件並開始使用它。

也請參閱本討論appveyor - http://help.appveyor.com/discussions/questions/2842-deployment-to-azure-function-app

這裏是我的appveyor.yml -

- 
    branches: 
    only: 
     - master 

    version: 0.0.{build} 
    os: Visual Studio 2015 
    configuration: Release 
    init: 
    - nuget sources update -Name nuget.org -Source https://api.nuget.org/v3/index.json 
    environment: 
    SolutionDir: $(APPVEYOR_BUILD_FOLDER)\ 
    cache: 
    - packages -> **\packages.config 
    assembly_info: 
    patch: true 
    file: '**\AssemblyInfo.*' 
    assembly_version: '{version}' 
    assembly_file_version: '{version}' 
    assembly_informational_version: '{version}' 
    before_build: 
    - nuget restore -verbosity detailed 

    build: 
    verbosity: normal 
    project: MyLibrary\MyLibrary.csproj 
    publish_wap: true 
    publish_azure: true 
    parallel: true 

    artifacts: 
    - path: AzureFuncCIPOC 
    name: AzureFuncCIPOC 

    deploy: 
    - provider: WebDeploy 
    server: https://functioncipoc.scm.azurewebsites.net:443/msdeploy.axd?site=FunctionCIPOC 
    website: FunctionCIPOC 
    username: $FunctionCIPOC 
    password: 
     secure: <secure> 
    artifact: AzureFuncCIPOC 

回答

2

如果您的構建過程正在建設圖書館和移動輸出(您的自定義DLL),使被封裝在AppVeyor創建的工件中,它將與腳本一起部署。

+0

我不知道怎麼做,在這種情況下 – Abhishek

+1

有幾種方法可以做到,但是生成後動作/腳本(無論是作爲部分項目或AppVeyor)將您的DLL複製到AzureFunctionCIPOC文件夾中的適當位置,應該可以爲您提供所需的內容。 –

+0

Fabio,根據我對WebDeploy的理解,您無法訪問'bin'文件夾,對吧?我提出了一些解決方法[這裏](http://help.appveyor.com/discussions/questions/3419-how-to-deploy-custom-dll-along-with-azure-function) – ilyaf

0

我能夠將所需的dll複製爲項目構建後事件,然後使用與張貼的問題相同的.yml來實現我之後的功能。真的希望當VS2017的Azure Functions工具啓動時,VS 2017將會有更好的支持。

下面

是生成後事件命令

if not exist "$(SolutionDir)AzureFuncCIPOC\\ManualTriggerCSharp\bin\" mkdir "$(SolutionDir)AzureFuncCIPOC\\ManualTriggerCSharp\bin\" 
copy /y "$(TargetDir)" "$(SolutionDir)AzureFuncCIPOC\\ManualTriggerCSharp\bin\" 
+1

這正是我在下面推薦的內容:) 是的,我們工具的下一個版本將會對這種情況有更好的支持。 –

+1

期待! – Abhishek

+0

如果下面的答案有幫助,請將其標記爲答案以確保其他人也能獲得幫助。 –