Reputation: 658
An Azure Functions Runtime blog post (https://azure.microsoft.com/en-us/blog/introducing-azure-functions-runtime-preview/) states the following:
It provides an endpoint that allows you to publish your functions from Microsoft Visual Studio, Team Foundation Server, or Visual Studio Team Services.
I cannot find any examples of how to publish to a local instance of Azure Functions Runtime instead of the Azure cloud. Preferably I would like to publish a pre-compiled Azure Function using the Visual Studio 2017 Tools for Azure Functions (https://blogs.msdn.microsoft.com/webdev/2017/05/10/azure-function-tools-for-visual-studio-2017/).
Upvotes: 3
Views: 4884
Reputation: 517
you can publish your Functions to Azure Functions Runtime preview by downloading the publishing profile from the portal and then importing it in Visual Studio 2015 in the Publish... dialog:
Regarding the VS2017 tooling support, currently there is no way to import the publishing settings into the Publish dialog. We are currently working with the VS team on this.
Upvotes: 5
Reputation: 12848
From: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference
The function editor built into the Azure portal lets you update the function.json
file and the code file for a function. To upload or update other files such as package.json
or project.json
or dependencies, you have to use other deployment methods.
Function apps are built on App Service, so all the deployment options available to standard web apps are also available for function apps. Here are some methods you can use to upload or update function app files.
To use App Service Editor
host.json
file and function folders under wwwroot
.To use the function app's SCM (Kudu) endpoint
https://<function_app_name>.scm.azurewebsites.net
.D:\home\site\wwwroot\
to update host.json
or D:\home\site\wwwroot\<function_name>
to update a function's files.To use FTP
host.json
file to /site/wwwroot
or copy function files to /site/wwwroot/<function_name>
.To use continuous deployment
Follow the instructions in the topic Continuous deployment for Azure Functions.
From: https://learn.microsoft.com/en-us/azure/azure-functions/functions-runtime-overview
The Azure Functions Runtime provides a new way for you to take advantage of the simplicity and flexibility of the Azure Functions programming model on-premises. Built on the same open source roots as Azure Functions, Azure Functions Runtime is deployed on-premises to provide a nearly identical development experience as the cloud service.
The Azure Functions Runtime consists of two pieces:
The Azure Functions Management Role provides a host for the management of your Functions on-premise. This role performs the following tasks:
If you read the MSDN blog link that you provided, I think both your questions are answered there. (Although you will have to point to the local (on-premises) rather than the cloud (Azure).
To publish a Function project to Azure directly from Visual Studio, right click the project and choose “Publish”. On the publish page, you can either create a new Function App in Azure or publish to an existing one. Note: even though the Folder option is currently appears, it’s not intended for use with Azure Functions at this time.
To add a function to the application right click the project and choose “Add Item”, then choose the “Azure Function” item template. This will launch the Azure Function dialog that enables you to choose the type of function you want, and enter any relevant binding information. For example, in the dialog below, the queue trigger asks you for the name of the function, the name of the connection string to the storage queue, and the name of the queue (path)
This generates a new class that has the following elements:
- A static Run method, that is attributed with [FunctionName] attribute. The [FunctionName] attribute indicates that the method is the entry for an Azure Function.
- The first parameter has a QueueTrigger attribute, this is what indicates is a queue trigger function (and takes the binding information as parameters to the attribute. In this case the name of the queue and the connection string’s setting name)
Once you have a function, local development works like you would expect. You can run and debug it locally, add NuGet packages, create unit tests, and anything else you would do for a class library.
Upvotes: 3