This post was most recently updated on March 28th, 2023.
2 min read.So, another interesting issue I ran into when developing Azure Functions locally. What an endless bag of funsies! đ This time, the issue was simple but infuriating â my Azure Functions host would just silently close when debugging: none of the breakpoints would be hit, and no information would be logged anywhere.
Azure Functions Core Tools (2.4.432 Commit hash: 3371a87e0fce2aa35986c0de8e77d5d618163b91)
Function Runtime Version: 2.0.12332.0
The system cannot find the file specified
Press any key to continue . . .
I first encountered this by the Azure Functions host just silently fail right after starting debugging. My earlier article about that is available here:
The underlying issue is shown when you start without debugging instead of simply debugging â i.e., if your keybindings are default, instead of F5 you hit Ctrl+F5.
With that, youâll run into a window showing the error in red.
Okay â thatâs a bit more clear now! But which file is it not finding? How to resolve the issue?
How to generate the certificate Azure Functions host is expecting to find?
The solution to this one was 2-fold.
In this particular solution, the Azure Functions host was started with custom command line parameters, due to some particular configuration requirements.
First of all, after a CLI update, my functions host stopped working without a certificate. So I had to generate one:
$cert = New-SelfSignedCertificate -Subject localhost -DnsName localhost -FriendlyName "Functions Development" -KeyUsage DigitalSignature -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.1")
Export-PfxCertificate -Cert $cert -FilePath certificate.pfx -Password (ConvertTo-SecureString -String password -Force -AsPlainText)
After this, the exported certificate.pfx had to be set to be copied to the output folder.
For your reference, this is what the changes look like in version control:
And thatâs it!
- âPerforming cleanupâ â Excel is stuck with an old, conflicted file and will never recover. - November 12, 2024
- How to add multiple app URIs for your Entra app registration? - November 5, 2024
- How to access Environment Secrets with GitHub Actions? - October 29, 2024