Obs/scripts/StandaloneObservabilityHelper.psm1

##------------------------------------------------------------------
## <copyright file="StandaloneObservabilityHelper.psm1" company="Microsoft">
## Copyright (C) Microsoft. All rights reserved.
## </copyright>
##------------------------------------------------------------------

Import-Module "$PSScriptRoot\StandaloneObservabilityConstants.psm1"
Import-Module "$PSScriptRoot\ExtensionHelper.psm1"

function Install-AzureConnectedMachineAgent
{
    param (
        [Parameter(Mandatory)]
        [System.String] $ResourceName,

        [Parameter(Mandatory)]
        [System.String] $ResourceGroupName,

        [Parameter(Mandatory)]
        [System.String] $TenantId,

        [Parameter(Mandatory)]
        [System.String] $RegionName,

        [Parameter(Mandatory)]
        [System.String] $SubscriptionId,

        [Parameter(Mandatory)]
        [System.String] $Cloud,

        [Parameter(Mandatory)]
        [System.String] $StampId,

        [Parameter(Mandatory = $true, ParameterSetName = "ServicePrincipal")]
        [PSCredential] $RegistrationSPCredential,

        [Parameter(Mandatory = $true, ParameterSetName = "DefaultSet")]
        [System.String] $AccessToken
    )

    ## Run connect command
    $timestamp = [DateTime]::Now.ToString("yyyyMMdd-HHmmss")
    $logPath = Get-LogFolderPath
    $logFile = Join-Path -Path $logPath -ChildPath "ArcForServerInstall_${timestamp}.txt"

    $AgentWebLink = $PipelineConstants.ArcForServerAgentWebLink
    $AgentMsiPath = Join-Path -Path $logPath -ChildPath $PipelineConstants.ArcForServerMsiFileName
    $AgentExePath = $PipelineConstants.ArcForServerExePath

    Write-Host "Starting Arc-for-server agent install AgentWebLink: $AgentWebLink AgentMsiPath: $AgentMsiPath AgentExePath: $AgentExePath logs: $logFile"
    if ($PSCmdlet.ParameterSetName -eq "ServicePrincipal") {
        $regSpNetworkCreds = $RegistrationSPCredential.GetNetworkCredential()
        Write-Host "Creating ArcContext for SPN: $($regSpNetworkCreds.UserName)"
        $arcContext = New-Object Microsoft.AzureStack.Observability.ObservabilityCommon.ArcForServer.ArcContextSpn
        $arcContext.SubscriptionId = $SubscriptionId
        $arcContext.ResourceGroup = $ResourceGroupName
        $arcContext.Location = $RegionName
        $arcContext.Cloud = $Cloud
        $arcContext.ResourceName = $ResourceName
        $arcContext.TenantId = $TenantId
        $arcContext.ServicePrincipalId = $regSpNetworkCreds.UserName
        $arcContext.ServicePrincipalSecret = $regSpNetworkCreds.Password
    }
    else {
        Write-Host "Creating ArcContext with AccessToken Length: $($AccessToken.Length)"
        $arcContext = New-Object Microsoft.AzureStack.Observability.ObservabilityCommon.ArcForServer.ArcContext
        $arcContext.SubscriptionId = $SubscriptionId
        $arcContext.ResourceGroup = $ResourceGroupName
        $arcContext.Location = $RegionName
        $arcContext.Cloud = $Cloud
        $arcContext.ResourceName = $ResourceName
        $arcContext.TenantId = $TenantId
        $arcContext.AccessToken = $AccessToken
    }

    $arcAgent = New-Object Microsoft.AzureStack.Observability.ObservabilityCommon.ArcForServer.ArcAgent
    $res = $arcAgent.Onboard($arcContext, $AgentWebLink, $AgentMsiPath, $logFile, $AgentExePath)

    Write-Host "Arc-for-server agent install $env:COMPUTERNAME. Status $res"

    if($res -eq $true) {
        Write-Host -ForegroundColor yellow "To view your onboarded server(s), navigate to https://ms.portal.azure.com/#blade/Microsoft_Azure_HybridCompute/AzureArcCenterBlade/servers"
    }
    else {
        throw "Hybrid agent connection failed. LogPath: $logFile"
    }
}

function Remove-AzureConnectedMachineAgent
{
    param (
        [Parameter(Mandatory = $true, ParameterSetName = "ServicePrincipal")]
        [PSCredential] $RegistrationSPCredential,

        [Parameter(Mandatory = $true, ParameterSetName = "DefaultSet")]
        [System.String] $AccessToken
    )

    $timestamp = [DateTime]::Now.ToString("yyyyMMdd-HHmmss")
    $logPath = Get-LogFolderPath
    $logFile = Join-Path -Path $logPath -ChildPath "ArcForServerUninstall_${timestamp}.txt"

    $AgentExePath = $PipelineConstants.ArcForServerExePath
    $AgentMsiPath = Join-Path -Path $logPath -ChildPath $PipelineConstants.ArcForServerMsiFileName

    if ($PSCmdlet.ParameterSetName -eq "ServicePrincipal") {
        $regSpNetworkCreds = $RegistrationSPCredential.GetNetworkCredential()
        Write-Host "Creating ArcContext for SPN: $($regSpNetworkCreds.UserName)"
        $arcContext = New-Object Microsoft.AzureStack.Observability.ObservabilityCommon.ArcForServer.ArcContextSpn
        $arcContext = New-Object Microsoft.AzureStack.Observability.ObservabilityCommon.ArcForServer.ArcContextSpn
        $arcContext.ServicePrincipalId = $regSpNetworkCreds.UserName
        $arcContext.ServicePrincipalSecret = $regSpNetworkCreds.Password
    }
    else {
        Write-Host "Creating ArcContext with AccessToken Length: $($AccessToken.Length)"
        $arcContext = New-Object Microsoft.AzureStack.Observability.ObservabilityCommon.ArcForServer.ArcContext
        $arcContext.AccessToken = $AccessToken
    }

    $arcAgent = New-Object Microsoft.AzureStack.Observability.ObservabilityCommon.ArcForServer.ArcAgent
    $res = $arcAgent.Offboard($arcContext, $logFile, $AgentExePath, $AgentMsiPath)
    if($res -eq $true) {
        Write-Host -ForegroundColor yellow "ArcAgent uninstall succeeded"
    }
    else {
        throw "ArcAgent uninstall failed. LogPath: $logFile"
    }
}

function New-GmaStateFolders
{
    param (
        [Parameter(Mandatory)]
        [System.String] $ObsRootFolderPath
    )
    
    $gmaCacheDirectories = [ordered] @{
    RuntimeSettings = "$ObsRootFolderPath\RuntimeSettings"
    GMACache = "$ObsRootFolderPath\GMACache"
    DiagnosticsCache = "$ObsRootFolderPath\GMACache\DiagnosticsCache"
    HealthCache = "$ObsRootFolderPath\GMACache\HealthCache"
    JsonDropLocation = "$ObsRootFolderPath\GMACache\JsonDropLocation"
    MonAgentHostCache = "$ObsRootFolderPath\GMACache\MonAgentHostCache"
    TelemetryCache = "$ObsRootFolderPath\GMACache\TelemetryCache"
    }    

    foreach ($directory in $gmaCacheDirectories.Values) {
        if (-not (Test-Path $directory -PathType Container)) {
            New-Item -ItemType Directory -Path $directory -Force -Verbose *>> $temp
        }
    }
}

function Test-IsArcAgentConnected() {
    [CmdletBinding()]
    param (
    )

    Write-Host "Checking if Arc connection already exists..."
    try {
        $arcAgentInfo = @{}
        $arcAgentExePath = $PipelineConstants.ArcForServerExePath
        $arcshow = & $arcAgentExePath show
        $arcshow | ForEach-Object {
            $arcProperty = $_.split(':')
            $arcAgentInfo[$arcProperty[0].trim()] =  if ($arcProperty.Count -eq 2) { $arcProperty[1].trim() } else {""}
        }

        Write-Host "Checking Agent connection status: $($arcAgentInfo.'Agent Status')"
        return ($arcAgentInfo.'Agent Status' -eq "Connected")
    }
    catch {
        Write-Host "Error $_ checking if Arc Agent is connected"
        return $false
    }
}

function Test-IsAzure() {
    [CmdletBinding()]
    param (
    )

    Write-Host "Checking if this is an Azure virtual machine"
    try {
        $response = Invoke-WebRequest -UseBasicParsing -Uri "http://169.254.169.254/metadata/instance/compute?api-version=2019-06-01" -Headers @{Metadata = "true"} -TimeoutSec 1 -ErrorAction SilentlyContinue
    }
    catch {
        Write-Verbose "Error $_ checking if we are in Azure"
        return $false
    }
    if ($null -ne $response -and $response.StatusCode -eq 200) {
        Write-Verbose "Azure check indicates that we are in Azure"
        return $true
    }
    return $false
}

function Set-StampGuid() {
    [CmdletBinding()]
    param (
    )

    $StampGuid = $env:STAMP_GUID
    Write-Host "Checking if STAMP_GUID environment is empty: $StampGuid"
    if ($null -eq $env:STAMP_GUID) {
        $StampGuid = (Get-CimInstance -Class Win32_ComputerSystemProduct).UUID
        Write-Host "$functionName Setting the STAMP_GUID variable to $StampGuid"
        $env:STAMP_GUID = $StampGuid
    }

    return $StampGuid
}

function Set-HandlerEnvInfo {
    param (
        [Parameter(Mandatory)]
        [System.String] $ObsRootFolderPath,

        [Parameter(Mandatory)]
        [System.String] $CloudName,

        [Parameter(Mandatory)]
        [System.String] $RegionName
    )

    <#
    Sample HandlerEnvironment.json content:
    [
        {
            "handlerEnvironment": {
                "configFolder": "C:\\Packages\\Plugins\\Microsoft.AzureStack.Observability.Observability\\0.0.0.4\\RuntimeSettings",
                "deploymentid": "",
                "heartbeatFile": "C:\\Packages\\Plugins\\Microsoft.AzureStack.Observability.Observability\\0.0.0.4\\status\\HeartBeat.Json",
                "hostResolverAddress": "",
                "instance": "",
                "logFolder": "C:\\ProgramData\\GuestConfig\\extension_logs\\Microsoft.AzureStack.Observability.Observability",
                "rolename": "",
                "statusFolder": "C:\\Packages\\Plugins\\Microsoft.AzureStack.Observability.Observability\\0.0.0.4\\status"
            },
            "name": "Microsoft.RecoveryServices.Test.AzureSiteRecovery",
            "version": "1"
        }
    ]
    #>


    $handlerEnvironment = @{}
    $handlerEnvironment.configFolder = "$ObsRootFolderPath\RuntimeSettings"
    $handlerEnvironment.deploymentid = ""
    $handlerEnvironment.heartbeatFile = "$ObsRootFolderPath\HeartBeat.Json"
    $handlerEnvironment.hostResolverAddress = ""
    $handlerEnvironment.instance = ""
    $handlerEnvironment.logFolder = "$ObsRootFolderPath"
    $handlerEnvironment.rolename = ""
    $handlerEnvironment.statusFolder = "$ObsRootFolderPath"

    $jsonArray = @{}
    $jsonArray.Add("handlerEnvironment",$handlerEnvironment)
    $jsonArray.Add("name","Microsoft.AzureStack.Observability.Standalone")
    $jsonArray.Add("version","1")

    $jsonContent = ConvertTo-Json -InputObject $jsonArray

    $envFile = "$global:extensionRootLocation\HandlerEnvironment.json"
    $functionName = $MyInvocation.MyCommand.Name

    Write-Host "$functionName : HandlerEnvironment.json doesn't exist at path $envFile. So creating new file"
    Set-Content -Path $envFile -Value $jsonContent

    # Set the runtime settings
    $runtimeSettingsFile = "$ObsRootFolderPath\RuntimeSettings\0.settings"

    $publicSettings = @{}
    $publicSettings.cloudName = $CloudName
    $publicSettings.deviceType = "EnvValidatorStandAlone"
    $publicSettings.region = $RegionName

    $handlerSettings = @{}
    $handlerSettings.publicSettings = $publicSettings

    $jsonArray = @{}
    $jsonArray.Add("handlerSettings",$handlerSettings)

    $runtimeSettings = @{}
    $runtimeSettings.runtimeSettings = @($jsonArray)
    $jsonContent = ConvertTo-Json -InputObject $runtimeSettings -Depth 10

    Set-Content -Path $runtimeSettingsFile -Value $jsonContent
}

# Export section
Export-ModuleMember -Function Remove-AzureConnectedMachineAgent
Export-ModuleMember -Function Install-AzureConnectedMachineAgent
Export-ModuleMember -Function New-GmaStateFolders
Export-ModuleMember -Function Set-HandlerEnvInfo
Export-ModuleMember -Function Test-IsAzure
Export-ModuleMember -Function Set-StampGuid
Export-ModuleMember -Function Test-IsArcAgentConnected

# SIG # Begin signature block
# MIIoQgYJKoZIhvcNAQcCoIIoMzCCKC8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA/mmINKTvAzPqU
# EBKkgDTOitpAjBaQx7Gnla7JR8QR26CCDXYwggX0MIID3KADAgECAhMzAAADrzBA
# DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD
# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy
# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p
# bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwOTAwWhcNMjQxMTE0MTkwOTAwWjB0MQsw
# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u
# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy
# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
# AQDOS8s1ra6f0YGtg0OhEaQa/t3Q+q1MEHhWJhqQVuO5amYXQpy8MDPNoJYk+FWA
# hePP5LxwcSge5aen+f5Q6WNPd6EDxGzotvVpNi5ve0H97S3F7C/axDfKxyNh21MG
# 0W8Sb0vxi/vorcLHOL9i+t2D6yvvDzLlEefUCbQ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