Change publish method for azure function app - azure

Is it possible to change the publish method for an azure function without deleting and recreating it? Currently I want to swap the publish method from code to docker containers for a couple of azure functions apps.
I am not able to find anything useful for this matter under the deployment center or under the Microsoft's Azure CLI documentation.
I've seen that it's possible to do that for webapps but didn't found much about azure functions apps.
I highly appreciate any kind of help!
Thank you!

Here is the suitable MS Doc for your requirement of changing the Publish Method of Azure Functions to the Docker Container.
This documentation contains different ways of achieving the above requirement such as using the Azure Functions core tools commands, CLI and also PowerShell Commands.
The actual way of deploying/publishing the Azure Functions is creating the Azure functions along with the docker image initialization. But, when publishing the Azure Functions code manually to docker, you need the docker file in your Azure Functions Project.
You can initialize the docker file using the command func init --worker-runtime -docker which will prompts for the langauge runtime such as Java, dotnet, node, python, etc.
Refer to the SoundCode article given by #MarkHeath and Educba article for more information on adding the docker file in Azure Functions project and publishing to docker.

Related

Run python function in azure without flask

I want to run a python script in Azure without using flask or jango. I'm thinking about azure functions or something like this.
Thank you!
Sure you can use Azure functions in this case. Alternatively, you can also use Azure web jobs where you can upload it through the web job blade by creating your app service in the VS code zipping it.
REFERENCES:
function in Azure with Python using Visual Studio Code - MSFT Docs
WebJobs - github wiki

IaC Azure Automation

I would like to perform the following steps on schedule (presumably using Azure Automation):
Provision a VM in Azure
Run a powershell script on that VM
Deprovision VM
Actually I have more steps but left only 3 for simplicity.
I am new to IaC and appreciate your general guidance and advice.
Is it scope of Azure Automation or I need something else?
I would like to code everything in text format and put in Git and update automatically via Pull Requests
Should I use Runbooks or DSC?
Regarding step 2, I cannot figure out how I can upload my powersehll script into newly created VM and run it locally. The script downloads some files and updates some remote resources.
Thanks,
Ruslan
there are a lot of options and tools to achieve your goal.
If you will be working strictly in the Azure cloud, The following tools are most commonly used for building an environment.
Azure-powershell
Azure-CLI
ARM-templates
each of them very similar but all a little different with their own benefits to them, but they are all tools for building your virtual infrastructure. For configuring your resources there are other tools. Like you mentioned yourself, DSC is a tool to configure virtual machines.
if you are planning to use github to push your code, i would recommend using ARM-templates. You can very easily use your own or other templates by referencing in your code. However this might be the 'hardest' solution to learn and understand the syntax in comparison to the cli and powershell. But also the most frequently used.
It is possible to build your environment and configure it in the same script using the Azure-CLI, Azure-Powershell or an other opensource solution like Terraform, But this is not best practice.
A lot of starter scripts are publicly available on github and in the Microsoft docs.
if you have any specific questions you can always send me a message, i am currently working on azure automation myself.

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.

Azure Functions with CVS doco/guidance

I would like to connect Azure Functions to a repository where on each master push functions would be redeployed along with artifacts (Project.json, function.json, etc). Is there anything already in place? If not, anything planned?
Sean,
Since Azure Functions sits on top of App Service/Web Apps, this is a fully supported scenario and you can find detailed information on the deployment process here
I also have deployment scripts you can use with your function to make sure your packages are properly restored on deployment here (you can find more information about how to use the script here)
Hope this helps!

Create Azure cloud service config from existing setup

I have two Azure VM's running in a cloud service. They contains almost the same thing. Some TCP port's are also opened between them.
Is it possible to create a deploy package from this existing setup so that at a later time can deploy this setup in an easy way. I.e. I want to be able to do this:
1. Create deploy package from existing setup *
2. Delete whole existing cloud service including VM's
3. Deploy the package from step 1 and have everything created again.
*I can save one of the VM's to my Azure storage and use it as template for both of them if that is easier.
How to accomplish this if it is possible?
Yes, you can take what you have as a template and use it to stand up multiple silos. But in IaaS, there isn't a notion of a deployment package. There's a few things you'll need to do...
1) understand how to take an existing VM and turn it into an image
2) use Powershell or another DevOps style automation suite (Chef/Puppet/etc..) to define deploy your silo.
You seem specifically interested in how to create an image so I'd recommend using the tutorial we have published on this. http://www.windowsazure.com/en-us/documentation/articles/virtual-machines-capture-image-windows-server/ This does of course presume you're running Windows Server. But a Linux version it can be found at: http://www.windowsazure.com/en-us/documentation/articles/virtual-machines-linux-capture-image/
The automation of a deployment depends on a great many things, so I'd suggest at a starting point, familiarizing yourself with the management API: http://msdn.microsoft.com/en-us/library/windowsazure/ee460799.aspx
With the implementation of Resource Manager, you can now easily use JSON template to deploy and redeploy resources in Azure. There are also starter templates available - https://azure.microsoft.com/en-us/documentation/templates/

Resources