How to create F# azure function - azure

Trying to create azure function in F# in the azure portal.
Selected .net as a runtime in function app settings, and now when I create new function C# one got created by default and there is no way to select or change language.

Azure Functions 2.x doesn't currently support .fsx scripts because of issues with F# Interactive and .NET Core, which means you can't add F# functions via the portal. It does support compiled F# though, so you can still use F# via Visual Studio, VS Code or the CLI.

"Starting with version 2.x of the Azure Functions runtime, all functions in a function app must be authored in the same language."
Quote from MS Azure function documentation
https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference
If possible delete function app and recreate then you can have options for f#

if you want to create an F# function, all you have to do is manually delete the FUNCTIONS_WORKER_RUNTIME App Setting from your app, and refresh the portal.
once you do this you can go to runtime v1 and select the language of your choice
the portal should look like this once you perform the above steps.

Related

Is it possible to trigger an Azure function with Python runtime inside a Azure Logic App workflow?

I have some Azure functions with python runtime which perform data validation tasks. I want to trigger the Azure functions inside a Logic App workflow. Is this possible?
Short answer is no. The function has to run .NET or JavaScript.
From the official documentation you can read : "New function apps must use either the .NET or JavaScript as the runtime stack"

Editing Java Function Apps is not supported in the Azure portal error

So, when I am trying to create a function inside a function app it shows Editing Java Function Apps is not supported in the Azure portal.
The Add button is not working and only local development option is present.
How can I overcome this problem?
Currently, it seems that we cannot create Java Function on Azure portal, because creating Java Function requires Maven or Gardle, but Azure portal does not seem to contain them.
So we can only develop Java Function locally and then deploy them to the Azure portal.
If you want to get this feature, you can go to the Feedback page to post your thoughts, and the Azure development team may adopt your suggestions.
By the way, not only Java, only script programming languages can be added to Azure Portal. In other words, Azure Portal can only create functions that use languages that do not require compilation
You might say that C# can be created directly on Azure portal, but the c# function created in Azure Portal is actually the c# script.

Get the API Definition for a Function App published from Visual Studio as a zip

I have implemented an Azure Function App in Visual Studio and deployed the package with the recomended 'Zip Deploy'. This means the Function App is in read-only mode on the azure portal and when trying to create a API defintion i get the Message:
API definition (Swagger) is not available for Function Apps in readonly mode.
In the function app settings the toggle to "Read/Write" at the Function app edit mode is greyed out too.
How can i get an API definition?
I want to use it to connect the function with PowerApps or Flow.
The OpenAPI preview feature is only available today in the 1.x runtime. For v1, you could create an OpenAPI definitionFunction like this. For v2, API definition feature is not support for beta runtime currently. Here is a document about OpenAPI 2.0 metadata support in Azure Functions (preview).
Workaround:
Use an external library Aliencube.AzureFunctions.Extensions.OpenApi which uses the HTTP triggers on Azure Functions, you can use this on both version 1.x and 2.x.
For more details about how to Rendering Open API Document you could refer to this article.

Azure Function BlobContainer.ListBlob available in Portal CScript, not in VS C#

First I was developpign some test function with the portal, there the function on a BlobContainer ListBlob was available.
Now i've switched to VS2017 to get some more complicated code, but there the ListBlob is not available, it should be ListBlobsSegmentedAsync.
But that is a totally dirrerent approach ... I just would like to understand why its possible in the Portal and not in VS ...
It's caused by the difference of Storage SDK used in different Function runtime.
On Azure portal, check Runtime version in Function app settings, you probably see 1.0.11959.0 (~1). It means code created on portal right now targets at .NET Framework 4.7. For Storage SDK based on .NET Framework, both ListBlobs and ListBlobsSegmentedAsync are valid on CloudBlobContainer.
Turn to local dev in VS, you may have chosen v2 when creating Azure Function. v2 Functions targets at .NET Standard 2.0 and runs on ~2 Function runtime(.NET Core 2). Storage SDK based on .NET Core only provides ListBlobsSegmentedAsync for list operation on container.
To keep consistent, you can create v1 function in VS or change function runtime on Function app settings. Note that if you choose the later, you need to delete old functions first as they will become invalid in different runtime.

How to expose utility functions within the Azure Portal

I would like to add some operational utility functions to my 100% Azure hosted application together with the ability to manually launch these utilities at arbitrary times in the day via the Azure Portal.
My current Azure technology stack is comprised of Web(Api)Apps, Function Apps, CosmosDb + DocumentDbApi and Azure Storage Queues. The application does not have an HTML front end.
An example of a utility function would be to reset demo tenant data in CosmosDb. One benefit of using the portal UI is that I would not have to authenticate invocation of my utility functions from a remote source.
I code exclusively in C# and to date scripting languages have been a personal no-go zone.
My current thinking is that I should create a "utilities" Function-App and then launch a function when required via the portal function-test feature. Is there a better option?
I created a function app via the Azure Portal and a new function to invoke my utility code. Within the Azure Portal under the C# template options for a new function, there is "Manual" option described as follows "A C# function that is triggered manually via the portal "Run" button".
In the absence of extra official Microsoft documentation I assume this is an isolated function hosted within a function App with no external bindings such as a Storage Queue. This provides a solution to my question as I hope there is no alternative invokable public URL endpoint linked to such a manual function.

Resources