DEV Community

Create & Deploy Azure Function ⚡ using VS code and Azure DevOps (CI/CD)

Usama Ansari on March 30, 2019

Azure Function 🚀 is Microsoft faas (function as a service) offering. Where you can build apps without worrying about server and infrastructure tha...
Collapse
 
shajay99 profile image
ajay sharma

Usama Sir, I am getting this error while running the Pipeline.

**##[error]d:\a\1\s\Hermes.sln.metaproj(0,0): Error MSB3202: The project file "d:\a\1\s..\Hermes.Test\Hermes.Test.csproj"

Sir, please post the azure-pipelines.yml file, which is created with above azure function.

Collapse
 
usmslm102 profile image
Usama Ansari

Can you post the complete error message. If possible please dm me on Twitter.

Collapse
 
shajay99 profile image
ajay sharma

Sir, on twitter, i could not send all text.

Build started 11/17/2019 10:44:54 AM.
Project "d:\a\1\s\Hermes.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Release|Any CPU".

[error]d:\a\1\s\Hermes.sln.metaproj(0,0): Error MSB3202: The project file "d:\a\1\s..\Hermes.Test\Hermes.Test.csproj" was not found.

d:\a\1\s\Hermes.sln.metaproj : error MSB3202: The project file "d:\a\1\s..\Hermes.Test\Hermes.Test.csproj" was not found. [d:\a\1\s\Hermes.sln]
Project "d:\a\1\s\Hermes.sln" (1) is building "d:\a\1\s\Hermes.csproj" (2) on node 1 (default targets).
PrepareForBuild:

Thread Thread
 
usmslm102 profile image
Usama Ansari

It seems you have deleted the test project but the reference is still there in solution file. If you delete the project from file explorer you have to remove the reference from solution file as well. If you can provide me more details the project structure and the build yaml file I can help you more on this.

Thread Thread
 
shajay99 profile image
ajay sharma • Edited

Usama Sir, Request you to please check if the stages of the Pipeline is OKay, as now all the stages are passing. And here it the YAML file. sorry the formatting is not OKay.

trigger:

  • master

pool:
vmImage: 'windows-latest'

variables:
solution: '*/.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'

steps:

  • task: NuGetToolInstaller@1

  • task: NuGetCommand@2
    inputs:
    restoreSolution: '$(solution)'

  • task: VSBuild@1
    inputs:
    solution: '$(solution)'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

  • task: VSTest@2
    inputs:
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

Thread Thread
 
usmslm102 profile image
Usama Ansari

Build pipeline looks ok. There might be the issue with your solution file. You might have a reference of "Hermes.Test.csproj" in your solution file but the actual csproj file doesn't exist.

Thread Thread
 
shajay99 profile image
ajay sharma

Thanks Usama Sir.. thanks for guiding me..
Sir, in my pipeline, PUBLISH and PUBLISH ARTIFACT are not visible. Have I selected wrong template ??

Collapse
 
bananbe profile image
Mateusz

Nice post, it was useful for me :)
One minor thing from me:
you have linked wrong files for jsons ie. for functionapp.parameters.json there is functionapp.json and for functionapp.json there is content from functionapp.parameters.json.

Collapse
 
anderslundgren profile image
Anders Lundgren

Great post, very helpful!
Two minor cut-and-paste typos:
CI pipeline step #9: Checked: Publish Web Projects should be removed (States correctly that this should be un-checked a couple of lines above)
CD pipeline step #12: Template parameters: East US should be the template param file instead

Collapse
 
usmslm102 profile image
Usama Ansari

I'm glad this post helped you and thanks for pointing out those typos.

Collapse
 
arihjain profile image
Arihant Jain

Very good post it was very helpful for me to start my DevOps journey in Azure. Appreciate it.

Collapse
 
shajay99 profile image
ajay sharma

Hi Usama Ansari, Sir, request you to please create a Video on Youtube on this CICD DevOps Azure Pipeline

Collapse
 
shajay99 profile image
ajay sharma

Usama Sir, Great tutorial by you, Please post some more Azure DevOps Tutorials.