Embracing the Messiness in Search of Epic Solutions

Category: Programming Language

  • MSAL: Delegated Access Authentication

    The Microsoft Authentication Library (MSAL) supports various programming languages and frameworks to simplify the authentication flow against the Microsoft identity platform, which is a prerequisite to invoke APIs such as Microsoft Graph. In this example, we will write a Python script that performs delegated authentication flow using the user’s credentials. Once authenticated, the script will… Read More…

  • Cloud Run: Connecting to Cloud SQL with Private IP and SSL

    There are various ways for a Cloud Run instance to connect to a Cloud SQL instance. Regardless of the solutions, if both resources reside in the same GCP organization, connecting using a Cloud SQL’s private IP with SSL/TLS encryption is highly recommended to prevent network traffic from going out to the internet. It is possible… Read More…

  • GitHub Copilot: 10+ Ways to Increase Productivity

    What is GitHub Copilot GitHub Copilot is dubbed “an AI pair programmer” to help us write code faster, using a generative AI model developed through a collaboration between GitHub, OpenAI, and Microsoft Azure AI. These days, there are nothing short of AI-powered tools that can do similar things in this space. For example, Tabnine, Google’s… Read More…

  • Terraform: Updating State Using “Moved” Block

    This post illustrates how you can rename existing resources or restructure the Terraform codebase without destroying and recreating the resources using moved block introduced in Terraform 1.1. It also explains some limitations using this new construct. PROBLEM: MODIFYING EXISTING RESOURCE NAME Using a simple resource block below as an example… On apply, one resource is… Read More…

  • Enabling Python VirtualEnv in JupyterLab

    This post illustrates how you can enable Python virtualenv in GCP JupyterLab so that you can organize your .ipynb files to use different virtual environments to keep track of Python package dependencies. PROBLEM You are using GCP JupyterLab. You want to adhere to the Python development best practices by not polluting the global environment with… Read More…

  • Terraform: Handling Errors with try(…)

    PROBLEM Given the following output block:- Sometimes, during an apply or destroy, we may get this error:- One way to fix this is to do conditional expressions like this, but it’s not pretty:- SOLUTION Since Terraform v0.12.20, we can solve this with try and achieve the same outcome:- Read More…