I'm using Azure Python SDK to deploy a Linux Vm in the Cloud. This Vm has a public IP and ssh enabled. I need to have this Vm running a custom script immediately after it boots . This script would install pip, python, docker etc and start a docker container.
How could I pass this script when deploying the vm ? / How could I instruct the vm to run this script after it has started ?
Cheers,
Steve
According to your scenario, you could use Azure Custom Script Extension.
The Custom Script Extension downloads and executes scripts on Azure
virtual machines. This extension is useful for post deployment
configuration, software installation, or any other configuration /
management task. Scripts can be downloaded from Azure storage or other
accessible internet location, or provided to the extension run time.
If you want to use python to do this, please refer to this python sdk documentation.
Please refer to the similar question.
Related
I have a nodeJS API which uses child_process to run a python file.
I know heroku has a way to add another buildpack with a script.
Is there a way with Microsoft Azure (web app / app services) to use NodeAPI and Python files in an App service.
PS : Python file is not an API, it is just a script that runs from node.
Thank you
When you hosted a Web App in Azure, you already have all runtime environments by default.
Web App Runtime on Azure Portal:
Python Runtime on Kudu Explorer:
NodeJS and PHP on Kudu Explorer:
Check the other stack versions in Console and if it not sufficient, update them.
Note:
When creating the webapp, it is recommended to choose windows platform which supports virtual application because when you find that you cannot use the runtime you required, you can try to install runtime extensions for other programs.
Also, it is possible under Linux but requires command line to operate.
Goal: deploy reactjs (front) and python (back) project on Azure VM Linux (Ubuntu 18.04)
I have a project folder where I have two subdirectories: one named front and one names back.
To launch it on my local computer (linux 18.04) I do the following steps:
To start the back
cd back
flask run
To start the front
cd front
npm start
Then go to http://localhost:3000/ (redirected automatically there after launching npm start)
I need to deploy now my project using Azure. So I have access to an Azure VM that has Ubuntu 18.04 on it which I can access using SSH from my local computer.
How am I supposed to deploy this project on the VM? Do I need to simply do the same as on my local machine (flask run and npm start)?
PS: It is the first time I deploy a project.
You can use Azure App Services to achieve your needs (choose Windows platform when creating it).
Advantage:
Easy to deploy, azure web app has many mature tools to monitor programs, record logs, etc.
The cost is low compared to VM.
If you use Premium App Service plan, webapp will be backed up regularly. (Excluding data in the database, only for files under wwwroot)
Related Post:
How to deploy a Flask+React application to Azure Web Service
Is there a way for me to work on the environment like Python IDE (such as Spyder) while leveraging the power of GPU in a compute engine? Google has data lab but that is a Jupyter Notebook environment, which is not ideal for code development. I would like to be in an environment where I can debug easily and have a good variable explorer. I would appreciate it if anyone knows a solution to this. Thank you!
With Visual Studio Code you can get a set up similar as you say: with the SSH Remote extension, you can connect VS Code from your PC to a GCP VM and run the workload powered by it. VS Code works in this set up as almost an IDE (actually it is a code editor).
Download and install VS Code (https://code.visualstudio.com/download). Install the SSH Remote extension (https://code.visualstudio.com/docs/remote/ssh). Install Google SDK and log in your GCP account
gcloud init can be enough). Then on the Power Shell or CMD or Google Cloud SDK run: gcloud compute shh-config, and all the started VMs will appear listed and ready to connect through SSH Remote extension.
If you have not a lot of firewall rules closed and security issues.
Hope it works it out.
There is a public documentation describing the steps to set a remote desktop on a Compute Engine instance
You can also manually use the GUI of a ubuntu VM or use the Remote Desktop that comes by default with the Windows Server desktop experience images to install your IDE
You could also try https://cloud.google.com/blog/products/application-development/introducing-cloud-shell-editor, Cloud Shell Editor, an IDE with many GCP tools built-in running on a pre-provisioned cloud instance.
Direct link is http://ide.cloud.google.com/ - make sure you have Google Cloud account.
I have a Python AWS Lambda running on a Linux, but due to some dependencies, I need it to be deployed on a Windows. I have tried using Python Azure Functions and have successfully deployed it on a Linux as well, but found out they cannot be deployed on Windows. Is it possible to do it with AWS Lambda?
Basically my solution has a few .exe that need to be run by a python library (Tesseract OCR and pytesseract)
AWS Lambda and Azure Functions are considered Function as a Service (FaaS) solutions, where the developer worries about the code and the cloud provider worries about availability, scalability and the platform underneath to run the code.
In that aspect, you can't run any of them on a server. If you need specific Windows dependencies, you must create a Python project as you normally would, install the dependencies and configure the Windows Server, being responsible for infrastructure and OS configurations and management.
Hello i am an absolute beginner on cloud computing and on python. I would like to start develope a password manager app to Azure using Python. Please can you advice me some tools to start with my project? (which Apps - frameworks to use)
Python apps, in general, run in Windows Azure as they would run anywhere else, as they'd be running in Web or Worker roles (which are basically Windows Server 2008 R2 or SP2 VMs) or Virtual Machines (which are Windows Server or Linux images you manage). You just need to provide the python sdk and supporting libraries for your app.
Having said that: Windows Azure has a python sdk to interact with Windows Azure's services (today this covers Service Bus and Storage, a subset of Windows Azure services). When installing the Windows Azure sdk, you'll also get python 2.7 installed. You can get the installer in the python Develop portal for python, here. In this portal, you'll also find a few tutorials for working with python in Windows Azure.
If you want to see the source of the Windows Azure SDK for Python, it's available on github, here.