Skip to content

postprovision.ps1 breaks when values contains '=', such as an AppInsights connection string containing (IngestionEndpoint= and LiveEndpoint=) #5

@pascostefan

Description

@pascostefan

A solution could be something like this perhaps?
foreach ($line in $lines) {
$index = $line.IndexOf('=')
$name = $line.Substring(0, $index)
$value = $line.Substring($index + 1)
$value = $value.Replace('"', '')
$name = $name.Replace('__', '')
if ($value -ne '') {
dotnet user-secrets set $name $value | Out-Null
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions