1

I have an Azure Function (not in a container).

When I publish it to Azure locally, it's fine.

When I publish it from Azure Devops, the deployment succeeds, but the Function wont run. Error 'Azure functions runtime is unreachable':

enter image description here

I've tried looking in the Log Stream, but this gives the error:

System.Private.CoreLib: Could not load file or assembly '{myAppName}, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

I've looked at documents such as this troubleshooting guide, but that's not fixing it.

JsAndDotNet
  • 16,260
  • 18
  • 100
  • 123

1 Answers1

0

When publishing locally, the standard publish format is 'Portable'. This is not precompiled, so the Functions App will compile it when starting up the app.

enter image description here

However, when publishing from CI/CD, I was compiling as part of the publish, using the following command:

dotnet publish projectName --framework $framework -r win-x64 -c Release

Obviously, this is an x64 build.

I checked the App Service Configuration, and it was set to x86.

Changing it to x64 fixed the problem when deploying from DevOps.

enter image description here

I then also changed the local publish to x64, just to save compile time on startup.

JsAndDotNet
  • 16,260
  • 18
  • 100
  • 123