Azure VM for Python scripts

Aldo Montinaro 0 Punti di reputazione
2025-08-16T15:38:45.1233333+00:00

I have a Python script that takes several hours to run on my local PC, but my machine isn’t powerful enough to handle it efficiently. It’s mostly single-threaded but still very CPU-intensive, and I’d like to speed it up by running it on a more powerful machine with multiple cores or higher clock speed.

I’m considering using an Azure Virtual Machine (VM) for this. However, I’m new to Azure and not sure about the exact steps I need to follow. Specifically, I’d like to know:

  • What type of Azure VM would be most suitable for CPU-intensive Python code (e.g., general-purpose vs. compute-optimized)?
  • How do I set up the environment on the VM (installing Python, dependencies, uploading my code, etc.)?
  • What’s the best way to run a long script that might take several hours without being interrupted (e.g., do I need to use screen/tmux, or is there an Azure-specific solution)?
  • Are there any cost-saving considerations or pitfalls I should be aware of when running long jobs on Azure?

My goal is simply to offload this computation from my weak local machine to Azure without rewriting my code for distributed computing frameworks (at least for now).

Any guidance, tutorials, or best practices would be much appreciated!

Desktop virtuale Azure
Desktop virtuale Azure

Un servizio di virtualizzazione di Microsoft desktop e app eseguito in Azure. Precedentemente noto come Desktop virtuale Windows.

0 commenti Nessun commento

Risposta

Le risposte possono essere contrassegnate come "Accettata" dall'autore della domanda e "Consigliata" dai moderatori, in modo da consentire agli utenti di sapere che la risposta ha risolto il problema dell'autore.