Microsoft Foundry Workflows - Pt. 4: Migrate to VS Code Local
Skills:
AI Tools for PMs90%Agent Foundations90%Tool Use & Function Calling90%AI Systems Design80%Prompt Craft80%
Key Takeaways
This video series covers migrating Microsoft Foundry workflows to a code-first experience using Visual Studio Code (local) and demonstrates the use of GitHub Copilot, Azure, and Foundry Workflows to create a social media campaign.
Full Transcript
So, I'm going to transition to over to doing things locally. I want to use GitHub Copilot locally over on my machine. So, to do that, the first thing that we mentioned in the instructions, if I go back there, is you need to download the MV file. Let's see if I can find where we mentioned that. Here we are. Continue on your local desktop. You're going to rightclick that and you're going to click download and then it'll download it. And then from here there's a button at the very bottom that says continue on desktop. You're going to select that. You're going to be asked to sign into GitHub. The reason being is that we're going to create this project in your GitHub repository. You can give it a brand new name. So I'm going to call this one gitens workflow demo. And you can choose whether you want it to be a private or a public repository. I want it to be private. And then once that's been created, you can choose whether you want to work within the VS Code stable or insiders um version. So I'm going to go with the stable. And then I'm going to click open to open in VS Code locally. I need to choose where I want to save it. So I like to save everything for me in this GitHub folder. And once that has been saved, you'll then be asked if you want to open it. I want to open it in a new window. And here's that project. It's ready for me to start taking some action. So, first things first that we want to do is actually set up our environment to do things locally because now that we're doing things locally, we don't have everything already contained for us in a container um um or in like a code space or anything of that nature. So, what we need to do instead is create a brand new virtual environment. So, I'm going to open up the terminal. And within the terminal, I like to use UV personally because it's just fast. So, I'm going to type in the command uvve to create my virtual environment. And I'm going to activate it with the command that shows in the terminal output, which would beve back slashscripts back slashactivate. And so that'll activate my virtual environment. And then if you do recall, we need to bring over that file that we downloaded. So, and given the sensitive information that's in there, I'm not going to show you explicitly what's in that file, but essentially what you'll do is open up that download of yours and then you'll create av file and then you're going to copy and paste everything in there. So now that thev file has been created, we need to install our dependencies. So, we have a requirements.txt file in here, and it lists everything that we need to have installed. So, let me give myself some more space so you can see what's happening over here. To install those dependencies, we're going to do uv pip install-r followed by requirements.txt. So, we can read what's in this file. And we are, yep, off to the races. Everything has now been installed. So, I'm going to go ahead and clear that. And before we actually run this file, there's one more thing that we need to do. And we need to actually authenticate with Azure or to Azure, you may notice that we're using the default Azure credential for authentication. We don't have any API keys that are hardcoded anywhere. They're not even in that file either. So to do that, there's one of two commands. One is going to be a login. If you run that command, what it's going to do is give you a URL and a code. You're going to go to the URL and then enter that code that you're given and then you'll need to sign in and that's how you'll authenticate. You'll come back here in VS Code depending on how your subscription is set up. Your command might be a little different for like mine. So for me it's a login and then I also need to pass in the tenant itself and then the rest of the command is d- use- device-code. So that's what I personally need to do and clicking enter. Everything that happens from here should be the same regardless of which of the two commands. So here's that URL I mentioned. I recommend copying this code while you have it here. Now and then controllclick to go to that URL. And now this is what that web page looks like that I mentioned. You're going to enter the code. Click next. You'll be prompted to choose an account to sign into. And then once you've chosen that account, you're going to confirm that you are trying to sign in to the Microsoft Azure CLI by clicking continue. And then you can exit that screen. Next, it's going to retrieve your subscriptions in the terminal. And so I have three different ones that I have access to. I'm going to enter the number one for the one that I need. You'll enter the appropriate number for the subscription for yourself. And then when you click enter, that's it. So I'm all logged in and authenticated right now. And now we can actually move forward with running this file. So again, this run py file or this run aent.py file is the file that we were just working with. If you recall, once we get the output, it's a little um not messy, but it's not the most legible way for me to read what's going on. So, I'm going to open up GitHub Copilot and I'm going to ask it what do I need to do to modify this code so that way I can get the output from these agents into a markdown file that's going to be called social media campaign. And so, making sure that this file is open, this is how we're able to reference this file directly within GitHub Copilot. While I could search for it in the folders, if you have it already as the active one, it'll reference it directly. Now, we want to make sure that we are in agent mode as well because I'm going to ask GitHub copilot to take some action for me in this file. And in case you're curious, I'm using cloud sonet 4.5. And what I'm going to say to it is how do I change this file so that the output from the final agent is saved to a new markdown file called social- media-cme within the root of this project. Let's just see what it does just with that prompt. So, I'm going to enter that. And it's working. It's thinking. Okay. So, it's helping me modify what's I have here. And so, what it's decided to do, I don't want to get too ahead of myself, but Oh, nope. It's done. So, I'll take you through exactly what happened here, and I'll follow along with its output. But I can also see what's happening here in the code. So right now what it's doing is that it's taking all the output from the agent. It's collecting it in this list called output_content. And then from there it's going to capture the text from the two event types that we have here. I'm just going to keep this cuz I have faith in GitHub Copilot for this one. Um and then from there it takes everything that has been collected from the the agents. It's going to append as you can see here to there and then at the very end at the bottom we have this output file which is a social media campaign markdown file that's being created. It's going to be written to there and then it'll be saved directly in the root of this project. So, let's see if that worked. I'm going to close GitHub Copilot. And as a reminder, we've already passed in our prompt, which is create a social media campaign for the Ktoso Electronics Wireless Earbuds. And I the code is short. If you can see, there's there's there's not much in here. And even within our project files, we didn't have to necessarily create files upon files of everything pertinent to each agent because all that is back over in Foundry. All right. So from here, let me close this. And without further ado, we are going to run this. So python run_agent.py and clicking enter. And I'll show you here that social media campaign does not currently exist. So ideally what we will get from running this is that file being created. All right. So it looks like we are getting the output that I am in need of. This is lovely. Okay. And now we're at agent three. I'm seeing we have a table that was created. So, let's see how this looks in the end because there is absolutely no way I as the human would have gone through all this output just to figure out what was going on with the social media campaign. And so, this is why it's great to be able to continue things on our own with code instead of just fully only ever working directly in the Foundry portal. So, that's done. And here's that file. So going to minimize this terminal. And this is a social media campaign. If I click to preview the markdown to the side, this is the campaign in all its glory. Everything's formatted very well. If you want, you can continue to modify everything with your agents that you've created to tailor the way things get output. I know I did see a table was created. So, here's an example of one of those tables and I'll add this into the repo so that way you can see what output could look like in theory when you're creating something of this nature. But for creating a social media campaign along with agents, this has done a pretty good job. Even here, I have a table for tweets to go out, for example, and threads to go out as well. I have information for like my Tik Tok posts, and I actually have a calendar. Let's um make this even bigger so we can see. That's better. So I have a week one example. Oh, this is beautiful. The agents did a really great job working together. So again, I will put this in the repo so you can take a look through what's happening in here. And as I mentioned, you can definitely go through and modify the output to your liking based on whatever your needs are. I, as you have seen, have done very, very little to manipulate these agents to work to a level of perfection. But I do encourage you to continue to iterate over your various agents that you're bringing together in these multi- aent workflows. [music]
Original Description
This video is Part 4 of the Microsoft Foundry Workflows video series.
Join April as she provides a guided tutorial for how to migrate your Microsoft Foundry workflow to a code-first experience using Visual Studio Code (local). Once you have the code for your workflow, you can continue to iterate on your workflow directly in the VS Code editor with the Microsoft Foundry extension. In this video, April shows you how to set up your local environment prior to running and testing your workflow. April also shows you how to modify the workflow code with the help of GitHub Code Pilot Agent Mode.
Try it yourself in Microsoft Foundry: https://ai.azure.com
Learn More about Microsoft Foundry Model and Tools announcements at https://aka.ms/model-mondays
Join the Discord: https://aka.ms/insideMF/discord
Hop on Forum: https://aka.ms/insideMF/forum
Chapter Markers
00:00 - 00:02 - Introduction
00:03 - 01:30 - Open the workflow in VS Code (local)
01:31 - 05:07 - Setup local environment
05:08 - 07:59 - Modify the workflow code with GitHub Copilot Agent Mode
08:00 - 11:36 - Run the workflow code
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Microsoft Developer · Microsoft Developer · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Prepare for the DP-300 exam & the Azure Database Administrator Associate cert | Data Exposed
Microsoft Developer
What I Wish I Knew ... about landing a job in tech
Microsoft Developer
Igniting Developer Innovation with Vector Search
Microsoft Developer
Combining the power of vector search with Azure OpenAI then revolutionize image search with vectors!
Microsoft Developer
What I Wish I Knew ... about finding your place in tech
Microsoft Developer
Fluent UI React Insights: Accessible by default
Microsoft Developer
Signing Container Images with Notary Project
Microsoft Developer
What I Wish I Knew ... about finding your place in tech
Microsoft Developer
What programming languages does GitHub Copilot support?
Microsoft Developer
What I Wish I Knew ... about how much your job can change
Microsoft Developer
What I Wish I Knew ... about how much your job can change
Microsoft Developer
How do I become more confident about AI?
Microsoft Developer
How do I become more confident about AI?
Microsoft Developer
Performance Demos of SQL’s Intelligent Query Processing Feedback capabilities | Data Exposed
Microsoft Developer
What I Wish I Knew ... about coming to Microsoft
Microsoft Developer
What I Wish I Knew ... about coming to Microsoft
Microsoft Developer
Revolutionizing Image Search with Vectors
Microsoft Developer
Igniting developer innovation with Vector search and Azure OpenAI
Microsoft Developer
Getting Started with Azure AI Studio's Prompt Flow - Part 2
Microsoft Developer
What I Wish I Knew ... about finding my career path
Microsoft Developer
What I Wish I Knew ... about finding my career path
Microsoft Developer
Windows Terminal's journey to Open Source
Microsoft Developer
Can I trust the code that GitHub Copilot generates?
Microsoft Developer
What I Wish I Knew ... about interviewing
Microsoft Developer
What I Wish I Knew ... about interviewing
Microsoft Developer
What is the Microsoft TechSpark Program?
Microsoft Developer
SQL Server 2022: Accelerate query performance while reducing query compile time - w/ no code changes
Microsoft Developer
What I Wish I Knew ... about discovering computer science
Microsoft Developer
What I Wish I Knew ... about discovering computer science
Microsoft Developer
Call center transcription and analysis using Azure AI
Microsoft Developer
How to use Text Analytics for health in Azure AI Language
Microsoft Developer
Azure OpenAI-powered summarization in Azure AI Language
Microsoft Developer
Accelerate data labeling using Azure OpenAI and Azure AI Language
Microsoft Developer
Building a Private ChatGPT with Azure OpenAI
Microsoft Developer
What I Wish I Knew ... about how to interview
Microsoft Developer
What I Wish I Knew ... about how to interview
Microsoft Developer
Getting Started with Azure AI Studio's Prompt Flow - Part 3
Microsoft Developer
Intelligent Apps with Azure Kubernetes Service (AKS)
Microsoft Developer
Getting Started with Azure Blob Storage | Data Exposed: MVP Edition
Microsoft Developer
Chat + Your Data + Plugins
Microsoft Developer
What I Wish I Knew ... about different career paths
Microsoft Developer
What I Wish I Knew ... about different career paths
Microsoft Developer
Advanced Dev Tunnels Features | OD122
Microsoft Developer
Learn Live - Manage performance and availability in Azure Cosmos DB for PostgreSQL
Microsoft Developer
Plan your SQL Migration to Azure with confidence | Data Exposed
Microsoft Developer
What I Wish I Knew ... about social skills in a tech career
Microsoft Developer
What I Wish I Knew ... about social skills in a tech career
Microsoft Developer
All About Vectors, Search, and Function Calling in Azure OpenAI - Labor Day Special
Microsoft Developer
Introduction to project ORAS
Microsoft Developer
What I Wish I Knew ... about finding the right major
Microsoft Developer
What I Wish I Knew ... about finding the right major
Microsoft Developer
What I Wish I Knew ... about how to approach programming
Microsoft Developer
What I Wish I Knew ... about how to approach programming
Microsoft Developer
Learn Live - Scale from a single node to multiple nodes with Azure Cosmos DB for PostgreSQL
Microsoft Developer
What I Wish I Knew ... about diversity in tech #1
Microsoft Developer
What I Wish I Knew ... about diversity in tech #1
Microsoft Developer
Get started with SQL Server AGs across Windows, Linux and Container Replicas | Data Exposed
Microsoft Developer
Writing LLM Apps with Azure AI and PromptFlow
Microsoft Developer
What I Wish I Knew ... about how cool working in tech could be
Microsoft Developer
Open Source foundation models in Azure Machine Learning & optimization techniques behind the scenes
Microsoft Developer
More on: AI Tools for PMs
View skill →Related Reads
Chapters (5)
00:02 - Introduction
0:03
01:30 - Open the workflow in VS Code (local)
1:31
05:07 - Setup local environment
5:08
07:59 - Modify the workflow code with GitHub Copilot Agent Mode
8:00
11:36 - Run the workflow code
🎓
Tutor Explanation
DeepCamp AI