Azure Functions vanishing into thin air

When you create functions you can create functions in two different ways. You can edit the functions in Azure or you can create the functions in Visual Studio and deploy them to Azure. In this post I’m looking at both options and will described the situation I found myself in a while back when functions vanished into thin air.

First of all I’m going to have a look at the two different ways of creating functions.

Before  it is possible to create a function I need to create function app.

The Function App holds all the functions that you create.

Creating a Function in Azure Manually

You can create a new fucntion by clicking on the plus sign next to the Functions section in your function app.

New Function

You then get a few options given to create  your functions. The In-Portal option is quite nice as you can type your functions and you can see what the functions do without having to refer back to your code.

4 options to create function

Then you can select a template

Select a function template

In my case I selected the Webhook option and my function is ready to run. I can call this function from my favourite workflow engine, Microsoft Flow.

Ready to have a look at the other deployment options

Deploying a function to Azure with Visual Studio

It is also possible to publish your Functions to Azure using Visual Studio. This helps if you want to debug some code. You can simply set breakpoints and run the function like you would do with any other code in Visual Studio.

Imagine if you created some Functions in your Function app and you decide to create your next function in Visual Studio.

Great Idea? We will find out!

The steps in Visual Studio are.

 

Create a new project.

Select the template

Admire the code generated for you.

Now you can publish your function to azure functions.

Publish the function in Visual Studio

Now you can publish your function to Azure:

PublishMyApp

When you click on Ok, you will get a big clue!

Existing files is set to true

The delete existing files is set to true by default. So that when you create all your functions there is no mess left behind from previous versions. A good idea! But if you created some functions in a different way or different project before they will also be removed.

You can change this is the profile settings for your connection by deselecting the Remove additional files at destination setting.

 

Advertisements

Please leave a comment or feedback

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.