I have a VS solution with multiple projects, each project is an independent WebJob which I am hosting in a Single AppServices. I am trying to automate this to Continuous deployment.What would be the best strategy to deploy only job in the solution which is changed? Is there a way to find out the project which is changed as part of the merge to CI? We are using git and this solution is in a single repository. We are using azure-webjobsdk for the projects.
相关问题
- Docker task in Azure devops won't accept "$(pw
- Authentication Failure using Git-LFS Azure DevOps
- Authentication Failure using Git-LFS Azure DevOps
- Getting error: File extension specified '.webt
- “No test result files matching **/*.trx were found
相关文章
- Build errors of missing packages in Visual Studio
- VSTS continuous integration triggers not working
- Azure WebApp - Unable to auto-detect the runtime s
- Download Azure web app?
- Azure Web App Temp file cleaning responsibility
- Close a work item via the commit message
- Increment variable value in TFS build +1
- When publishing website on azure, webjobs are dele
You can have different WebJobs project(WebJob1.csproj, WebJob2.csproj) in a single solution and you can deploy using single build and release pipeline. All you need to do is :-
In your build solution step define:-
Visual Studio Build (Solution: ***.sln, MSBuild Arguments: /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\")
Publish Build Artifacts (Path to Publish: $(build.artifactstagingdirectory); Artifact Name: drop; Artifact Type: Server)
Create a release definition for this build definition and add a task
You can similary create another Azure App Service Deploy task for WebJob2.zip and deploy as many webjobs you want through a single build and release pipeline.
You can follow below steps to deploy the only changed webjob:
Assume your file structure as below:
1. Add a variable (such as
buildporj
with default valuenone
) to record the changed webJob project package.2. Add NuGet restore task for the
WebJob1/WebJob1.sln
.3. Add Visual studio Build task with the MSBuild arguments:
4. Add PowerShell Task to detect which WebJob project changed and copy the package from
$(Build.BinariesDirectory)
to$(Build.ArtifactStagingDirectory)
by the script as below:$(Build.ArtifactStagingDirectory)\**\$(buildproj)
.