Skip to content

deploye.ps1 Script failed to deploy UI solution #450

@agambhire

Description

@agambhire

Hello @placerda,

Deployment Summary

Release - 2.1.1

I am trying to deploy the newly created changes in UI app to portal I am facing deployment issue. The deploy.ps1 script is failing due to the script was constructing a hardcoded endpoint instead of using the validated $APP_CONFIG_ENDPOINT variable.

Below snippet shows the actual line causing the issue.

Image

Solution

old code -

function Get-ConfigValue {
    param(
        [Parameter(Mandatory=$true)][string]$Key
    )
    Write-Blue ("🛠️  Retrieving '{0}' (label={1}) from App Configuration…" -f $Key, $label)
    try {
        $val = az appconfig kv show `
            --name $configName `
            --key $Key `
            --label $label `
            --auth-mode login `
            --endpoint "https://appcs-$($env:RESOURCE_TOKEN).azconfig.io" `
            --query value -o tsv 2>&1
        $exitCode = $LASTEXITCODE
    } catch {
        $val = $_.Exception.Message
        $exitCode = 1
    }
    if ($exitCode -ne 0 -or [string]::IsNullOrWhiteSpace($val)) {
        Write-Yellow ("⚠️  Key '{0}' not found or empty. CLI output: {1}" -f $Key, $val)
        return $null
    }
    return $val.Trim()
}

new code -

function Get-ConfigValue {
    param(
        [Parameter(Mandatory=$true)][string]$Key
    )
    Write-Blue ("🛠️  Retrieving '{0}' (label={1}) from App Configuration…" -f $Key, $label)
    try {
        $val = az appconfig kv show `
            --name $configName `
            --key $Key `
            --label $label `
            --auth-mode login `
            --endpoint $APP_CONFIG_ENDPOINT `
            --query value -o tsv 2>&1
        $exitCode = $LASTEXITCODE
    } catch {
        $val = $_.Exception.Message
        $exitCode = 1
    }
    if ($exitCode -ne 0 -or [string]::IsNullOrWhiteSpace($val)) {
        Write-Yellow ("⚠️  Key '{0}' not found or empty. CLI output: {1}" -f $Key, $val)
        return $null
    }
    return $val.Trim()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions