3
votes

I'm trying to develop a function app that uses a timer trigger and I'm getting an issue with the Windows Platform FIPS that prevents the timer-triggered function to start locally. Here's the code that's causing the error (it's the default timer-triggered function):

using System;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;

namespace FunctionApp1
{
public static class Function1
{
    [FunctionName("Function1")]
    public static void Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, TraceWriter log)
    {
        log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
    }
}
}

When I try to run this function in func.exe, it produces the following error:

The listener for function 'Function1' was unable to start. mscorlib: Exception has been thrown by the target of an invocation. mscorlib: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.

This exact code works on another dev environment that I have access to. What do I need to do to fix these Windows Platform FIPS issues so that the timer trigger will run?

Thanks!

1
Any update? If you have managed to solve it, feel free to post your solution.Jerry Liu

1 Answers

1
votes

If your environment does need this FipsAlgorithmPolicy somewhere, disable it for Azure function only.

  1. In File Explorer, open %localappdata%\AzureFunctionsTools\Releases\1.4.0\cli\func.exe.Config, add <enforceFIPSPolicy enabled="false"/> under <runtime> element. Note that in this way, you have to repeat this step once new function cli is released.

  2. Similarly, if you use Storage Emulator locally, open C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe.config, add <enforceFIPSPolicy enabled="false"/> under element.

Else just disable FipsAlgorithmPolicy for your computer.

  1. In search box or right click on Start button and click Run, input regedit to open Registry Editor.

  2. In address bar(View>Address Bar), navigate to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy.

  3. Double click on Enabled, change Value data to 0.