Using EventHub from WebJob - azure

I'm trying to use EventHub from a WebJob as described https://github.com/Azure/azure-webjobs-sdk/wiki/EventHub-support and Any Example of WebJob using EventHub?.
The problem is that the SO question refers to the nuget package Microsoft.Azure.WebJobs.ServiceBus.1.2.0-alpha-10291 and as far as I can see, that package isn't available anymore.
Does anybody know if there's a new release in the pipe or any other workaround?
BR,
Max.

That library is available from MyGet repository and is being updated sometimes. For adding that, you need to add that repository to NuGet settings:
Package Manager Settings => create a new package source => Use https://www.myget.org/F/azure-appservice/ as a link for the repository.
Now, you should have the library and its dependencies.

Related

Azure DevOps extension cache wrong node_modules

General: I develop an Azure DevOps extension with tasks and pipeline decorators. Testing on local Azure DevOps Server instance. Extension loaded through manage extensions from local hard drive. Let's say that I installed the extension first time with version 1.0.0 and a node_modules dependency "3rdPartyDep" with version 2.0.0, which has transitive dependencies with vulnerabilities.
Scenario:
Upgrade "3rdPartyDep" to version 3.0.0 with fixed vulnerabilities. Build new version of my extension, say 1.0.1. Create the .vsix, update the extension in the Azure DevOps Server.
Run a pipeline, which fails because I did not check the "3rdPartyDep" changes and there are breaking changes and the extension fails to run.
Rollback the "3rdPartyDep" library to 2.0.0 because I have no time now to check what is broken in there right now as I have other things to debug and implement, repackage the extension, increase version to 1.0.2, update extension in Azure DevOps Server.
Run the pipeline. It fails with the same exception, as if I didn't rollback. I look into the agent taks folder and I see that the node_modules with the "3rdPartyDep" library is pointing to 3.0.0, which is wrong because I rolled back the version.
I open the generated .vsix archive and check that the node_modules inside contains the correct 2.0.0 version, so no problems of packaging or building from my side.
I make a conclusion that Azure DevOps stores somewhere a cached version of the extension with the node_modules including the wrong version of the "3rdPartyDep". I search that cache folder over internet to find out where it is, and I also search with a search tool all my machine, including words in file. Nowhere to be found. There is no location on my machine with such node_modules containing the 3.0.0 version. It might be stored in some encrypted DB?
I uninstall completely the extension, and install it back. I see that Azure DevOps has a history for the extension, and the cache is not cleared. Any pipeline fails, even if my .vsix does not contain this dependency.
I'm stuck.
Questions:
Where extensions are actually cached inside Azure DevOps Server?
Why updating, uninstalling and installing does not fix the problem?
Is there any way to fix this? What can I do? I do not want to reinstall the server completely. Moreover, this raises concerns about how node_modules are managed and cached and what happens at the clients and the cloud.
You could try the following items:
Try to clean the browser cache, and check whether you have increase the version number in the task.json.
Try to perform Delete task -- Save definition -- add task again process.
Delete Azure DevOps Server cache, which can be followed in this link.
Uninstall the extension from CollectionSettings, remove the extension from local Manage Extensions. Then upload again the extension and install it in the collection.

Non-proprietary Nuget Packages Showing in Nuget Server/Artifacts Feed

We are using Azure Devops to publish a private nuget server. Currently we have only published 5 of our own nuget packages, however a subset of third-party nuget packages are also showing. I do not have any upstream sources enabled.
Is this normal behavior? I am able to delete them, but it's not clear how they are ending up there in the first place. We are not pushing them. Any help is appreciated.
Rob
Try to open the packages that not yours, and check the Publisher in the package. Publisher lists Who and How publish the package.

What is required for Azure Function Automatic Build and Nuget Restore

This article shows one step closer to an efficient and effective continuous integration workflow for an Azure function. (Thanks to Donna M from Microsoft).
https://blogs.msdn.microsoft.com/appserviceteam/2017/03/16/publishing-a-net-class-library-as-a-function-app/
Rather than re-create our azure functions as web applications, we would like to know exactly what needs to be included in a repository for Kudu or the Azure Function Runtime to automatically perform Nuget Restore and then build the project. Ideally, we could just add whatever is needed to our projects to satisfy the build system.
Previously we had a deploy.cmd script in our repositories according to the Azure Web App convention to orchestrate the restore and build ourselves. It worked in January because Azure Functions are built on web apps, however that has stopped working recently and we found that the folder structure has been rearranged a bit (probably due to the fixes they implemented for locking of .dll files). We understand that deploy.cmd was never officially supported, so we'd just like to know how to modify our existing projects to work in the current version of Azure Functions.
Here's a really good answer on all things nuget & functions deployment:
How can I use NuGet packages in my Azure Functions?
Nuget restore and project build should happen automatically for .csx function apps.
All you need is to follow the folder structure conventions. Here's an example:
Function1/
function.json
run.csx
other.csx
project.json
Function2/
function.json
run.csx
project.json
Shared/
shared.csx
host.json
To make sure that Shared folder code is watched for changes, add Shared to watchDirectories in host.json.

Azure Website Git deployment with 3rd party libs not in nuget

I would like to use Azure git deployment with a product I am working on. We reference a 3rd party library which is privately supplied and not available on Nuget.
Azure syncs with the git repo as you would expect, but when it compiles it fails with errors saying it is unable to find the types within the 3rd party library.
The library is checked in to git in the bin folder.
How can I get Azure to reference this library when compiling?
There should be nothing special about doing this on Azure Web Apps vs doing it locally. If your assembly is committed and you reference it from its committed location, everything should just work.
If it doesn't, please try running through the steps in this document to help identify the issue.
You should be able to use standard NuGet practices to make this work. Looking at the documentation for Package Sources you just need to add the package source (like myget.org) to the nuget.config file place this at the same level as you *.sln file.

Deploying azure webjob via git

I have a solution containing a .net mvc website, and a webjob.
I deploy using git - so on git push to azure, my website is upgraded. I'm now just adding a console application that is going to be run on a schedule. I'm trying to work out how to deploy this with the website when I git push, but I'm not sure how to do this.
I know I could create a folder website\app_data\jobs\triggered\webjob and copy the files into there (say from a post-build event on the webjob), but that would mean I would need to commit all those files to the git repo for the deploy to pick them up - which would also mean that every time I build, Git would be prompting me to commit them again - ugh.
Is there a nicer way to do this - where I can just push my repo to azure, and it will deploy my website correctly AND my webjob?
Thanks
Yes, you can do this without having to put the actual EXE's and project output into the folder explicitly. This blog post from the Azure Blog documents the workaround to enable Git or command-line deployment of a web application inclusive with WebJobs.
http://azure.microsoft.com/blog/2014/08/18/enabling-command-line-or-continuous-delivery-of-azure-webjobs/
If this doesn't unblock you please post an update and I'll help walk diagnose any other issues you run into. You may also want to update the WebJob publishing NuGet to the most updated one on NuGet here: https://www.nuget.org/packages/Microsoft.Web.WebJobs.Publish/1.0.2
As of 9/15/2015, this appears to be as simple as some context menus inside Visual Studio.
If you want your WebJob to automatically deploy whenever your Website is deployed, in Visual Studio you can right-click on the Website and select "Add->Existing Project as Azure WebJob".
More details here, in particular the "Enable automatic WebJobs deployment with a web project" section.
I was struggling with this, but I've got it working now.
It appears that WebJobs.Publish 1.0.2 must be used. 1.0.1 was not working for me. Worked as soon as I updated.
I had also tried adding webjobs.props files as indicated here by David Ebbo, but that didn't work for 1.0.1 and I've now removed those files and it's working under 1.0.2 without them.
Using WebJobs.Publish creates a webjob-publish-settings.json (in the webjob project) and a webjobs-list.json (in the MVC app) and that would seem to be all that is needed.
Only thing that does not work is creating the schedule for a scheduled job. Continuous and Triggered jobs deploy just fine. There's a thread here where David Ebbo mentions that this is a current limitation.

Resources