Run python function in azure without flask - azure

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

Related

Change publish method for azure function app

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.

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.

How do I open Kudu console in Azure functions consumption plan?

I am on an Azure Functions consumption plan, and am trying to follow the guide in this stackoverflow answer: https://stackoverflow.com/a/43984890/6700475
How can I do step 2, namely to "Open a Kudu console"? I have tried:
Clicking "Advanced tools (Kudu)" in the portal - but get this warning: "Linux Consumption Functions are a preview offer."
Finding the SCM page using: https://MYFUNCTION.scm.azurewebsites.net/, but this page is not available.
Is there another way to open a Kudu console, which works for a consumption plan on Azure functions?
(The reason I need this, is I have a Python Function I need to deploy to Azure functions, but it fails with this issue in the python worker, and I do not have Docker: https://github.com/Azure/azure-functions-python-worker/issues/367)
Currently, we don't have support for local git deploy (kudu) for Functions on the Linux Consumption plan (and do not support zip deploy).
The only way to deploy to linux consumption apps is using Run-From-Package.
Here is a similar issue you could refer to.

How to run powershell script in azure functions in schedule

I need to run a powershell script on a schedule using azure functions, I tried to execute the file using node.js but it's not working and i can't figure out why.
While my original answer was correct at the time, Azure has been updated to support Azure Functions utilizing Powershell: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-powershell
Original Answer:
To me Azure Automation (https://learn.microsoft.com/en-us/azure/automation/) seems like a better model for running a Powershell script on a schedule in Azure since it really is a native capability of that tool.
If you really want to do it in an Azure Function it does look like there are some resources you could try (I have not tested them):
https://blogs.msdn.microsoft.com/powershell/2017/02/24/using-powershell-modules-in-azure-functions/
https://github.com/Azure/azure-functions-powershell-worker
Best of luck!!

How to Deploy MS Botframework in Python to Azure

I've been playing with Botframework and am trying to upload the sample code from the git https://github.com/Microsoft/botbuilder-python/tree/master/samples/EchoBot-with-State (with minor modifications) to Azure cloud. I've been referring to this link https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-howto-deploy-azure?view=azure-bot-service-4.0
but have not been able to do so. Looks like this guide is more for .NET / .JS based applications and I'm not sure how to use Visual Studio with Python code to deploy to Azure.
I've never used Visual Studio before and any help would be appreciated.
Thanks
As far as my knowledge BOT is app service hosted on Azure. So to publish your bot application you will need to follow the same steps involved in publishing Python web app to Azure.
You can follow steps in below link.
Publishing Python web app to Azure

Resources