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.

console

Once you are in the console, type dir to display the contents of wwwroot

dir

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

copy

Typing dir again I can now see the function.proj file which is zero bytes in size.

dir2

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.

menu

After selecting the file I am able to enter data/code in to the new file and select Save once complete.

paste

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.

dir3

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.