
Stuck in a Version Trap - How I Used Azure ML to Deploy an Azure Function

As a developer, there is no worse feeling than being completely blocked. This is the story of how I got stuck in a "version trap" between my company PC, VS Code, and Azure... and how I used a cloud VM to escape.
Date: November 17, 2025
The Version Trap
My goal was to create a new Azure Function in Python. I checked the Azure Portal, and I was excited to see that the Function App runtime now supports Python 3.13.
My company laptop has Python 3.13 installed, so I thought this would be easy. I opened VS Code, installed the Azure Functions extension, and tried to create a new project.
When the extension asked me to select my Python interpreter, I pointed it to my Python313\python.exe. Immediately, I hit a wall:
Error: Python version 3.13.8 does not match supported versions...
The problem is that the cloud runtime (in Azure) is updated _before_ the local development tools (the VS Code extension and Core Tools). My local tools were out of sync with the cloud and didn't recognize 3.13 as valid yet.
The Real-World Constraint: The Corporate PC
The standard solution is simple: "Just install a supported version, like Python 3.11."
My problem: I can't. This is a locked-down company laptop. Installing new software requires a multi-day approval process with the IT department. (My _other_ local Python 3.11 installation was also broken and missing key modules like pip and venv, but I couldn't get admin rights to fix it.)
I was completely blocked. I couldn't develop locally.
The "Aha!" Moment: Use a Cloud Dev Box
As a Data Analyst, I already have access to an Azure ML (Machine Learning) Compute Instance. I realized: _that compute instance is just a fully-featured Linux VM in the cloud that I control._
What if I treated my Azure ML instance as my _new_ "local" development machine?
The Solution: Deploying from Azure ML to Azure Functions
This workflow completely bypassed my locked-down company PC and was surprisingly simple.
Step 1: Connect VS Code to the Azure ML Instance This is the most important step. In VS Code, I installed the Azure Machine Learning extension. In its panel, I found my Compute Instance, right-clicked, and selected "Connect to Compute Instance." VS Code reloaded in a "Remote SSH" session, and my VS Code terminal was now a terminal _inside my cloud VM_.
Step 2: Create the Project _on the ML Instance_ Now, inside this remote session, I opened a folder _on the ML instance_ and ran the F1 > Azure Functions: Create New Project... command. The VM already had Python 3.10 installed, so the tools were perfectly happy. I also created my TimerTrigger function.
Step 3: Set Up the Environment (The "F5" Fix) My code needs pandas and pyodbc. I opened the VS Code terminal (which is connected to my ML instance) and ran these commands to create a virtual environment and install my packages:
# Create a virtual environment using the VM's Python 3.10
python3.10 -m venv .venv
# Activate it
source .venv/bin/activate
# Install my packages
pip install -r requirements.txt
Step 4: Debug "Remotely" This is the magic part. I pressed F5. The code _ran on the ML instance_, but the debugger connected to my local VS Code. I could set breakpoints and inspect variables just as if it were running on my own laptop. I successfully debugged my function.
Step 5: Deploy from Cloud to Cloud Once I was happy with my code, I clicked on the Azure extension icon (inside my remote VS Code session). I found my target Function App, right-clicked, and selected "Deploy to Function App...".
VS Code packaged all the code _from my Azure ML instance_ and deployed it directly _to my Azure Functions app_. My local PC was just a "thin client" for the whole process.
Conclusion
Don't let a locked-down corporate PC block you from getting work done. If your local tools are out of date or broken, you can use any cloud VM (like an Azure ML Compute Instance) as a powerful, modern development environment. By using the VS Code Remote-SSH features, you can get the best of both worlds.
2025-11-19
Related Articles
- How to Publish an Article to Medium Using Python and the Medium API
- How to chat with Local LLM in Obsidian
- How to connect to Oracle, MySql and PostgreSQL databases using Python?
- Setting Up Jupyter Notebook on a Windows Server: A Step-by-Step Guide
- How to use Python automatically get the Sap BO Temporary License keys?
Add Comments
Comments
Loading comments...