JamesRandall / FunctionMonkey

Write more elegant Azure Functions with less boilerplate, more consistency, and support for REST APIs. Docs can be found at https://functionmonkey.azurefromthetrenches.com
MIT License
294 stars 50 forks source link

Azure CI Pipeline Build Issues #113

Closed mdg215199 closed 4 years ago

mdg215199 commented 4 years ago

I was trying to get the azure ci pipeline and having issues in both funciton monkey 3.0.17 and also 4.0.26-beta.2. On 4.0.26-beta.2, I ran into same issue as https://github.com/JamesRandall/FunctionMonkey/issues/111

image

so, after having issues in that one, I switched back to 3.0 (running 3.0.17 on functionmonkey), and getting the following error now: image

Does anyone else using Azure CI? Maybe azure function isn't supported in azure CI?

Image of the yaml CI: image

JamesRandall commented 4 years ago

I could definitely imagine #111 and the beta causing the same issue in Azure CI but I'm not aware of any issues with v3. I've got a number of projects publishing from DevOps though admittedly they predate yaml pipelines.

When you downgraded to v3 from the beta did you also downgrade to .NET Core 2.1 and v2 of Functions?

mdg215199 commented 4 years ago

I was trying to read the versions of the releases, which I thought we could use netcoreapp3.0, so my csproj is set as:

  <PropertyGroup>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <AzureFunctionsVersion>v2</AzureFunctionsVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="FunctionMonkey" Version="3.0.17" />
    <PackageReference Include="FunctionMonkey.Abstractions" Version="3.0.17" />
    <PackageReference Include="FunctionMonkey.FluentValidation" Version="3.0.17" />
    <PackageReference Include="FunctionMonkey.Compiler" Version="3.0.17" />
    <PackageReference Include="FunctionMonkey.SignalR" Version="3.0.17" />
    <PackageReference Include="FunctionMonkey.TokenValidator" Version="3.0.17" />

    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventGrid" Version="2.1.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.10" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="4.0.0" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.1" />
  </ItemGroup>

I was attempting to make changes in the Microsoft.Azure.WebJobs.Extensions.ServiceBus as well. Not sure if that helps?

The other good part, I saw you had mentioned that the fix for #111 will likely be added in v4-beta3, which likely will resolve my issue :) I'll try to get the environment running so I can better troubleshoot some of the issues too.

mdg215199 commented 4 years ago

I'm going to close this. I mainly had gotten used to using the publish w/in azure CI, that said, using dotnet build --configuraiton release gives you the same files (for the most part at least). In azure devops CI, it works fine with no issues with functionmonkey compiler. For users who have to deploy using VSC and/or VS, publish is likely still required (though azure cli could do the same using release build to docker/zip and moving it from there).

Anyways, issue 111 will fix the publish, so there's no point to keep this ticket it up.

Oh, and in case this helps anyone else, this yaml file works (if you need to run it as an ci agent w/in linux you should be able to use 'ubuntu-latest':

trigger:
- master

pool:
  vmImage: 'windows-latest'

steps:

#install giversion nuget to assist with setting versions in place
# note, the released one doesnt work in ubuntu and has to be used using beta release of 5.0 
- script: |
    dotnet tool install --global GitVersion.Tool
  displayName: "GitVersion Setup and Run"

- task: DotNetCoreCLI@2
  inputs:
    command: build
    arguments: '--configuration Release --output publish_output'
    projects: 'src/MotionCX.WorkfloEventStore.FunctionTest/MotionCX.WorkfloEventStore.FunctionTest.csproj'
    publishWebProjects: false
    modifyOutputPath: true
    zipAfterPublish: false

- task: ArchiveFiles@2
  displayName: "Archive files"
  inputs:
    rootFolderOrFile: "$(System.DefaultWorkingDirectory)/publish_output"
    includeRootFolder: false
    archiveFile: "$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip"
- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip'
    artifactName: 'drop'