Ubuntu Desktop with XRDP: A Quick Guide

Introduction Have you ever wanted to install Ubuntu Desktop and configure it with XRDP? Here’s a short guide to get you through it. Step 1: Installing Ubuntu Desktop Let’s start by installing Ubuntu Desktop. Just run this command: sudo apt -y install ubuntu-desktop Grab a coffee while your terminal goes wild with text. It takes some time for the packages to install. Step 2: Installing XRDP Next, install XRDP to allow remote access:...

June 15, 2024 · 1 min · Alex Popescu

Azure AD Authentication for C# WebAPI with Swagger

Introduction Have you ever wanted to add Azure AD authentication to a C# WebApi project for .NET 8? Now you can. The Code First, let’s create a new WebAPI project: dotnet new webapi --use-controllers Next, add the required package: dotnet add package Microsoft.AspNetCore.Authentication.JwtBearer Next, we need to add the Azure AD settings in appsettings.json: "AzureAd": { "Instance": "https://login.microsoftonline.com/", "TenantId": "yyyy", "ClientId": "xxxxx" } Replace yyyy with the correct TenantId and xxxxx with the correct Azure SPN Client Id....

April 23, 2024 · 2 min · Alex Popescu

Automated Fake Database Population with Python

Introduction In this article, we’ll explore a Python script that leverages mimesis library to populate an (Azure) SQL database with fake data. The Code import logging import random import pandas as pd import pymssql import sqlalchemy from dotenv import dotenv_values from mimesis import Address, Datetime, Person from mimesis.enums import Gender from sqlalchemy import create_engine # Load environment variables config = dotenv_values(".env") # Configure logging to both console and file logFormatter = logging....

March 17, 2024 · 3 min · Alex Popescu

Using Serilog with Azure Log Stream

Continuing of our previous article here, let’s explore how to show the logs in Azure Log Stream. Integrating Serilog To begin, incorporate Serilog into your project using Visual Studio or the .NET CLI: # Using Visual Studio Install-Package Serilog.AspNetCore # Using .NET CLI dotnet add package Serilog.AspNetCore Configuring Serilog Add the necessary configuration settings in your appsettings.json file, resembling the structure below: "Serilog": { "Using": ["Serilog.Sinks.Console", "Serilog.Sinks.File"], "MinimumLevel": "Debug", "WriteTo": [ { "Name": "Console" }, { "Name": "File", "Args": { "path": "Logs/applog-....

December 6, 2023 · 2 min · Alex Popescu

Overriding appsettings.json on Azure Web App

This article demonstrates how to override app settings values on Azure Web App by creating a straightforward RESTful Web API service, deploying it to Azure Web App, and then overriding specific settings. Web API Creation To start, create a simple .NET 6 application (the latest LTS version at the time of writing) using the following command: dotnet new webapi -o TestApi Next, add a sample settings in appsettings.json: "Position": { "Title": "Editor", "Name": "Joe Smith" } Create an options object to map these setting object in a file named PositionOptions....

October 23, 2023 · 3 min · Alex Popescu