Public/Hudu/Start-HuduConnection.ps1

function Start-HuduConnection() {
    try {
        $APIKey = Get-HuduJyskITAPIKey
    } catch {
        Throw "Failed to retreive API key from Azure Key Vault: $_"
    }

    New-HuduAPIKey -ApiKey $APIKey
    try {
        New-HuduBaseURL $HuduBaseURL
    } catch {
        Throw "Failed to connect to $($HuduBaseURL) - you are probably not on an allowed network: $_"
    }
    Write-Host "Successfully connected to $($HuduBaseURL)" -ForegroundColor Green
    return $true
}