Posts

Showing posts from 2019

Managing database objects in SQL with SMO framework

SQL Server Management Objects (SMO) is a collection of objects that are designed for programming all aspects of managing Microsoft SQL Server. SQL Server Replication Management Objects (RMO) is a collection of objects that encapsulates SQL Server replication management. To get a good overview see the  SMO Programming Guide . There many operations which may be performed with SMO from obtaining information about SQL-Server objects to creating and modifying objects or perhaps backing up or restoring a database. The code sample below is used to transform single column PKs and FKs in composite ones.  The source code can be found on GitHub at: https://github.com/dradoaica/Managing.Database.Objects.In.SQL.With.SMO Enjoy (ง°ل͜°)ง

Cross subscription/resource group Azure deployment using ARM template

Azure Resource Manager is the deployment and management service for Azure. It provides a consistent management layer that enables you to create, update, and delete resources in your Azure subscription. You can use its access control, auditing, and tagging features to secure and organize your resources after deployment. With ARM , you can create a template (in JSON format) that defines the infrastructure and configuration of your Azure solution. By using a template, you can repeatedly deploy your solution throughout its lifecycle and have confidence your resources are deployed in a consistent state. When deploying the template you usually specify a single subscription/resource group, but sometimes you need to create some resources in another subscription/resource group and you want to do it in one go. I n the following, I will show you how to create a template for a c ross subscription/resource group deployment. You can deploy to only five resource groups in a single d...

Building a RESTful API with NancyFx v2

The NancyFx v2 official release is available in Nuget since april 2019. The primary reason for upgrading NancyFx to v2 is because of its support for .NETStandard 2.0 which means you can move to .NET Core. Starting from my previous post  Building a RESTful API with NancyFx , I will show you how to upgrade to  NancyFx v2. The full   list ,  though short,  of b reaking changes can be found at: https://github.com/NancyFx/Nancy/wiki/Nancy-v2-Upgrade-Notes The most glaring breaking changes are with "Routing" and "Authentication and security". Routing Routing syntax has changed to Get("/", args => "Hello World");, these can be made async by adding the async/await keywords. To avoid changing the syntax for old routes and modules, Derek Comartin created a new module that would add back the existing routing behavior by calling the new underlying methods in the NancyModule, for more details see: https://codeopinion.com/upgrading-...

Kubernetes cluster with docker private registry

Prerequisites One or more machines running one of Ubuntu 20.04+ 2 GB or more of RAM per machine (any less will leave little room for your apps) 2 CPUs or more Full network connectivity between all machines in the cluster (public or private network is fine) * 192.168.147.3 is the IP of my machine which is used as master in the cluster Putting it all together 1. Install Docker # Install Docker CE ## Set up the repository: ### Update the apt package index apt-get update ### Install packages to allow apt to use a repository over HTTPS apt-get update && apt-get install apt-transport-https software-properties-common ca-certificates curl gnupg lsb-release ### Add Docker’s official GPG key curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg ### Add docker apt repository. echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] ...