Category · 43 posts

api

  1. Building an AI Agent Server with AG-UI and Microsoft Agent Framework

    In this post, I want to talk about the Python backend I built for an AG-UI demo project. It is part of a larger project that also includes a frontend that uses CopilotKit: This post discusses the Python AG-UI server that is built with Microsoft Agent Framework. All code is on GitHub: https://github.com/gbaeke/agui. Most of…

    ai
  2. End-to-end authorization with Entra ID and MCP

    Building an MCP server is really easy. Almost every language and framework has MCP support these days, both from a client and server perspective. For example: FastMCP (Python, Typescript), csharp-sdk and many more! However, in an enterprise scenario where users use a web-based conversational agent that uses tools on an MCP server, those tools might…

    ai
  3. Using tasks with streaming in Google Agent2Agent (A2A)

    In a previous post we created a simple A2A agent that uses synchronous message exchange. An A2A client sends a message and the A2A server, via the Agent Executor, responds with a message. But what if you have a longer running task to perform and you want to inform the client that the task in…

    ai
  4. Google’s A2A: taking a closer look

    In the previous post, I talked about options to build multi-agent solutions. The last option used Google’s A2A. A2A provides a wrapper around your agent, basically a JSON-RPC API, that standardizes how you talk to your agent. In this post we take a closer look at the basics of A2A with simple synchronous message exchange.…

    ai
  5. Creating a custom GPT to query any knowledge base with actions

    A while ago, OpenAI introduced GPTs. A GPT is a custom version of ChatGPT that combine instructions, extra knowledge, and any combination of skills. In this tutorial, we are going to create a custom GPT that can answer questions about articles on this blog. In order to achieve that, we will do the following: create…

    ai
  6. Enhancing Blog Post Search with Chunk-based Embeddings and Pinecone

    In this blog post, we’ll show you a different approach to searching through a large database of blog posts. The previous approach involved creating a single embedding for the entire article and storing it in a vector database. The new approach is much more effective, and in this post, we’ll explain why and how to…

    ai
  7. Pinecone and OpenAI magic: A guide to finding your long lost blog posts with vectorized search and ChatGPT

    Searching through a large database of blog posts can be a daunting task, especially if there are thousands of articles. However, using vectorized search and cosine similarity, you can quickly query your blog posts and retrieve the most relevant content. In this blog post, we’ll show you how to query a list of blog posts…

    ai
  8. Adding Authentication and Authorization to an Azure Static Web App

    In a previous post, we created a static web app that retrieves documents from Cosmos DB via an Azure Function. The Azure Function got deployed automatically and runs off the same domain as your app. In essence, that frees you from having to setup Azure Functions separately and configuring CORS in the process. Instead of…

    api
  9. First Look at Azure Static Web Apps

    Note: part 2 looks at the authentication and authorization part. At Build 2020, Microsoft announced Azure Static Web Apps, a new way to host static web apps on Azure. In the past, static web apps, which are just a combination of HTML, JavaScript and CSS, could be hosted in a Storage Account or a regular…

    api
  10. Writing a Kubernetes operator with Kopf

    In today’s post, we will write a simple operator with Kopf, which is a Python framework created by Zalando. A Kubernetes operator is a piece of software, running in Kubernetes, that does something application specific. To see some examples of what operators are used for, check out operatorhub.io. Our operator will do something simple in…

    api
  11. The basics of meshing Traefik 2.0 with Linkerd

    A while ago, I blogged about Linkerd 2.x. In that post, I used a simple calculator API, reachable via an Azure Load Balancer. When you look at that traffic in Linkerd, you see the following: Above, you do not see this is Azure Load Balancer traffic. The traffic reaches the meshed service via the Azure…

    api
  12. Token checking at the API Management layer

    In the previous blog post, I talked about the OAuth client credentials flow and how to implement it with Azure Active Directory. At the end of the post, I briefly talked about the need to validate the token in either your application or an intermediary layer. In this post, we will take a look at…

    api
  13. Using the OAuth Client Credentials Flow

    I often get questions about protecting applications like APIs using OAuth. I guess you know the drill: you have to obtain a token (typically a JWT or JSON Web Token) the client submits the token to your backend (via a Authorization HTTP header) the token needs to be verified (do you trust it?) you need…

    api
  14. Giving linkerd a spin

    A while ago, I gave linkerd a spin. Due to vacations and a busy schedule, I was not able to write about my experience. I will briefly discuss how to setup linkerd and then deploy a sample service to illustrate what it can do out of the box. Let’s go! Wait! What is linkerd? linkerd…

    api
  15. Azure SQL Database High Availability

    Creating a SQL Database in Azure is a simple matter: create the database and server, get your connection string and off you go! Before starting though, spend some time thinking about the level of high availability (HA) that you want: What is the required level of HA within the deployment region (e.g. West Europe)? Do…

    api
  16. Quick Tip: deploying multiple Traefik ingresses

    For a customer that is developing a microservices application, the proposed architecture contains two Kubernetes ingresses: internal ingress: exposed via an Azure internal load balancer, deployed in a separate subnet in the customer’s VNET; no need for SSL external ingress: exposed via an external load balancer; SSL via Let’s Encrypt The internal ingress exposes API…

    api
  17. Inspecting Web Application Firewall logs

    In some of my previous posts, I talked about Azure Front Door and Web Application Firewall policies to protect a workload like one or more APIs running on Kubernetes or App Service. Although I enabled the Web Application Firewall policies, I did not show what happens when the rules are triggered. Let’s take a look…

    api
  18. Azure Front Door and multi-region deployments

    In the previous post, we looked at publishing and securing an API with Azure Front Door and Azure Web Application Firewall. The API ran on Kubernetes, exposed by Kong and Kong Ingress Controller. Kong was configured to require an API key to call the /users API, allowing us to identify the consumer of the API.…

    api
  19. Publishing and securing your API with Kong and Azure Front Door

    In the post, Securing your API with Kong and CloudFlare, I exposed a dummy API on Kubernetes with Kong and published it securely with CloudFlare. The breadth of features and its ease of use made CloudFlare a joy to work with. It didn’t take long before I got the question: “can’t you do that with Azure…

    api
  20. Securing your API with Kong and CloudFlare

    In the previous post, we looked at API Management with Kong and the Kong Ingress Controller. We did not care about security and exposed a sample toy API over a public HTTP endpoint that also required an API key. All in the clear, no firewall, no WAF, nothing… 👎👎👎 In this post, we will expose…

    api
  21. API Management with Kong Ingress Controller on Kubernetes

    In previous posts, I wrote about Azure API Management in combination with APIs hosted on Kubernetes: API Management with private APIs: requires API Management with virtual network integration because the APIs are reachable via an internal ingress on the Azure virtual network; use the premium tier 💰💰💰 API Management with public APIs: does not require…

    api
  22. Azure API Management with public APIs on Kubernetes

    In my previous blog post, I looked at Azure API Management in combination with private APIs hosted on Kubernetes. The APIs were exposed via Traefik and an internal load balancer. To make that scenario work, the Azure API Management premium SKU is required, which is quite costly. This post describes another approach where the APIs…

    api
  23. Azure API Management and Azure Kubernetes Service

    You have decided to host your APIs in Kubernetes in combination with an API management solution? You are surely not the only one! In an Azure context, one way of doing this is combining Azure API Management and Azure Kubernetes Service (AKS). This post describes one of the ways to get this done. We will…

    api
  24. Streamlined Kubernetes Development with Draft

    A longer time ago, I wrote a post about draft. Draft is a tool to streamline your Kubernetes development experience. It basically automates, based on your code, the creation of a container image, storing the image in a registry and installing a container based on that image using a Helm chart. Draft is meant to…

    api
  25. Querying Postgres with GraphQL

    I wanted a quick and easy way to build an API that retrieves the ten latest events from a stream of data sent to a TimescaleDB hypertable. Since such a table can be queried by any means supported by Postgres, I decided to use Postgraphile, which automatically provides a GraphQL server for a database. If…

    api
  26. Hosting an Angular app in Kubernetes

    We recently had to deploy an Angular application to Kubernetes in three different environments: development, acceptance and production. The application is not accessed via the browser directly. Instead, it’s accessed via a Microsoft Office add-in. The next sections will provide you with some tips to make this work. In practice, I do not recommend hosting…

    api
  27. Microsoft Face API with a local container

    A few days ago, I obtained access to the Face container. It provides access to the Face API via a container you can run where you want: on your pc, at the network edge or in your datacenter. You should allocate 6 GB or RAM and 2 cores for the container to run well. Note…

    ai
  28. Building a real-time messaging server in Go

    Often, I need a simple real-time server and web interface that shows real-time events. Although there are many options available like socket.io for Node.js or services like Azure SignalR and PubNub, I decided to create a real-time server in Go with a simple web front-end: For a real-time server in Go, there are several options.…

    api
  29. Azure API Management Consumption Tier

    In the previous post, I talked about a personal application I use to deploy Azure resources to my lab subscription. The architecture is pretty straightforward: After obtaining an id token from Azure Active directory (v1 endpoint), API calls go to API Management with the token in the authorization HTTP header. API Management is available in…

    api
  30. Simple Azure AD Authentication in a single page application (SPA)

    Adding Azure AD integration to a website is often confusing if you are just getting started. Let’s face it, not everybody has the opportunity to dig deep into such topics. For https://deploy.baeke.info, I wanted to enable Azure AD authentication so that only a select group of users in our AD tenant can call the back-end…

    api
  31. Detecting emotions with FER+

    In an earlier post, I discussed classifying images with the ResNet50v2 model. Azure Machine Learning Service was used to create a container image that used the ONNX ResNet50v2 model and the ONNX Runtime for scoring. Continuing on that theme, I created a container image that uses the ONNX FER+ model that can detect emotions in…

    ai
  32. ResNet50v2 classification in Go with a local container

    To quickly go to the code, go here. Otherwise, keep reading… In a previous blog post, I wrote about classifying images with the ResNet50v2 model from the ONNX Model Zoo. In that post, the container ran on a Kubernetes cluster with GPU nodes. The nodes had an NVIDIA v100 GPU. The actual classification was done…

    ai
  33. Recognizing images with Azure Machine Learning and the ONNX ResNet50v2 model

    Featured image from: https://medium.com/comet-app/review-of-deep-learning-algorithms-for-object-detection-c1f3d437b852 In a previous post, I discussed the creation of a container image that uses the ResNet50v2 model for image classification. If you want to perform tasks such as localization or segmentation, there are other models that serve that purpose. The image was built with GPU support. Adding GPU support was pretty…

    ai
  34. Deploying Azure Cognitive Services Containers with IoT Edge

    Introduction Azure Cognitive Services is a collection of APIs that make your applications smarter. Some of those APIs are listed below: Vision: image classification, face detection (including emotions), OCR Language: text analytics (e.g. key phrase or sentiment analysis), language detection and translation To use one of the APIs you need to provision it in an…

    analytics
  35. Deploying Azure resources using webhookd

    In the previous blog post, I discussed adding SSL to webhookd. In this post, I will briefly show how to use this solution to deploy Azure resources. To run webhookd, I deployed a small Standard_B1s machine (1GB RAM, 1 vCPU) with a system assigned managed identity. After deployment, information about the managed identity is available…

    api
  36. Using certmagic to add SSL to webhookd

    A while ago, I stumbled upon https://github.com/ncarlier/webhookd. It is a simple webhook server, written in Go, that can execute shell scripts. To use it, simply install it on a Linux box and execute it. By default, the executable looks at the ./scripts folder and maps each shell script to a URL you can call. It…

    api
  37. Draft: a simpler way to deploy to Kubernetes during development

    If you work with containers and work with Kubernetes, Draft makes it easier to deploy your code while you are in the earlier development stages. You use Draft while you are working on your code but before you commit it to version control. The idea is simple: You have some code written in something like…

    api
  38. IoT Hub Device Twin and MQTT

    When you connect to IoT Hub with MQTT directly, you need to connect with a ClientId, username and password. Those three values need to be set according to Azure IoT Hub specificiations: ClientId: use the IoT Hub deviceId Username: use {iothubhostname}/{deviceId}/api-version=2016-11-14 Password: use a SAS token When you connect with MQTT, you will notice it…

    api
  39. Communication between microservices in Kubernetes with Go Micro

    In this post, we continue the story we started with two earlier posts: Getting started with Kubernetes on Azure Microservices on Kubernetes: a simple example in Go In the previous post, I described a very simple service written with the help of Go Micro. It exposes an RPC call Get that retrieves a device from a…

    api
  40. Microservices on Kubernetes: a simple example in Go

    In the previous post, Getting started with Kubernetes on Azure, we talked about creating a Kubernetes cluster and deploying a couple of services. There are basically two services: Data: a service that exposes an endpoint to pick up data for an IoT device; you call it with http://service_endpoint:8080/data/devicename Device: a service that can be used…

    api
  41. Controlling Sonos from a Particle Photon using a Sonos API on a Pi 3

    In the previous article, Control Sonos with a easy to use API, we configured a Docker container on a Raspberry Pi 3 to run an easy to use Sonos API. I prefer this solution over writing code on the Photon to control Sonos. Now it is time to let the Photon talk to the API…

    api
  42. Control Sonos with an easy to use API

    In an earlier post, Controlling Sonos from a Particle Photon, we created a small app to do just that. The app itself contained some C++ code to interact with a Sonos player on your network. Although the code works, it does not provide you with full control over your Sonos player and it’s tedious to…

    api
  43. Temboo, Twilio and Nexmo: SMS and voice messages from your IoT device

    In this post, I will provide an overview of how to use Twilio and Nexmo to send SMSs and voice messages directly from your device. I will use a Particle Photon but this also works from an Arduino, or a Raspberry Pi or basically any other system. The reason for this is that I will…

    api