Can Azure Functions be written in Python? - python

I'm interested in using Azure Functions written in Python with Cosmos DB.
I saw a demo that was posted very recently (February 6th) that showed how to enable "Experimental Language Support" for AFs. Referencing the demo here (https://www.youtube.com/watch?v=pKGVRKtCp7Y) shows enabling this support option (as of 8 weeks ago) allowed Azure Functions to be written in Python.
I've followed the steps in the demo and I dont see Python as an option currently in my portal for HTTP Triggers. I'm wondering if support for Python has been dropped entirely or if there's a step I'm missing?
Please advise.
.

From the GitHub issue:In-portal editing will be disabled for Python Functions.
Python Function Apps on Functions v2, deployed to a Linux App Service
Plan allow in-portal file editing. This feature will be disabled
starting March 2019.
However you still could create the Python Function with VS code extension or Azure Functions Core Tools.

Related

Azure function local setup in PyCharm and publish to Azure

I've just switched gears to Azure esp. started working on Azure functions. It's very straightforward to do the deployment using VSCode but I've been unable to find any comprehensive working end-to-end doc/resource about how to set azure function in pycharm, publish it from PyCharm to azure cloud and debug it locally.
I've looked in Microsoft docs but couldn't find anything of value for setting up Azure Func in PyCharm. Could you please suggest if it is possible to do it in PyCharm or do I have to switch to VSCode? (Don't wanna switch just because of Azure Functions though).
PS: If it is possible to set it up in PyCharm, link or details of how-to will be helpful.
Thanks in advance for help.
Azure Function is now supported in Rider, WebStorm and IntelliJ and it supports TypeScript, Node, C#, Python and Java. But PyCharm most likely be the only JetBrains product that doesn't have a single step setup to run and debug Azure Functions.
Currently there is no Azure Function Extension with the help of which functions can be created, debugged and published from PyCharm.
If you don't want to switch to VS Code then for now you might like using IntelliJ for running, debugging and publishing Azure Functions.
Check this discussion to get more information. Also check this approach to debug it locally, it can be considered as a workaround but not solution.
At the moment Pycharm does not integrate directly Azure Functions.
I've set up a DevOps Pipeline in my function, so everytime I need to run and test it I push my code from Pycharm on a dedicated branch and the function is deployed on Azure.

Python 2.7 AWS Lambda Support will end in 2020?

With the end of life of Python 2.7 will I still be able to deploy code using this version in AWS Lambda?
When should I migrate my functions to 3.6?
I coudn't find anything from AWS.
The selected answer is a little misleading. On 2020-01-02, AWS announced it would continue to run Python 2 scripts until the end of calendar 2020. The pertinent part of their post:
We recognize that Python 2 and 3 differ across several core language aspects, and the application binary interface is not always compatible. We also recognize that these differences can make migration challenging. To allow you additional time to prepare, AWS Lambda will continue to provide critical security patches for the Python 2.7 runtime until at least December 31, 2020. Lambda’s scope of support includes the Python interpreter and standard library, but does not extend to third-party packages.
So you should migrate functions, but you have the rest of this calendar year.
edit: The linked AWS blog post is updated and the new end-of-support date is June 1, 2021.
This is all documented at Runtime Support Policy.
Specifically, Python 2.7 will be EOL on 2020-01-01. AWS will typically notify you 60 days in advance of a runtime deprecation. Upon deprecation, you can update an existing Lambda function for 30 days but you can't create new Lambda functions using that runtime. The Lambda function and its deprecated runtime environment will still be available for execution.
I would plan to migrate functions before the Python 2.7 EOL date.

Need advice on how to incorporate Python into an Azure, specifically an ASP.NET web application environment

Need advice on how to incorporate Python into an Azure ASP.NET web application environment. Please excuse this question but I am new to Azure and I'm not clear on how to proceed. Every option that I look into looks promising but they all seem to have their own issues. Below is a more thorough explanation but the deal is that I have an Azure account with all kinds of goodies, a full fledged ASP.NET (C#) web app running via App Service, I am new to Azure (but not Python), and I'm hoping to add Python functionality to this whole setup. In short:
I want to add Python to this setup mainly to run scheduled jobs and also to trigger Python code from ASP.NET web form submissions
ideally I want a solution that resembles a non-cloud setup. I know this sounds silly but I'm finding the cloud/Azure functionality to be nuanced and not straightforward. I want a place to put a bunch of Python scripts, run, edit, schedule and trigger them from ASP.NET
for example: I created a WebJob that runs manually and from the documentation it wasn't clear how it should be called. I just figured out that you need to POST with Basic Auth (and the credentials provided).
!Also, Azure CMD does NOT like files with 'underscore _' in them! You cannot submit a Web Job with a py file with an underscore nor can you write output with a file with an underscore
!Also, I don't see an option for this Web Job to run Python 3.6.4 (which I installed via extension). Right now it is using 2.7.15...
!Also, CRON expression in Azure has six *, not five plus a command. Again, more weird stuff to worry about
I tried these instructions but the updates to the web page's Web.config file breaks the ASP.NET web pages
ideally the most cost effective option
Any info is greatly appreciated
MORE DETAILED EXPLANATION
Currently I have an ASP.NET site running via Azure App Service and I would like to add Python scripts and possibly Flask/Rest functionality. Note that I am not expecting to serve any content via Python and will largely be running Python scripts either on a scheduled basis or call them from ASP.NET. As a matter of fact, and this is an important point, I'm hoping to have ASP.NET trigger/run a Python script when a web form is submitted. I realize that I could get a similar effect if I make a web call to a Rest api that is running Python. In any event, I can't tell if I should:
add a Python extension to the current App Service running the web page (I tried this) OR
I did install Python 3.6.4 and some packages via pip
These instructions were useful, however the updates to the web page's Web.config file breaks the ASP.NET web pages
set up a VM that will have all of the Python code (but how can I have the .NET web page(s) call the Python in the VM?) OR
use Azure functions (I'm completely new to this and must admit that I prefer to have my old school Python environment instead although I see the benefit of using functions. But how do you deal with logging and debugging?)
or what about a custom windows container (Docker)?
This requires installing VS Code and that is OK but I'm looking for a solution that another user can get into with as few interruptions as possible
The idea is to ramp up the use of Python although, like I said, I don't expect Python to be serving any of the web content. It will be used to run in the background and to run scheduled jobs. What is the most robust and hopefully easiest way to add Python functionality to Azure (most importantly in a way to be able to trigger/use Python from an App Service running .NET?)? I've searched online and stack overflow so far with interesting finds but nothing to my liking.
For example, the following link discusses how to schedule WebJobs. I just created a manual one and when I called the webhook I got the message: "No route registered for '/api/triggeredwebjobs/TestPython/run'" How to schedule python web jobs on azure
The Docker method looks very promising, however, I'm looking for a simple solution as there is another person who will be involved in all of this and he's busy with other projects
Thank you very much!
I found a solution, though I'm open to more info. Like I mentioned in my post, I used the 'add extension' tool to add Python 3.6.4 to my Azure (installed in D:\home\python364x64).
Then I installed a bunch of packages via pip, these installed into D:\home\python364x64\Lib\site-packages.
I created a Python folder in webpages\Python where I put my scripts.
Finally, in ASP.NET I used the Diagnostics.Process call to run my code in ~\webpages\Python\somecode_2.py
The main issue is that Azure came with Python 2.7.15 installed. And for some reason when my Python code got executed it was using 3.4 (where that version came from beats me). So for each script, I had to create an _2.py version where I simply did the following in order to call the original script via Python 3.6.4. Looks a little nasty but it works. So like I said, I would welcome more info for ways to do this better...
--
import os<br>
os.system("D:\\home\python364x64\python.exe SomePython.py {0}".format(add arguments here)

Python updates through Eclipse

How do I get Python updates through Eclipse Kepler Version?
I previously used to download it from the Google Apps Engine website, but since January 2014 Google recommended using Eclipse to get automatic updates for Python. However, when I downloaded Eclipse Kepler it did not contain Python. It only contains Java.
Eclipse has several plugins that support developing software with Python (PyDev, for example). None of those include a Python runtime and they never did. So you probably misunderstood something.
My guess is that when you say "Python", you actually mean "the app engine framework for the Python language".
As far as I can tell, you still get that from Google: https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python
Now there is also a plugin for Eclipse which adds extended support for developing App Engine applications. You get that from Google as well: https://developers.google.com/eclipse/docs/getting_started

Python or WPF reporting application

I have an existing VS-2008 Windows application with back-end MySQL Server 5.5. The existing application uses Crystal Reports for reporting. I want to get rid of Crystal Reports and want to use another tool that seamlessly integrates with VS-2010 Express. I want to remove reporting options from my existing application and want to write a new WPF reporting application using VS-2010 Express. I want a free tool but as I am using MySQL, tools like SSRS are not useful for me.
What are the options? I am planning the other way round by writing a Python reporting application powered by any open-source Python reporting tool.
For WPF you can use http://wpfreports.codeplex.com/ for simple reports or follow this article instructions to make you own: http://janrep.blog.codeplant.net/post/WPF-Multipage-Reports-Part-I.aspx
I've used SSRS, but only the RDLC part (you can use it with any datasource), but not very happy with the results and WPF does not have a native RDLC ReportViewer.
Also check this related question What's the best approach to printing/reporting from WPF?
Why not have both? IronPython is a python implementation on top of .NET. It allows you to write code that is totally python, but gives you access to all of .NET, including WPF.
For a quick look at what this looks like, here is a basic WPF project using ironpython.

Categories