pull azure function to locally and install npm - azure

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.

Related

Azure Functions sync from remote to local

My hard disc has crashed. Azure functions were written using Visual Studio Code and deployed to the Azure Functions.
However, right now although I can see all the codes but, I am unable to sync it to my new system in Visual Studio Code.
I am using Consumption Plan, Python in Linux OS.
"Download App Content" is disabled in my account.
Yes, Download App Content option is disabled for the Azure Functions Python Linux OS in the Azure Portal.
To download its App Content, you can use the FTP Login like:
Go to the deployment Center > Select FTPS Credentials > Copy FTPS Endpoint, Username and Password to the WinSCP Client > You have the Download option to download all the content.
This is possible when you created the Functions using the Azure Portal (Consumption Function App).
You cannot see the Code files in FTPS Client if you have deployed the Functions from local IDE (VS Code, etc) to the Azure Function App Consumption Plan.
If you have deployed the functions from local IDE to the Portal Function App (App Service Plan & Premium Plan), then you can see the files using FTP Client (eg, WinSCP) using the above method.
Note: You can also get the FTPS endpoint and credentials from the Get Publish Profile option.
Updated Answer:
If you have deployed the functions from local IDE to Portal Function App (Consumption Mode), then the workaround is to copy the code manually from the portal function app to your local project:
As of now, I believe the above is the workaround in that scenario. It is not so easy to do manually if many functions (triggers) are present in the Function App, so I would recommend you raise the feature request in the Azure Functions Python GitHub Repository.

Continues development for Azure Function

I have Azure Function running Power Shell that built in a cloud itself (no local files).
I need to copy it to another Azure subscription,
I see a lot of example how to deploy, but my question is how to take all the files of function from Azure and put it in Azure Devops repository with some script, without downloading it to my computer.
I don't think there's a direct way to take all the files of function from Azure and put it in Azure DevOps repository without downloading them first.
Basically, we need to download app content to your local machine first, and then push it to Azure DevOps repository.
You can reference the following blogs to do that:
Copying an Azure Function App using the Portal, GitHub and Cloud
Shell
How to… copy Function Apps

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

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.

Azure-Samples/ms-identity-b2c-javascript-spa: What do they mean "build your project"?

I am new to Azure AD B2C and NodeJS development, but have developed web sites (that does not use frameworks) using JAVA, PHP, C# and C++ for non-cloud servers using Apache or IIS.
I want to build a simple SPA for Azure B2C, that accepts sign-in and sign-up (with federated authentication via google, facebook, etc) using the Authorization Code Flow.
After searching for some time, I found the following example:
https://github.com/Azure-Samples/ms-identity-b2c-javascript-spa
What do they mean when they write the following in the Deployment section:
build your project
Are they assuming that I am using webpack or the like and forgot to describe it or are they assuming that I am familiar with Azure pipelines (which I am not), i.e. this:
https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/javascript?view=azure-devops&tabs=code
Or do they mean something different? How do I build the sample project?
I have tested in my environment.
You can build and deploy your project to Azure Static Website using VS Code.
VS code Azure Storage extension builds and deploys the project to the Azure Storage as a static website
After cloning the project into your local, open command prompt from your project folder.
Run this command to install node modules required for the project :
npm install
Run this command to start the project :
npm start
You can see your project running in http://localhost:6420/
Now to deploy this application to Azure, you can use Azure Storage Account Static website feature.
To deploy the application, please follow below steps :
Open your project from the VS code.
Go to extensions and search for Azure Storage. Select Azure Storage. Click on install.
Sign in to your Azure Account and you can see your subscription.
Under Storage extension, Click on Deploy to Static Website via Azure Storage.
Select your project folder. Select your Subscription.
If storage account is already created, select your storage account. If not click on Create Storage Account (Advanced) and create your storage account.
Click on Enable website hosting
Once the deployment is completed, sign in to Azure Portal.
Open your storage account. Select Containers. Open $web container.
You can see your project uploaded to the Storage Account.
Click on Change access level and select Container ( anonymous read access for containers and blobs). Click OK
Open App folder and click on index.html. Copy the URL
Open the URL in the browser and you should be able to see the application running.

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.

Resources