Posts

Github copilot SDK - wanted to write your own coding agent?

Image
You can now write your own coding editor using copilot SDK - a production ready, mature and well tested framework. For more info, try visiting https://github.com/github/copilot-sdk And the best part with this is that we have some sample implementation code here:- https://github.com/microsoft-foundry/foundry-samples/tree/main/samples/python/hosted-agents/bring-your-own/activity/github-copilot/src/github-copilot-activity And we have some docs to go with it here:- https://learn.microsoft.com/en-us/azure/foundry/how-to/develop/use-microsoft-foundry-skill?tabs=vscode

mcp tips microsoft agent_framework tool

Some tips when working with agent_framework Approve mode Did you know we can use get away with those manual approval everytime an agent call a remote tool with " approval_mode=never_required " - here is an example code snippet that allows us to do this. @ tool ( description = " List files in a directory. " , approval_mode = " never_require " ) def list_files ( directory : str ) -> list [ str ]:     """ List files in a directory. """     try :         return os . listdir ( directory )     except Exception as e :         return [ f "Error listing files in { directory } : { e } " ]     Azure Foundry Toolkit 

Azure foundry toolkit - essential tool for AI developer

Image
Have you tried Azure Foundry Toolkit - it is an essential toolki that allow us to develop, evaluate model and deploy Azure Agentic Framework app to Azure cloud. All that capabilities into your vscode. 

Azure foundry file search - setup and deploying as a remote agent (not ephemeral agent)

Image
 File search allow us to feed information into our model  In this implementation we are deploying agent in Azure Foundry and it uses chatgpt-5-mini. I created the file search manually. You agent can only have 1 index.  File search is not RAG.  With RAG you use Azure AI Search. File search is pretty generic. It requires basic setup where you don't necessary have to create a storage account manually to host your file.  As you can see here, I am uploading zippolock product info and it automatically create an index and embedd the info for me. There are limits to the file that you will be uploading.  And then I save this as an agent as shown here :- Ensuring we have the right pypi dependencies dependencies = [      "agent-framework>=1.13.0",      "azure-ai-projects", # Main Azure Foundry SDK      "azure-identity", # For authentication ] And then we can use the following code to query what is zippolock. The magic is...

azure found issue - 'Encrypted content is not supported with this model

 Ran into this issue here when setting up Azure Foundry agent to use "chatgpt-4-1-mini".   "<class 'agent_framework_foundry._chat_client.FoundryChatClient'> service failed to complete the prompt: Error code: 400 - {'error': {'message': 'Encrypted content is not supported with this model"> The solution - I have to deploy and update my code to use chatpgt-5-mini

Azure AVM for terraform - you still face versioning issues with providers

Image
Azure Verified module for terraform is great but it does not mean you get everything for free. You still run into isssues like provider versioning and terraform cli versioninig issues.  1. Terraform required providers versioning issue - (same old, same old) - where I started off using old version like 0.1.2. Then I run terraform init and terraform plan - looking good.  terraform {   required_providers {     azurerm = {       source   = " hashicorp/azurerm "       version = " ~> 3.0 "     }   } } provider "azurerm" {   features {} } resource "azurerm_resource_group" "example" {   name     = " rg-example "   location = " East US " } module "storage_account" {   source   = " Azure/avm-res-storage-storageaccount/azurerm "   version = " = 0.1.2 "   # Pin to exact version   # Required inputs   name           ...

Azure Aks automatic PDB

Azure AKS Automatic PDB provides automatic protection for your deployments during kubernetes upgrades or evictions. It supports HPA, KEDA and straight up deployment. One significant benenift is AKS upgrade sometimes are blocked by too restrictive PDB, with this extension we would be able to manage our cluster Installing the extension az feature register --namespace Microsoft.KubernetesConfiguration --name Extensions # Verify registration status az feature show --namespace Microsoft.KubernetesConfiguration --name Extensions # After the feature shows "Registered", refresh the provider az provider register -n Microsoft.KubernetesConfiguration Verifying the installation  kubectl get pdb -A -o custom-columns=NAME:.metadata.name,NAMESPACE:.metadata.namespace,MIN-AVAILABLE:.spec.minAvailable,OWNER:.metadata.annotations.ownedBy | grep EvictionAutoScaler Setting up cluster wide PDB management Here we will target specific all namespaces az k8s-extension create --cluster-name <cluste...

yq refresher

  Reading YAML in Bash with Examples For YAML files, you'll want to use yq (the YAML equivalent of jq ).  Sample YAML File Save this as config.yaml : dev: url: http://dev.com test: url: http://test.com Using yq   Extract dev URL $ yq '.dev.url' config.yaml Output: http://dev.com Extract test URL $ yq '.test.url' config.yaml Output: http://test.com Extract both URLs $ yq '.[] | .url' config.yaml Output: http://dev.com http://test.com Store in variables $ DEV_URL=$(yq '.dev.url' config.yaml) $ TEST_URL=$(yq '.test.url' config.yaml) $ echo "Dev: $DEV_URL" $ echo "Test: $TEST_URL" Output: Dev: http://dev.com Test: http://test.com Extract both conditionally (if they exist) $ yq 'keys[] as $env | {env: $env, url: .[$env].url}' config.yaml Output: env: dev url: http://dev.com --- env: test url: http://test.com Load all environments into variables #!/bin/bash # Using yq DEV_URL=$(yq ...

jq refresher

jq Tutorial with Examples & Output Let me walk through this with real JSON data and actual outputs. Sample Data { "users": [ {"id": 1, "name": "Alice", "age": 28, "dept": "engineering", "salary": 95000}, {"id": 2, "name": "Bob", "age": 35, "dept": "sales", "salary": 75000}, {"id": 3, "name": "Charlie", "age": 24, "dept": "engineering", "salary": 65000}, {"id": 4, "name": "Diana", "age": 42, "dept": "management", "salary": 120000}, {"id": 5, "name": "Eve", "age": 31, "dept": "sales", "salary": 80000} ] } Basic Navigation Get the users array: $ jq '.users' data.json Output: [ {"id": 1, ...

azure pipeline - writting and referencing it from different stage

In Azure devops, we can often write and then reference an output variable from a different stage or job.  We can references it via dependencies.job_name.outputs["step_name.variable_name"] - stage : Build     displayName : ' Build Stage '         jobs :             # JOB 2: Output Variables (sharing between jobs)       - job : Job2_OutputVariables         displayName : ' Job 2: Set Output Variables for Later Jobs '                 variables :           jobMessage : ' Hello from Job 2 '                 steps :           # Create a variable that can be used in dependent jobs           - script : |               echo "##vso[task.setvariable variable=sharedOutput;isOutput=true]Hello from Job2 Outpu...

mcp server :- from fastmcp.server.auth.providers.jwt import JWTVerifier cannot be resolve

When trying to use JWTVerified, I getting this error :- from fastmcp.server.auth.providers.jwt import JWTVerifier  cannot be resolve Then have to ensure I added the following packages  pip uninstall mcp pip install fastmcp And then I was able to references it  from mcp . server . fastmcp import FastMCP from fastmcp import FastMCP from fastmcp . server . auth . providers . jwt import JWTVerifier The only problem with this is there's 2 framework FastMCP - one derive from fastmcp pypi and the other mcp pypi. Mixing both of these is not a good dea and really confusing. 

container app - deploying and setting up mcp server and calling it remotely from your vscode agent

Image
To create a container app, we need to setup our mcp server code, then deploy to the server in Azure. Finally we will test it using our vscode.   The following are the code we using for todo task.  from mcp . server . fastmcp import FastMCP from mcp . server . transport_security import TransportSecuritySettings from task_store import store mcp = FastMCP ( " TasksMCP " , stateless_http = True ,               transport_security = TransportSecuritySettings ( enable_dns_rebinding_protection = False )               ) @ mcp . tool () async def list_tasks () -> list [ dict ]:     """ List all tasks with their ID, title, description, and completion status. """     return store . get_all () @ mcp . tool () async def get_task ( task_id : int ) -> dict | None :     """ Get a single task by its numeric ID.     Args:         tas...