Introduction
In this short post I will walk through the process to create new files for your Azure Function project, using the Console tool. This may come in handy for people who develop their Azure functions from the Azure portal.
As stated when opening the Console development tool:
“Manage your web app environment by running common commands (‘mkdir’, ‘cd’ to change directories, etc.) This is a sandbox environment, so any commands that require elevated privileges will not work.”
Getting Started
From the Azure portal, open your function app and under Development Tools, select Console.
Once you are in the console, type dir
to display the contents of wwwroot
Change directory into the function. My function in the example below was called HttpTrigger1 so I typed
cd HttpTrigger1
From here I can create a new file called function.proj by typing the following:
copy nul function.proj
Typing dir
again I can now see the function.proj file which is zero bytes in size.
Moving back to the function in the portal and selecting Code + Test, the new function.proj file is available in the drop-down list of files.
After selecting the file I am able to enter data/code in to the new file and select Save once complete.
And back in the Console again and after navigating to the function root, typing dir
again will show the function.proj file is now 258 bytes in size.
And files can also be deleted from here using the del command as follows:
del function.proj
Hopefully this may be of use for people who develop their Azure functions from the Azure portal, or may simply need to test new functionality.