Actually the title of this post should be "Debugging your serverless apps locally".
I found a utility while working on Azure functions which helps you debug the function locally(if you have the source code, obviously). It is called ngrok. They have a pretty awesome website and very simple docs.
Steps to proceed are as below.
I found a utility while working on Azure functions which helps you debug the function locally(if you have the source code, obviously). It is called ngrok. They have a pretty awesome website and very simple docs.
Steps to proceed are as below.
- Make sure your Azure function is up and running in your machine and you are able to hit the breakpoint from your local.
- Signup on the ngrok website.
- Download the ngrok utility(its an exe file). double click to execute. It opens a command prompt.
- Connect to your account. Upon login to ngrok website you will get an auth token which you have to use to connect to your account. command to execute "ngrok authtoken <your_token_here>". This step will create a .yml file in your users directory.
- Create a tunnel. Use command "ngrok http 7071". 7071 is the port you want to expose. I used it because its the default port for Azure function apps.
- Use the url provided by the ngrok utility to hit the breakpoint on your function from the internet.
No comments:
Post a Comment