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

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.

Related

Can I publish a ASP.NET Core app into an Azure AppService on a Linux Service Plan from Visual Studio?

I just need to deploy a aspnet core app into a Linux Service Plan.
I tried pre-creating the Linux service plan (into it's own Resource Group) from portal, and then starting the publish profile creating process in VS, but it does not show the linux Resource Group or Service Plan.
I can only find references to doing this from a Linux machine using Git-integration.
Thanks in advance,
Jose Parra
Unfortunately, for now we cannot deploy web app to Azure linux service plan through VS. It's by design that we can only see windows service plan in VS publish process.
However there are alternatives for us to choose.
FTP-- Upload pre-compiled files(under ~/bin/Debug(Release) folder) to website. Here's the reference.
Local Git--You may have read this tutorial. Note that Git bash can also be used in Windows.
GitHub--Follow this reference to connect VS with your GitHub, then config Deployment option in portal. After that your code will be deployed automatically once pushed to GitHub.
There are some other deployment ways like CI/CD aka Continuous Delivery in portal and another source control tool BitBucket. I recommend you to use GitHub as it's simple to operate in VS after configuration.

How to add Function App to Resource Group project in Visual Studio 2017?

I'm working on my Azure project for gaining some experience especially in deployment via Powershell. I already created a solution, and added an Azure Resource Group deployment project. Here you can add resources to your group, but there is no Function App, WebJobs or anything similar to Function App, or FaaS stuff.
I checked the automation script created by Azure portal about a manually created Function App, but it is quite heavy. It will take time to figure out how it works.
Is there a way to do it using this tool?
There are two pieces to this puzzle.
1) Is the "Infrastructure as Code" or IaC. In your case the Azure Functions PaaS Service. This can be deployed using an Azure Resource Manager (ARM) template, built using Visual Studio 2017. This is the "runtime/host" that your function will be deployed to. See the Azure Resource Group deployment project type, part of the Azure SDK. Top tip - if you have an Azure Resource Group with a Functions PaaS instance in it, go to the instance and click on Platform Features -> Automation Template. This will give you the foundation for building your resource group deployment project.
2) Is the function itself. This needs to be deployed to your Azure Functions PaaS service. Azure functions have their own project type in Visual Studio 2017, however the template needs to be download. See Visual Studio 2017 Tools for Azure Functions.
Once you have built your function using (2) above, you publish to your function PaaS instance deployed (which was either manually deployed or deployed using (1) above).
Top Tip 2: You can build and test functions locally using the Azure Functions CLI.
Top Tip 3: Use the Azure Resource Explorer to help understand how the ARM structure looks for your subscriptions.

How do you create an installer for Azure Web Apps / Azure Websites

I am a software vendor with a .net web solution that I want customers to be able to easily install / deploy into Azure Web Web Apps / Azure Websites along with a Sql Azure backend. I can't find any installer tool that supports this scenario. I have also looked into the Azure Marketplace but it seems the only option there is to create VM images. I want my customer's to avoid having to deploy to an manage VMs and adopt the IaaS model. Instead they should be able to install to Azure Web Apps with a package that copies all the web solution files and installs and connects the Azure Sql. Is this possible or will I have to manually deploy and configure Azure solution for each customer?
You can use the VS Marketplace to do the deployment. What you need is to create an ARM template. There is a huge number of samples here: https://github.com/Azure/azure-quickstart-templates - you can pick one of the web app ones - for example: https://azure.microsoft.com/en-us/resources/templates/201-web-app-sql-database/ - has a SQL database linked to a web app.
The ARM template allows you to do a "no-hands" deployment of the resources and know when they are ready for further action. You can also deploy from any of the supported continuous deployment options (see the template with a GitHub connection as an example) or you can use ftp/msdeploy after the deployment is successful.
This is a good tutorial https://learn.microsoft.com/en-us/azure/azure-resource-manager/vs-azure-tools-resource-groups-deployment-projects-create-deploy
This is the github example mentioned in previous answer
https://github.com/Azure/azure-quickstart-templates/tree/master/201-web-app-github-deploy

Deploying Applications other than WebApp using Azure Resource Manager

I am currently looking into using ARM to deploy new environments of our Azure Components. We have a lot of web apis that are deployed to Cloud Services, since we need access to the underlying OS to get CPU usage for App Dynamics metrics. When reading through ARM, it seems as if they are deprecating Cloud Services, but I have some confusion about what is replacing it. I see that you can create Web Apps using this and use Publish from Visual Studio to deploy the app it, but I see no options for Cloud Services. So what is the preferred method to do this? Creating a VM and deploying using Web Deploy? What about VM scaling. Any help would be greatly appreciated.
My company is in the process of moving a legacy app to Azure using Cloud Services and we were concerned about the future of Cloud Services. Since we are somewhat early into the project and would like to use the ARM model we thought it would be easier to make a move now if we knew the future. After a few conversations with project leads at Microsoft on this topic we were only told that we should continue working with Cloud Services as they would continue to be supported.
It's quite clear that the move to ARM was not well thought out in terms of direction and consequences of existing services that many people are already using. Reading between the lines I would say that there is no plan to convert Cloud Services from the ASM to ARM model.
If application insights (https://azure.microsoft.com/en-us/services/application-insights/) are sufficient for your monitoring needs, then you can use web apps. These can be deployed via ARM, and can automatically deploy from a git repo or web deploy package. See this example:
https://github.com/Azure/azure-quickstart-templates/tree/master/201-web-app-github-deploy
The issue here that you may be trying to do operations which are restricted by the web app sandbox.
Failing that, you can use an ARM template to set up a VM and then invoke a custom site extension which will run powershell code to do further provisioning. This powershell code can fetch any package that you may want to install. See this ARM template for example: https://github.com/Azure/azure-quickstart-templates/tree/9ad72f1f5f0008c14311be79eee036b871712394/201-list-storage-keys-windows-vm
Once the VM is created you would be able to modify it and scale as needed.

Azure Web Role Deployment

I have a Web Role in Azure that is under development. I would like to make a package that can be published and tested in staging environment without the help of Visual Studio. Is there a way to publish if just the package is provided?
You can use cspack to actually create the package, but from your question it sounds more like you are asking can you publish an already created package. The answer is yes.
There are multiple ways to do this and I'll provide three:
1) The management portal: you can deploy a package if you have the cspkg and csconfig files. Under the Cloud Services you can select a cloud service and select to deploy to the production or staging slot. You can also do this as part of creating a new cloud service in the portal. http://www.windowsazure.com/en-us/manage/services/cloud-services/how-to-create-and-deploy-a-cloud-service/
2) You can use Windows Azure PowerShell and CLI command line tools to deploy an already packaged deployment. In fact, you can also automate packaging and deploying. http://msdn.microsoft.com/en-us/library/windowsazure/jj883943.aspx
3) Using a tool like Cerebrata's Azure Management Studio you can also deploy already created packages : http://www.cerebrata.com/products/azure-management-studio/features
In additiont to being able to deploy an already created package, for Cloud Services you can also wire up to the hosted TFS service and have it deploy your web app when you do a check in. http://www.windowsazure.com/en-us/develop/net/common-tasks/publishing-with-tfs/

Resources