Posts

Testing Azure Functions locally with automated integration test

Image
I am investing more and more time and efforts into building Azure Functions and using serverless instead of WebApps. Greater stability and balancing makes it my first choice when need high quality API. Being big fun of automated testing, faced some issues when coding tests and could not find any useful/working examples. Sources can be found here Some steps here Create function with HTTP trigger using template, dont need anything fancy there. Base it on .Net Core 3.1, you can change it, but then check the path in Test project Create MS Test project Folder structure Project structure Important step, install Azure Function tools from command line, just run npm i -g azure-functions-core-tools after that you can test if it is available from command line The idea is to start functions engine from test project. In local environment you can start it from your command line using Func utility, same can be done from Test project. From command line it will look like this F