Microsoft Foundry Workflows - Pt. 4: Migrate to VS Code Local

Microsoft Developer · Beginner ·🛠️ AI Tools & Apps ·7mo ago

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 Prepare for the DP-300 exam & the Azure Database Administrator Associate cert | Data Exposed
Prepare for the DP-300 exam & the Azure Database Administrator Associate cert | Data Exposed
Microsoft Developer
2 What I Wish I Knew ... about landing a job in tech
What I Wish I Knew ... about landing a job in tech
Microsoft Developer
3 Igniting Developer Innovation with Vector Search
Igniting Developer Innovation with Vector Search
Microsoft Developer
4 Combining the power of vector search with Azure OpenAI then revolutionize image search with vectors!
Combining the power of vector search with Azure OpenAI then revolutionize image search with vectors!
Microsoft Developer
5 What I Wish I Knew ... about finding your place in tech
What I Wish I Knew ... about finding your place in tech
Microsoft Developer
6 Fluent UI React Insights: Accessible by default
Fluent UI React Insights: Accessible by default
Microsoft Developer
7 Signing Container Images with Notary Project
Signing Container Images with Notary Project
Microsoft Developer
8 What I Wish I Knew ... about finding your place in tech
What I Wish I Knew ... about finding your place in tech
Microsoft Developer
9 What programming languages does GitHub Copilot support?
What programming languages does GitHub Copilot support?
Microsoft Developer
10 What I Wish I Knew ... about how much your job can change
What I Wish I Knew ... about how much your job can change
Microsoft Developer
11 What I Wish I Knew ... about how much your job can change
What I Wish I Knew ... about how much your job can change
Microsoft Developer
12 How do I become more confident about AI?
How do I become more confident about AI?
Microsoft Developer
13 How do I become more confident about AI?
How do I become more confident about AI?
Microsoft Developer
14 Performance Demos of SQL’s Intelligent Query Processing Feedback capabilities | Data Exposed
Performance Demos of SQL’s Intelligent Query Processing Feedback capabilities | Data Exposed
Microsoft Developer
15 What I Wish I Knew ... about coming to Microsoft
What I Wish I Knew ... about coming to Microsoft
Microsoft Developer
16 What I Wish I Knew ... about coming to Microsoft
What I Wish I Knew ... about coming to Microsoft
Microsoft Developer
17 Revolutionizing Image Search with Vectors
Revolutionizing Image Search with Vectors
Microsoft Developer
18 Igniting developer innovation with Vector search and Azure OpenAI
Igniting developer innovation with Vector search and Azure OpenAI
Microsoft Developer
19 Getting Started with Azure AI Studio's Prompt Flow - Part 2
Getting Started with Azure AI Studio's Prompt Flow - Part 2
Microsoft Developer
20 What I Wish I Knew ... about finding my career path
What I Wish I Knew ... about finding my career path
Microsoft Developer
21 What I Wish I Knew ... about finding my career path
What I Wish I Knew ... about finding my career path
Microsoft Developer
22 Windows Terminal's journey to Open Source
Windows Terminal's journey to Open Source
Microsoft Developer
23 Can I trust the code that GitHub Copilot generates?
Can I trust the code that GitHub Copilot generates?
Microsoft Developer
24 What I Wish I Knew ... about interviewing
What I Wish I Knew ... about interviewing
Microsoft Developer
25 What I Wish I Knew ... about interviewing
What I Wish I Knew ... about interviewing
Microsoft Developer
26 What is the Microsoft TechSpark Program?
What is the Microsoft TechSpark Program?
Microsoft Developer
27 SQL Server 2022: Accelerate query performance while reducing query compile time - w/ no code changes
SQL Server 2022: Accelerate query performance while reducing query compile time - w/ no code changes
Microsoft Developer
28 What I Wish I Knew ... about discovering computer science
What I Wish I Knew ... about discovering computer science
Microsoft Developer
29 What I Wish I Knew ... about discovering computer science
What I Wish I Knew ... about discovering computer science
Microsoft Developer
30 Call center transcription and analysis using Azure AI
Call center transcription and analysis using Azure AI
Microsoft Developer
31 How to use Text Analytics for health in Azure AI Language
How to use Text Analytics for health in Azure AI Language
Microsoft Developer
32 Azure OpenAI-powered summarization in Azure AI Language
Azure OpenAI-powered summarization in Azure AI Language
Microsoft Developer
33 Accelerate data labeling using Azure OpenAI and Azure AI Language
Accelerate data labeling using Azure OpenAI and Azure AI Language
Microsoft Developer
34 Building a Private ChatGPT with Azure OpenAI
Building a Private ChatGPT with Azure OpenAI
Microsoft Developer
35 What I Wish I Knew ... about how to interview
What I Wish I Knew ... about how to interview
Microsoft Developer
36 What I Wish I Knew ... about how to interview
What I Wish I Knew ... about how to interview
Microsoft Developer
37 Getting Started with Azure AI Studio's Prompt Flow - Part 3
Getting Started with Azure AI Studio's Prompt Flow - Part 3
Microsoft Developer
38 Intelligent Apps with Azure Kubernetes Service (AKS)
Intelligent Apps with Azure Kubernetes Service (AKS)
Microsoft Developer
39 Getting Started with Azure Blob Storage | Data Exposed: MVP Edition
Getting Started with Azure Blob Storage | Data Exposed: MVP Edition
Microsoft Developer
40 Chat + Your Data + Plugins
Chat + Your Data + Plugins
Microsoft Developer
41 What I Wish I Knew ... about different career paths
What I Wish I Knew ... about different career paths
Microsoft Developer
42 What I Wish I Knew ... about different career paths
What I Wish I Knew ... about different career paths
Microsoft Developer
43 Advanced Dev Tunnels Features | OD122
Advanced Dev Tunnels Features | OD122
Microsoft Developer
44 Learn Live - Manage performance and availability in Azure Cosmos DB for PostgreSQL
Learn Live - Manage performance and availability in Azure Cosmos DB for PostgreSQL
Microsoft Developer
45 Plan your SQL Migration to Azure with confidence | Data Exposed
Plan your SQL Migration to Azure with confidence | Data Exposed
Microsoft Developer
46 What I Wish I Knew ... about social skills in a tech career
What I Wish I Knew ... about social skills in a tech career
Microsoft Developer
47 What I Wish I Knew ... about social skills in a tech career
What I Wish I Knew ... about social skills in a tech career
Microsoft Developer
48 All About Vectors, Search, and Function Calling in Azure OpenAI - Labor Day Special
All About Vectors, Search, and Function Calling in Azure OpenAI - Labor Day Special
Microsoft Developer
49 Introduction to project ORAS
Introduction to project ORAS
Microsoft Developer
50 What I Wish I Knew ... about finding the right major
What I Wish I Knew ... about finding the right major
Microsoft Developer
51 What I Wish I Knew ... about finding the right major
What I Wish I Knew ... about finding the right major
Microsoft Developer
52 What I Wish I Knew ... about how to approach programming
What I Wish I Knew ... about how to approach programming
Microsoft Developer
53 What I Wish I Knew ... about how to approach programming
What I Wish I Knew ... about how to approach programming
Microsoft Developer
54 Learn Live - Scale from a single node to multiple nodes with Azure Cosmos DB for PostgreSQL
Learn Live - Scale from a single node to multiple nodes with Azure Cosmos DB for PostgreSQL
Microsoft Developer
55 What I Wish I Knew ... about diversity in tech #1
What I Wish I Knew ... about diversity in tech #1
Microsoft Developer
56 What I Wish I Knew ... about diversity in tech #1
What I Wish I Knew ... about diversity in tech #1
Microsoft Developer
57 Get started with SQL Server AGs across Windows, Linux and Container Replicas | Data Exposed
Get started with SQL Server AGs across Windows, Linux and Container Replicas | Data Exposed
Microsoft Developer
58 Writing LLM Apps with Azure AI and PromptFlow
Writing LLM Apps with Azure AI and PromptFlow
Microsoft Developer
59 What I Wish I Knew ... about how cool working in tech could be
What I Wish I Knew ... about how cool working in tech could be
Microsoft Developer
60 Open Source foundation models in Azure Machine Learning & optimization techniques behind the scenes
Open Source foundation models in Azure Machine Learning & optimization techniques behind the scenes
Microsoft Developer

This video series teaches how to migrate Microsoft Foundry workflows to a code-first experience using VS Code and demonstrates the use of GitHub Copilot and Foundry Workflows to create a social media campaign. By following this tutorial, viewers can learn how to design local development environments, integrate AI tools with VS Code, and create multi-agent workflows.

Key Takeaways
  1. Download the MV file from GitHub to local desktop
  2. Create a new GitHub repository and sign in to authenticate
  3. Use VS Code stable version to open the project
  4. Create a virtual environment using UV and activate it
  5. Install dependencies using pip from requirements.txt
  6. Log in to Microsoft Azure CLI by using a device code
  7. Retrieve subscriptions in the terminal
  8. Enter the number of a subscription to use
  9. Open GitHub Copilot to ask for code modification to save output to a markdown file
  10. Run python run_agent.py
💡 The use of GitHub Copilot and Foundry Workflows can simplify the process of creating social media campaigns and demonstrate the potential of AI tools in automating workflows.

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
Up next
How to Clean Up Your Backlog with AI & MCP | Businessmap Quick Tips
Businessmap
Watch →