Loading data regularly–deploy plugins–Azure Function–part 34

Now I have broken the build. Why ?Because of the docker file – to be optimized on local, I copy ecah csproj one by one and the I do dotnet restore. (If docker had a glob patttern! ) . So each time that I put a new project, the build will fail!

Trying now from the Azure Function to load the plugins . Apparently, the deploying does not deploy also the plugins ( Application Insights , connected to the Azure function ,is your friend – it can show you all kind of messages)

But now I have a problem copying the plugins. I do in azure Function like I have done with the other projects;

A post-build event

dotnet pwsh $(ProjectDir)preBuild.ps1 “$(RepoRoot)plugins\”  “$(TargetDir)”

and a file prebuild.ps1 file that says

echo “args 0 ”  $args[0]
echo “args 1 ” $args[1]
$a= Get-Location
echo $a
echo now copy
Copy-Item -Path $args[0] -Destination $args[1] -Recurse -Force

For all other projects it is working. For the azure function, it gives an error at the compiling time on CI ( not on local! )

/bin/sh: 3: /tmp/tmpdd44ee8bfe4f49dca815035fe3a451ee.exec.cmd: Syntax error: Unterminated quoted string

I found the problem

dotnet pwsh $(ProjectDir)preBuild.ps1 “$(RepoRoot)plugins\”  “$(TargetDir)”

Now, a different error raises on Github CI when compiling the Azure Function:

The specified framework ‘Microsoft.NETCore.App’, version ‘2.1.0’ was not found.

The problem  is here: https://github.com/Azure/azure-functions-vs-build-sdk/blob/master/src/Microsoft.NET.Sdk.Functions.MSBuild/Targets/Microsoft.NET.Sdk.Functions.targets 

<_FunctionsTaskFramework Condition=” ‘$(MSBuildRuntimeType)’ == ‘Core'”>netcoreapp2.1</_FunctionsTaskFramework>

I try to build into an netcoreapp3.0 docker container. I must install 2.1, probably.

For github actions:

– name: Setup .NET Core 2.1
       uses: actions/setup-dotnet@v1
         dotnet-version: 2.1.802

    – name: Setup .NET Core 3.0
       uses: actions/setup-dotnet@v1
         dotnet-version: 3.0.100

Not working!

But a new idea – what if I have the project not up-to-date  ? And indeed , the nuget for azure functions was not update. Now it works for GitHub actions!https://github.com/ignatandrei/InfoValutar/actions

Now , back to work  – I want to deploy the plugins in the Azure Function

Reading about ExecutionContext – ok. Reading about difference between FunctionAppDirectory and  FunctionDirectory  –https://github.com/Azure/azure-functions-host/wiki/Retrieving-information-about-the-currently-running-function . Ok – I want FunctionDirectory – I think it is just for this function.

For uploading files and folder, there are 2 ideas:

  1. to have included in .csproj ( do not want the plugins to be included !)
  2. To include in the zip file https://docs.microsoft.com/en-us/azure/azure-functions/deployment-zip-push 

So CI / CD to the rescue. I will do in AzureDevOps – next time!


And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe