How to utilize a .NET SDK inside Azure Function App? - azure

I am trying to figure out how to utilize a .NET SDK into Azure Function.
What I am trying to do is pull data from a third party app called Sage's Intacct thru web service and push data into Azure SQL Server.
This is data flow:
(Sage's Intacct --> Azure Function --> Azure Data Factory --> Azure SQL Server).
I have a .NET Nuget SDK ( https://github.com/Intacct/intacct-sdk-net ), and I am using Visual Studio 2019 on my local machine and trying to publish into Azure Function.
This is URL for documentation.
I was able to install their .NET SDK Package inside FunctionApp solution.
I am trying to modify config file so I could grab data from Sage's Intacct thru web service (Http).
From other discussion thread, I got the tip that I probably need to use "HTTP Triggered Function".
Now, my challenge is, how do I utilize the Nuget package (Intacct.SDK) with Azure Function?
If I open a new solution file, I could see details of this package, but from here, I cannot publish cs file into Azure Function.
What is approach?
Thanks.

The workflow is a bit confuse, but you should be able to add Sage Intacct using Nuget:
https://www.nuget.org/packages/Intacct.SDK/
Then, it will be a dependency of your project which will be deployed together with you Azure Function code.

Related

How to deploy a C# Console app to Azure App Service using Github Actions

I am trying to deploy a C# Console app. (which inserts data from a third party API to Azure SQL) using Github Actions (push to Azure App Service), and I need some guidance for an option.
I pushed my C# code into Github from my Visual Studio solution in my laptop.
I chose this option ("Deploy .Net Core app to an Azure Web App") at Github Actions:
This is result that I got:
Did I choose wrong option here?
Do I need to create a Web App?
We can deploy the console application into Azure app service using an Azure WebJob. To get complete idea on WebJob. But the performance of the application is not guaranteed. To deploy using Visual Studio. To deploy the application when the WebJob is already created use the link.
To schedule a WebJob
To schedule the WebJob refer the link.

pull azure function to locally and install npm

I have craeted a new serverless function from the azure portal.
Now I would install a library with npm.
I can access to function using the Azure VS Code extension.
The problem is that I can't run npm install because the function is not in local repository.
How can I pull the azure function?
Pull/clone just for a specific function from Function App is not possible. All functions in a Function App are deployed as a single project. So you will have to download the site content from the Overview section of Function App, after which you can open it in VS Code.
You can also create, run and publish Azure function locally in VS CODE using some azure extension
Like Azure function, azurite, azure account, azure storage
You also need Microsoft azure storage explorer for testing Azure Queue Messages.

Contentful Backup Azure Web Job

I want to have an Azure Web Job that will run periodically and create Contentful Spaces backups in Azure Blob Storage.
I know that Contentful has their own CLI but not sure how can I run the CLI in an Azure Web Job using a .NET Core Console Application. Is that possible ?
I also found that they have their own API: https://www.contentful.com/developers/docs/references/content-management-api/ can I use this API to export Contentful data to a JSON file using .NET Core Console Application ?
PS: All the backups need to be done in a way that I can import the data again if necessary.
This is not a direct answer, but suggestion for you.
I'm not familiar with Contentful, but for azure webjobs, there are 2 things you should remember:
1.If you're using .NET core console application, first, you can include all the logic in the console application and make sure it can work locally.
2.You should avoid these limitations(especially no UI operation) when publish to azure.
So in your .NET core console application, you can use api or sdk and make sure it works locally, then follow this article to create the proper webjobs.
Hope it helps.

Deploying a Java Azure Function to Azure Functions Runtime (On Premises)

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.

How can I deploy a html website using Azure Resource Manager

I've got a website (basic html) and I want to deploy it using Azure Resource manager. It doesn't have a visual studio sln file and I don't want to create one.
I've found this tutorial for an angular website that does something along the lines that I am trying to do. http://www.azurefromthetrenches.com/how-to-publish-an-angularjs-website-with-azure-resource-manager-templates/
The problem I want to solve is that I have the Microsoft Azure SDK for .NET (VS 2015) 2.8.2 which allows me to add resources to my resource group project. The tutorial writes everything itself, rather than use visual studio to create the resources.
Does any one know how to do this?
I've got my application to build the website using a website.publishproj (found at the tutorial) so I have my zip file, what I am now lacking, is how to upload the zip file to azure using the already existing powershell that comes with the 2.8.2 SDK.
So far i've added the below code under the Import-Module statement:
C:\"Program Files (x86)"\MSBuild\14.0\bin\msbuild.exe 'C:\Source\website.publishproj' /T:Package /P:PackageLocation=".\dist" /P:_PackageTempDir="packagetmp"
$websitePackage = "C:\Source\dist\website.zip"
If you're ultimate goal here is the ability to simply deploy and changes to the Azure Web App, one solution is to setup automated deployment from a local Git repository into an Azure Web App. Firstly, you'd create the RG in the Azure portal then configure Continuous Deployment. You can then use something like Visual Studio Code to trigger the deployment from any code changes.
Good run through here: https://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-app-using-vscode/
Assuming your website is under source control eg. GitHub - you can use an ARM template to point at the GitHub repo, so when it creates a new website it will automatically pull the content into your newly created site. Great walkthrough here: https://azure.microsoft.com/en-us/documentation/articles/app-service-web-arm-from-github-provision/ or just the code can be found here: https://github.com/Azure/azure-quickstart-templates/tree/master/201-web-app-github-deploy.
You can use Azure CLI from non-Microsoft world to deploy eg.
azure group deployment create...
If this has helped, please mark as answered.

Resources