Using XML Policies to Log and Analyze API Calls from Azure API Management

Azure API Management (APIM) is a powerful platform that enables you to publish and scale APIs while ensuring they are secured. One of the great features of Azure APIM is that you can add plugins and transforms to your APIs without any code change or restarts.

These capabilities are deployed using XML Policies which are a collection of statements. Moesif API Observability can be added in just a few minutes using an XML policy for APIM which makes it easy get visibility into API calls, even ones that are rejected and never reach your underlying service.

API Monetization Models for Usage-Based Billing

Why Monetize APIs?

API monetization is a great way to recoup your investment in your API programs. Without direct monetization, you’re dependent on other sources of capital to grow the program, such as other profit centers or venture capital.

If you’re not directly monetizing your APIs, you could be leaving money on the table. This can be especially true if you don’t have any limits in place and lean on the honor system.

Low Code Platforms Require Software Development Skills

Why it matters: IT leaders seeking to democratize technology with low code citizen developer projects may not realize low code platforms still require application development skills.

The big picture: Regardless of required development effort, building more apps for workers to contend with increases complexity and builds technical debt.

5 Tips for a Successful Threat Hunt

Survey data suggests that around 40% of SOCs (security operations centers) have started implementing specific threat hunting protocols. These protocols are created for cyber threat hunting or catching advanced threats that traditional tools and software missed.

Most tools and protocols are sophisticated enough to detect most threats. However, hackers are constantly striving to create new techniques and approaches that evade detection. Unfortunately, even newer tools that are AI-powered can miss detecting advanced threats. 

Who Needs GameDays? Resilience Testing Using Testcontainers

As you may agree, it is important to test your code. The resilience patterns implemented in your application are code (even if they're just a bunch of annotations). Often I saw that this is not tested thoroughly or not at all.

With Testcontainers, writing integration tests has become a commodity. We envision the same for resilience tests, so Steadybit open-sourced a small library built with the knowledge from our Chaos Engineering platform to help you write resilience tests with minimal effort and without installing extra software on your servers. The library is available on Maven Central and Github for everyone. In this post, we will add some resilience tests to a sample application using it.

PDF.co Launches Request Tester Tool for Platform APIs

PDF.co, provider of API technology for PDF creation, modification, and management, has announced a new tool for testing API endpoints on the platform. The new Request Tester tool allows for PDF function testing directly from the browser. 

Using the tool developers can easily call any of PDF.co’s APIs and display the output all in a centralized location. The tool is designed for easy selection of endpoints and simple output previews. 

The Best Developer Conferences of 2022

Unlike a lot of industries, conferences for developers are actually worth it. They aren’t just an excuse to spend your T&E budget, stay in a new hotel and see some bands that are over the hill.

Why? Between learning the actual skills of programming and the actual work of building, leading and creating teams of developers, there is a massive skills gap. Unless you’re lucky enough to have a mentor with all the answers you need to grow your career, the best way to learn what you don’t know is by tapping into the developer community.

5 Reasons Why Technologists are Optimistic About Full-Stack Observability

The world has become more app-centric, increasing the demand for always-on, seamless, and secure digital experiences. As a result, organizations in all sectors ramped up their efforts to achieve full-stack observability to bring together disconnected tools and generate unified visibility across their IT environment.

A recent report from Cisco AppDynamics, "The Journey to Observability," reveals the transition to full-stack observability is now a priority for 90% of organizations around the world.

3 Best Tactics To Prevent Technical Debt as an Engineer

The expression technical debt gets thrown around a lot and every Engineer knows that it slows down the development process. In this article, I want to give practical advice that your engineering team can manage and solve technical debt without spending a lifetime on it.

Let’s Define Technical Debt...

Often technical debt refers to a rushed development process or a lack of shared knowledge among team members. However, don't forget that in many cases technical debt is inevitable and is part of a normal software development process.

How To Boost Your In-house Enterprise DevOps Talent?

In 2010, Amazon moved from physical serves to Amazon web services. This initiative was a part of their enterprise DevOps transformation. Needless to say, it worked in their favor. Like this, there are numerous organizations that are leveraging enterprise DevOps for greater scalability, efficient collaboration, and communication, faster release cycles, better code quality, etc. 

But, adopting enterprise DevOps is not a piece of cake. To successfully implement enterprise DevOps, you need to hire reliable people who live and breathe DevOps. Or, you may follow key practices to boost your in-house DevOps talent. In this article, let’s discuss a few of such key practices!

My Approach to Automating Grocery Shopping

The pandemic has presented everyone with unique challenges. For me, it became particularly hard to switch to online grocery shopping.

When I do my shopping offline, I usually dont have to plan much, moving through the isles and picking up stuff as I go. Its rare that I forget something, but more often I buy things I dont actually need, but isnt that part of how supermarkets work? In my typical order, I'd buy groceries for seven to ten days at a time and it would contain sixty to eighty items in my cart.

Shopping online is a different story. I can't reproduce the same behaviour and go down every isle. So, I realized I needed to plan my meals. I started writing down ingredients for meals I wanted to make on sticky notes and combining them to make an order.

This was really tedious. After a few orders, I noticed that it was kind of repetitive. Although my wife will tell you that I just was lazy and didn't want to do boring stuff, the developer in me said, It's time to automate this and never solve the same problem again.

That's how Cooklang was born.

About Cooklang

I thought, what if I store my recipes in Markdown-like text files and tag ingredients with @ symbol? Like this:

Then add @salt and @ground black pepper{} to taste.
Poke holes in @potato{2}.
Place @bacon strips{1%kg} on a baking sheet and glaze with @syrup{1/2%tbsp}.

That will make recipe files human and machine readable.

Given these recipe files, computers can create a shopping list and much more: calculate nutrition values, costs or whatever else you could need, given that information for ingredients provided.

And the recipe is still human readable, so I can be agile and store my recipes in git and perfect them over time (like code refactoring).

Also, because it's just a simple text format I avoid "vendor lock-in" problems and can use my recipes the same way when I retire. My recipes are mine, forever.

About tools

Having only a language specification isn't really helpful. Yes, I can store my recipes on GitHub and own them, but that's it.

I imagined it would be nice to have many small applications which can understand the language and do their own thing very well: calculate calories, shopping, costs, smart meal planning, etc. I was really excited.

I read a wonderful book, Crafting Interpreters by Robert Nystrom, and did a few experiments. I created a simple parser and CLI app. In this post, I wanted to focus on how I automated shopping. I might write another post about the parser and CLI, if anyone interested, so I will skip all the details about those for now.

So CLI can understand Cooklang files, extract ingredients, and group them:

$ cook shopping-list \
> Neapolitan\ Pizza.cook \
> Root\ Vegetable\ Tray\ Bake.cook
BREADS AND BAKED GOODS
    breadcrumbs                   150 g

DRIED HERBS AND SPICES
    dried oregano                 3 tbsp
    dried sage                    1 tsp
    pepper                        1 pinch
    salt                          25 g, 2 pinches

FRUIT AND VEG
    beetroots                     300 g
    carrots                       300 g
    celeriac                      300 g
    fresh basil                   18 leaves
    garlic                        3 gloves
    lemon                         1 item
    onion                         1 large
    red onion                     2 items
    thyme                         2 springs

MEAT AND SEAFOOD
    parma ham                     3 packs

MILK AND DAIRY
    butter                        15 g
    egg                           1 item
    mozzarella                    3 packs

OILS AND DRESSINGS
    Dijon mustard                 1 tsp
    Marmite                       1 tsp
    cider                         150 ml
    olive oil                     3 tbsp

OTHER (add new items into aisle.conf)
    tipo zero flour               820 g

PACKAGED GOODS, PASTA AND SAUCES
    vegetable stock               150 ml
    water                         530 ml

TINNED GOODS AND BAKING
    cannellini beans              400 g
    chopped tomato                3 cans
    fresh yeast                   1.6 g
    redcurrant jelly              1 tsp

I can set output format to json or yaml and feed this into other programs, or just use good old plain text output manipulation. CLI has a few more features like a web-server to explore the recipes with cooking mode and make shopping list in the browser.

I migrated a bunch of recipes from scattered sources into Cooklang format and stored them on GitHub repository https://github.com/dubadub/cookbook.

My grocery shopping approach

Unfortunately, I haven't fully automated my grocery shopping yet. I still need to do some manual steps, because my shop doesn't provide any API access (surprise!).

That's how my process looks now:

1/ I generate a list of all ingredients. I added directories with symlinks to recipes, which represent a meal plan. So it's easy to generate a list of ingredients for the whole directory like that:

$ cook shopping-list --only-ingredients ./Plan\ I

2/ I remove anything I already have at home from the list.

3/ I paste all the ingredients to a multi search input on the shop's web-site.

4/ I manually go through each item and add it to my cart .

5/ Done!

It has a manual step, but:

  • its much faster than before.
  • its less for me to think about;
  • it makes the entire process more precise.

I'm really happy with this precision part. I noticed that I now cover all my needs but no longer over consume. I see this as a form of eco-sufficiency in some ways.

What's next

I have only solved 80% of my problem, and I want to do more. I'm thinking about creating a mapping between ingredients from my recipes and links to them at my shop's website. That will allow me to use curl or Selenium to complete my solution.

How to Provision an Azure SQL Database With Active Directory Authentication

In this article, we will talk about how to provision an Azure SQL Database with authentication restricted to Active Directory users/groups/applications. We will use Pulumi to do that.

Why This Article?

In a previous article, I already talked about connecting to an Azure SQL Database using Azure Active Directory authentication. However, my focus was on querying an Azure SQL Database from C# code (from an ASP.NET 6 Minimal API that was using Microsoft.Data.SqlClient "Active Directory Default" authentication mode, to be more precise), and not on the configuration of the Azure AD authentication itself.

Dynamic Signaling for Managing Communication Between Two Separate BPMN Flows

This document explains how to implement Dynamic Signaling in BPMN processes or event sub-processes to execute particular process instances or threads.

Problem Statement:

  • A signal event is generally used to communicate between two separate BPMN flows.
  • However, the signal event has a global scope. It will broadcast the event to all related sub-flows and handlers.

Whenever BPMN interacts with multiple requests, it is difficult for the process engine to identify the exact instance to process. There is also the possibility of the thrown signal getting caught by all active handlers and multiple requests at a time, which may lead to wrong execution. 

How to Mkdir Command Works in Linux

On Linux and UNIX-like systems, like Mac, we use mkdir to make a new directory from the terminal. To do this, open up a new terminal, and make sure you're in the right directory using the cd command.

The syntax for mkdir looks like this, where dir_name is the name of your new directory, and [OPTIONS] are optional settings.

GitOps: What Is It and How Does It Work?

Over the years, software development methodologies have changed from the waterfall model, to agile, to what we call DevOps today. Even though these methodologies focus mostly on cultural aspects, they are all backed by powerful tools and technologies that make the work more straightforward than before. Just as Docker and Kubernetes boosted DevOps adoption by making containerization easier for organizations, we are now witnessing GitOps gain traction but with Git at the center of the approach. 

This article will explore GitOps: Why is it used? How does it work? 

floating exception (core dumped) – (division by zero)

Hello,

I am new in C programming, I am writing a function to evaluate a prefix arithmetic expression. I know my code works well but it seems the message floating exception (core dumped) is because if my (preval / 0) the program is not going to work. However, I would like to add this condition to avoid the the floating exception (core dumped)

if (function == 0) {puts("Division by zero is invalid"); exit(0);}

This is some of my code.

#include <stdio.h>       /* for printf in C programs */
#include <stdlib.h>      /* for exit() in C programs */



#define LEN 30
char  testing[] = "+42+55-6 8" ;

/*   gettoken for arithmetic expression.
 *      Only recognize + - * / ( ) and digits.
  *     Any other character ignored, such as space, must be used to separate consecutive numbers
 *      EXIT on end of line or string
 *   Return value:
 *      1. non-negative integer  OR
 *      2. negative of single character token
 *         uses fgetc, ungetc file functions, for stdin, or fmemopen for strings in memory
*/
#define   isdigit(ch)  ch >= '0' && ch <= '9'

int gettoken (FILE * f) {
    int sum = 0;
  while(1) {
    char ch = fgetc(f);         // first unprocessed char
    if (isdigit(ch))
    {   sum = ch&0xF;           // start of number
        ch = fgetc(f);
        while (isdigit(ch))
          {  sum = sum*10 + (ch&0xF);
             ch = fgetc(f);
          }
        ungetc (ch, f);      // finished number, do not consume non-numeral
        return sum;
    }
    else if (ch=='+'||ch=='-'||ch=='*'||ch=='/')
      return -ch;               // found an operator
    else if (ch==0 || ch=='\n') // no more characters
    {   puts("--no more input--");
        exit(0);
    }
  }     // end while. Ignoring space or other chars.
}

int preval(FILE *f);
FILE *fmemopen(void*,size_t,const char*); // needed for c99

int main() {
//  FILE * membuf = fmemopen(testing, LEN,"r");  // will be used by mipsmark
    puts("Enter a prefix arithmetic expression:");
   printf ("Evaluates to %d\n", preval(stdin));
  return 0;
}
/* Any changes above this line will be discarded by
# mipsmark. Put your answer between dashed lines. */
/*-------------- start cut ----------------------- */

/*  Student's Name:                             */

int preval(FILE *f)     {


        /* getting the token */
        int token = gettoken(f);


        /* switching the negative of token to branch into any binary operation, if any */

        switch (-token) {

        case '+':
        /* addition */
        return preval(f) + preval(f);

        case '-':
        /* substraction */
        return preval(f) - preval(f);

        case '*':
        /* multiplication */
        return preval(f) * preval(f);


        case '/':
        /* division */
        return preval(f) / preval(f);

        }

        /* numeric result of the prefix */

        return token;

        }