Open InteXX opened 5 years ago
Does the local debugger and such work?
Yes.
No that I expect it to change but have your tested with azure function be (and .net core 3.1?)
I haven't.
No that I expect it to change but have your tested with azure function be (and .net core 3.1?)
Perhaps I did not clearly understand what @aarondglover asks, but I'm converted full C# based azure function into full VB.NET with .NET Core 3.1 and test it, deploy it in App Service also.
I meant to say "Azure Function 3.0 (and .NET Core 3.1)"
@InteXX or @rrvenki
Can either of you please publish an empty/sample project to GitHub which I can clone to get started?
@aarondglover
Did you run into problems with the steps above? They may be in need of revision if so.
@aarondglover
How did you fare with this? Were you able to get it working?
@aarondglover if you require a simple sample Azure functions project in VB I can share it.
@rrvenki
Thank you, yes please.
ahh.. Finally... I've ended up using a different approach. Here's my result:
2020-05-08T18:45:40.538 [Info] Function started (Id=XXXXXXXX-XXXX-XXXX-XXXX-cbc5XXXXX7)
2020-05-08T18:45:40.538 [Info] VB 64bit (Framework 4.8) HTTP trigger function processed a request.
2020-05-08T18:45:40.538 [Info] Function completed (Success, Id=XXXXXXXX-XXXX-XXXX-XXXX-cbc5XXXXX7, Duration=10ms)
@SilverfoxSystems
Could you provide some more detail?
I've created a new function in VS2019 and there I've examined the "MS.NET.Sdk.Functions" package. Using VS2015, I created a Class Library and manually imported each package from the mentioned package. Converted the VS2019 C# code into VB and so on... Further details (and maybe a step-by-step procedure) will be available on my website.
Yes, that's it. I will notify you here when it will be ready.
@SilverfoxSystems
Sounds good, thanks. I'm looking forward to it.
There we go:
http://silverfox.systems/Azure_VB_Function.aspx
The page still needs a bit of styling, but it'll do for now... You're welcome.
@SilverfoxSystems
Looks good, I like it!
I think I'm going to work up a template based on this. With your permission, of course.
@InteXX Sure, go ahead... I'm considering automating the whole process myself.
Oh man, thanks for the donation there! Fair play to you, it's really gonna help me out in my current situation.
I think I'm going to work up a template based on this.
Why should C# coders have it any more comfortable anyway :)
I've added a repo, if someone's interested...
Watched and starred. I'll fork it in the next few days. Thanks
Watched and starred. I'll fork it in the next few days. Thanks
Good man! You're welcome.
for as much as I would be interested, I'm not even considering an ecosystem that carries along 49 (fortynine) dlls for a hello world proof of concept. A 12kb executable carries along 23MB of libraries and descriptors. Thanks, but no thanks.
@Padanian
That's Azure Functions for you ;-)
@Padanian That is only if you don't use Pack, with Core 5.0 the total app of Hello World size is 155KB on Windows.
@InteXX never mind it is smaller but not that small. The feature is PublishTrimmed
@paul1956
OK, got it.
Sorry to disappoint you, The OP repository is for net fw 48. Compiling the project, without even touching it, it generates 76 files, 23MBs in total in 10 folders. I decorated it with a console app, which is 12kb.
@Padanian try using TryConvert to make is a Core project it does an excellent job or try Core 5.
@Padanian
These are the dependencies for an Azure Functions Core 3.1 project (VB or C#). They can be found in the local cache at %UserProfile%\.nuget\packages
.
microsoft.net.sdk.functions 6.38 MB
Microsoft.Azure.WebJobs 1.71 MB
Microsoft.Azure.WebJobs.Extensions 0.35 MB
Microsoft.Azure.WebJobs.Extensions.Http 0.29 MB
Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator 12.10 MB
Newtonsoft.Json 72.00 MB
---------------
Total 92.83 MB
That said, I'm not sure why the FW 4.8 repo in question calls for sixty-three packages in its Packages.config
file. I did a nuget restore
just now and it brought in 392 MB worth.
Compiling the project, without even touching it, it generates 76 files, 23MBs in total in 10 folders.
Please complete steps 4. and 4a. on my updated page and see how that helps :)
I will probably update the git repo soon.
Ok, wait for the repo to update
What I was trying to point out: You only need to upload "Function Test VB.dll" , "Function Test VB.dll.config" and the two JSON files (Function1\function.json and host.json) for the function to work, bringing the zip file size down to 6kB. I guess the other DLLs are there only for compilation and local testing. Apparently they exist in the AZ Functions infrastructure itself.
@rrvenki
Thank you, yes please. @aarondglover I'm sorry i'm too late to see your comment. Let me know how to send to you i'll send you a working project for Azure Functions in VB.NET
Does this still work in VS2019 with the latest libraries? The C# example now seems to differ from the one @SilverfoxSystems used.
@consciouspnm
Would you try the package found here and let me know if it works for you.
Ok, what project type did you use for VB from the original post?
.NET Standard 2.0, if I recall correctly. The package uses netcoreapp3.1
.
I meant did you pick a Console App, Webjob template, Class Library etc.
No need to pick a project type—the template provides it for you.
Installation instructions are at the repo.
The template works, though I'd still be interested in which one you picked from the default list when you first tried this as I don't have one called .NET Standard unless it comes from somewhere else.
You should be able to find it like so:
FYI I was able to get a pure-VB.NET Azure Function working. It was pretty simple, really—here's what I did:
Created a C# sample using this guidance
Created a new VB.NET project (in .NET Standard 2.0 instead of .NET Core 2.2—I ran into missing dependency problems while trying it in Core)
Converted the C# sample class using Telerik's Code Converter
Added the converted code to the VB.NET project (being careful to remove the redundant namespace declaration)
Per this advice, added the
AzureFunctionsVersion
element to the VB.NET project's XML:Published and tested as normal
If you're using WebDeploy (uncheck the 'Run from package file' checkbox at first publish), you'll see a warning during deployment:
This warning can be safely ignored. Best guess, the assembly is probably only necessary as an interpreter for C# Script functions.
Due to my limited bandwidth I can only publish via WebDeploy, so I'm not aware of whether the warning occurs during a ZipDeploy (checking the Package checkbox).
And there we have it—an Azure Function in pure VB.NET.