Skip to content

Commit

Permalink
When using the option --storagekey for the prepdocs script the key mi…
Browse files Browse the repository at this point in the history
…ght (Azure-Samples#866)

contain `==` base64 padding at the end. This will fail to succesfully
login because the script just removes the `=` signs during the split
action. Copied the version from the app/start.ps1 which is better suited here.

Co-authored-by: Pamela Fox <pamelafox@microsoft.com>
  • Loading branch information
IRooc and pamelafox authored Oct 30, 2023
1 parent 5daa934 commit 3647826
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions scripts/loadenv.ps1
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
Write-Host "Loading azd .env file from current environment"
$output = azd env get-values
foreach ($line in $output) {
if (!$line.Contains('=')) {
continue
foreach ($line in (& azd env get-values)) {
if ($line -match "([^=]+)=(.*)") {
$key = $matches[1]
$value = $matches[2] -replace '^"|"$'
[Environment]::SetEnvironmentVariable($key, $value)
}

$name, $value = $line.Split("=")
$value = $value -replace '^\"|\"$'
[Environment]::SetEnvironmentVariable($name, $value)
}


$pythonCmd = Get-Command python -ErrorAction SilentlyContinue
if (-not $pythonCmd) {
# fallback to python3 if python not found
Expand Down

0 comments on commit 3647826

Please sign in to comment.