Have you ever developed Azure Functions and suddenly they vanished into this air?

Azure Functions

When you create Azure 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.

A Function App in Azure

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 function by clicking on the plus sign next to the Functions section in your function app.

My New Function in Azure

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 a function in Azure

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.

An Azure Function that is ready to run

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.

Visual Studio create a new function

Select the template

Select a function template i Visual Studio

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.

Remove Additional files at destination setting

Discover more from SharePains

Subscribe to get the latest posts sent to your email.

Avatar of Pieter Veenstra

Is your business still running on paper trails, sprawling Excel files, or ageing Access databases? There's a better way — and I can show you exactly what it looks like. I'm the Technical Director of Vantage 365, a Microsoft solutions consultancy working with clients across the UK, the Netherlands, and worldwide. For over 30 years I've been turning messy, manual business processes into clean, automated systems that save time, reduce errors, and give teams the visibility they need to make better decisions. SharePains is not just any blog run by a Microsoft MVP. Have you ever used Try-Catch in Power Automate? The original post about Try-Catch in Power Automate can still be found on this site, https://sharepains.com/2018/02/07/try-catch-finally-in-power-automate-flow/ Or have you ever used the Pieter’s method to avoid variables and speed up your flows? https://sharepains.com/2020/03/11/pieters-method-for-advanced-in-flows/ You can contact me using contact@sharepains.com

Related Posts

Leave a Reply

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

Discover more from SharePains

Subscribe now to keep reading and get access to the full archive.

Continue reading