Publishing Azure Function from VS 2017 does not create csx file - azure

I created a simple Azure Function using VS 2017 to test the tooling.
This is the project:
Here is the publish screen:
Clicking on Publish button does not show any progress but I can see the new Function at the Portal.
However the published Function has only the function.json and no csx file.
What am I doing wrong?
Thanks in advance.
Regards.

This is by design. VS2017 (15.3) won't create csx script, but instead will deploy your code as precompiled function. You can tell that precompiled function is used by looking at scriptFile and entryPoint attributes in your function.json.
By the way, Publish result can be seen in Output tab of Visual Studio.

Related

how to make azure function use the latest code published from VS2022

I have a netcoreapp3.1 project with few functions.
I made changes to one function and deployed using VS 2022 but when I test in Azure, I can clearly see it is using the older code.
I tried removing then adding the function from the project.
Restarting the function app in azure and other refresh methods.
Will I only be able to get the new code if I delete and recreate the function app?
Is there another way to refresh the running code?
Once you have published your function to a FunctionApp throughout VisualStudio 2022 or VisualStudio Code, you can deploy updates to that function app. E.g. if you have added a new HttpTrigger, you can publish all the code including the added HttpTrigger from Visual Studio itself.
Visual Studio 2022, just a black Azure Function App for testing purposes:
Doubleclick on "Connected Services"
Then in the left pane, click "Publish"
Visual Studio Code (Azure Tools plugin):

Durable Functions Orchestration missing in Visual Studio 2017

Was trying to create a new Azure Durable Function in Visual Studio 2017, but couldnt find the "Durable Functions Orchestration" listed in the below popup:
My visual studio is up to date, and not sure what I am missing!!
Ok, Found the problem. It seems like we need to select "Azure Functions v2 (.NET Core)" as the framework when creating the Project.
Note: After the project is created, do a build/rebuild of the project before trying to add a new function. For some reason, when I tried to add new Item, it still wasnt listed until I built the project
After the project is built successfully, you should now be able to see "Durable Functions Orchestration"

Publish to azure option not visible in visual studio 2017

I have an instance of visual studio 2017 in which azure functions are developing, strangely i stopped seeing, publish to azure option in the publish targets window and also in create new profile window.
If i open any of my other azure functions project in vs 2017, the window is seen correctly.
What could be different only for this case?
(Copying comment into an actual answer for the community to see)
well ,strangely my function app was missing functions sdk!! hence i was not seeing right publish outputs. after i installed Microsoft.Net.Sdk.Functions it all worked

How to publish debug build of Azure Function to enable debugging?

I'm trying to debug an Azure Function, but there doesn't appear to be a way of changing the Debug/Release mode from within the new Azure Functions tools in Visual Studio 2017.3.
How do I debug?
As far as I know, the vs2017 preview doesn't provide the way to directly change the publish setting.
I suggest you could find the publish profile and change its setting by yourself.
More details, you could follow below image:
1.Open the application folder
2.You could locate the profile file folder and find the publish profile.
\Properties\PublishProfiles
3.Open the profile and change the release to debug.
The result is like this:
Notice: To see the configuration changed, you need reopen the visual studio preview.

Visual Studio 2017 Azure Function Template does not have files like - run.csx or project.json

I am using Visual Studio 2017 preview(2) to create Azure Function. The template generated for it is very different from what I get in Visual Studio 2015.
The Visual Studio 2017 template create a .cs file for function, and template structure looks like below :
All functions are created as individual .cs file and there are no run.csx, project.json or function.json files, due to which I am not able to specify function specific dependencies and settings
If we see the earlier template (see the image below) with Visual Studio 2015, it well represent the folders and files available on Azure Portal. It has functions in individual folder with all .json and .csx file. This folder structure helps in segregating files related to a particular function (which is not the case with VS 2017 template)
In VS 2017, I want to specify function specific dependencies and binding settings by adding project.json and function.json. Please let me know about the way to achieve this?
This is intended. Azure Functions team changed the way you develop and deploy Function Apps in Visual Studio 2017. Now, it's basically a compiled class library, with functions being static methods with proper attributes.
You should not be editing function.json manually anymore; instead use WebJob SDK attributes. Packages management is done the normal .NET way via NuGet packages.
The "old way" still works from within Azure portal for quick prototyping and experiments, but Visual Studio won't support it anymore.

Resources