I'm trying to publish an Azure Function to already deployed Azure Function App, which is in my subscription.
But Publish target for the Function app is missing.
This is a newly created Function and all other existing function has the publish target visible.
Do I need to configure something on the subscription side or the function .csproj to enable publish target?
One that has azure resource as publish target is running on 1.x runtime.
One that does not have azure resource as publish target is running on 2.x runtime
Adding reference to "Microsoft.NET.Sdk.Function" to note that it's an Azure Function fixed the issue.
For the latest version (VS20212 and Azure Function 3+) - adding references to Microsoft.NET.Sdk.Functions. There is one extra s in the package name. My article has added more details for reference:
Resolve - Azure Function App Publish Specific Target Not Existing in VS2019
Related
I have 2 .NET 5 Azure Function Visual Studio projects . These 2 Functions to be deployed in a single Azure Function App.
I have 2 separate Build Pipelines for each of the projects and have separate Release Pipelines as well in Azure DevOps. I am not using YAML for release pipelines but depends on DevOps UI to choose a new Release pipeline.
My issue is that whenever running the Release pipeline, the last Release overrides the existing Function in Azure Function App. So, I am not getting 2 Functions as expected under a single Azure Function App. Always the last release deployment exists in Azure. Why one release deployment overrides existing Functions, even though they are from different Release pipelines?
In the MS documentation it states that if you perform a "Zip Deployment" to an Azure Function, it will always overwrite what is running on the Azure Function Service. I presume that the "Classic Pipeline" gives you the "Zip Deployment" option.
Link to MS Documentation: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-function-app?view=azure-devops#deployment-methods
For the moment, I do have a ticket open at Microsoft on how to manage different apps on the same Azure Function service. I only want changes made to the specific app where there are code changes without impacting any other existing apps on the Azure Function. For now, I only had one troubleshooting session with no solution in sight. I will share more information once I have received a solution/workaround.
When creating an Azure Function using the Azure CLI, you can set a container image to use, with --deployment-container-image-name, documentation here.
Is it possible, using the highlighted "Deploy to Function App..." button or otherwise, to specify a container image when deploying a function in Visual Studio Code?
You run and deploy azure function in VS Code based on this plugin.
You can check, so it doesn't have this feature. You can first create the function app by command, and then use azure function plugin in VS Code to deploy.
So I am using Azure Functions at work and thought I would have a play and install them on my own server. I have successfully installed Azure Functions Runtime 2 (preview).
I have then followed the Java tutorial to create an Azure Function :
https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-first-java-maven
How do I then deploy this function to my own Azure functions server?
In the guide it says about using :
az login
mvn azure-functions:deploy
Unfortunately, mvn azure-functions:deploy is to deploy functions to Azure site as az login is required before deployment, which doesn't support deployment to on-premises Runtime portal.
But the key point is, the on-premises Runtime is obsolete(one year behind the latest bits), new project probably can't work with it even if we find how to publish.
Since v2 becomes GA, it is recommended to leverage custom image for usages out of Azure box.
Update
Missed one point. As AF Team answered in the issue you post, no Java Image for now so the usage of Azure Java Function outside Azure is blocked unless we could figure out creating the image on our own.
I built a very simple Azure Function in Node.js using Visual Studio Code. I also created a new Function App from the Azure Portal and created a "Staging" deployment Slot. Now I want to deploy my function from Visual Studio Code to this existing Function App and Slot - I can't! I do not find the way to select the Slot, and any deployment will go straight into the default/Production slot.
Is this supported from VS Code? If not, is it possible to do it from VS 2017 (remember that this is a Node.js project) ?
Thanks in advance
Jose
Azure function slot is a preview version. It seems not supported in VS code, after creating a slot in the portal, there will not be a slot option and will be an error in it, like the screenshot. If not, there is normal. May be it's a bug. When deploying, it happens like you mentioned.
In the VS 2017, it works fine, just create the profile and publish your function.
Update:
My function is C#. Currently there is no Node.js function template in VS, but you could create c# function and write the function file with node.js manually and publish to azure function slot.
You could create it like the screenshot below, and set Copy if newer for the function.json and index.js.
Check it in the portal.
I am trying to run an azure function locally in Visual Studio 2017 preview with latest tooling for azure functions. i want to know how to pull function.json as my function works on the azure portal but not locally in VS2017.
Looking forward on how to set iot hub connection endpoint settings in local.settings.json file.
In VS2017 tooling function.json file isn't created manually anymore. Instead, it's being generated at publish time from attributes that you put on your function parameters. In your case you will use EventHubTrigger attribute, see several examples in wiki.
Having an existing function.json, you should copy each property-value pair from the binding to the corresponding property of EventHubTrigger attribute. There's not automated way to do that.
local.settings.json is the container to put your app settings while running function locally from VS. They are just key-value pairs, go copy your settings from the portal if you have them there already. This file has no effect on deployment to Azure.