Code Monkey home page Code Monkey logo

blog-2021-05-verifying-azure-ad-tenant-availability's Introduction

About

I am a certified Microsoft Azure consultant from Belgium, who assists independent software vendors by leveraging Microsoft Azure and open source technologies.

Born and raised in East-Flanders, I started my journey into information technology at the age of six when my family bought a desktop computer that was powerful enough to run Windows 3.11. In the past, I have been a factory worker, a casual programmer and a Microsoft .NET consultant.

With my colleagues, I frequently produce presentations and workshops on the topic of DevSecOps. More recently I have discussed the workings of Windows Containers and how it fits into the container ecosystem. Along with Microsoft MVP Micha Wets, I was asked to talk about Kubernetes in a Microsoft world at the Microsoft Headquarters in Germany and about Azure Governance at CloudBrew in Belgium.

In May 2020, I was awarded the Azure Content Hero award by Microsoft for having created original content, sample code or learning resources and documented and shared experiences and lessons to help others to build on the Azure cloud platform.

Two years later, in 2022, I was honoured to receive the Microsoft Most Valuable Professional (MVP) award in the Microsoft Azure category.

blog-2021-05-verifying-azure-ad-tenant-availability's People

Contributors

thomvanl avatar

Watchers

 avatar

Forkers

powershellninja

blog-2021-05-verifying-azure-ad-tenant-availability's Issues

Response Status Code is interpreted the wrong way around

I just came across this simple but efficient piece of code that I'm going to use in one of my projects.
While testing the code I foundthough that the statuscode comparison is the wrong way around.
It currently looks like this:

switch ($response.StatusCode) {
    200 {
        Write-Verbose "Received 200 status code, the tenant's name is unavailable."
        return $false
    }
    404 {
        Write-Verbose "Received 404 status code, the tenant's name is available."
        return $true
    }
    default {
        Write-Error -Message "Unable to determine result." -ErrorAction Stop
        break;
    }
}

But it should look like this:

switch ($response.StatusCode) {
    200 {
        Write-Verbose "Received 200 status code, the tenant's name is available."
        return $true
    }
    404 {
        Write-Verbose "Received 404 status code, the tenant's name is unavailable."
        return $false
    }
    default {
        Write-Error -Message "Unable to determine result." -ErrorAction Stop
        break;
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.