简体   繁体   中英

How to setup a VSTS build definition to publish Azure Functions with this configuration?

We are using VS 2017 on a single solution with multiple projects and we right mouse click and deploy 3 C# Azure Function to two different Azure Function apps with slots.

How do you set up the VSTS build definition to accomplish this on every check in?

We are using the DLLs and setting up the function.json this way. I don't know if we need to deploy differently based on this type of configuration.

"scriptFile": "..\\bin\\target.dll",
"entryPoint": "target.Application.Run"

I was able to create a VSTS deployment through the following steps

Solutions structure

在此处输入图片说明

Build Configuration Steps

  1. Sync from master branch
  2. Added Nuget Restore using default options
  3. Added MSBuild Step with the followign optons
    • Project : vstsSolution.sln (Selected using '...')
    • MSBuild Version: Latest
    • MSBuild Architechture: MSBuild x86
    • Clean: Checked
    • Create Log File: Checked
  4. Added App Service Deploy for Function App1
    • Azure Subscription: Target Subscription
    • App Service Name: Target Function App
    • Deploy to slot: If you check this it allows you to select the actual slot you want to deploy to
    • Package or folder: FunctionApp1\\bin\\Debug\\net461
  5. Added App Service Deploy for Function App1
    • Package or folder: FunctionApp2\\bin\\Debug\\net461
  6. Make sure you selected "Hosted VS2017" Agent Queue for this build.

    All Build Steps

    在此处输入图片说明

  7. Triggers: Enable Continuous Integration. So that both function app deploy every time you check-in.

    Continuous Integration

    在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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