-
Notifications
You must be signed in to change notification settings - Fork 435
Port to azd env get value #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7281d2b
Port to azd env get value
pamelafox 2f977e9
Merge branch 'main' into azdenvgetval
pamelafox c0fbb1a
Merge branch 'main' into azdenvgetval
pamelafox 93a32e2
Make johns suggestions
pamelafox 205cc08
Add requiredVersions
pamelafox 07ab2ba
Add check for azd env
pamelafox 0d984ac
Merge branch 'azdenvgetval' of https://github.com/Azure-Samples/rag-p…
pamelafox 44c373b
Merge branch 'azdenvgetval' of https://github.com/Azure-Samples/rag-p…
pamelafox b2fa1a7
Too echo-y
pamelafox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
$POSTGRES_HOST = ((azd env get-values | Select-String -Pattern "POSTGRES_HOST") -replace '^POSTGRES_HOST=', '') | ||
$POSTGRES_USERNAME = ((azd env get-values | Select-String -Pattern "POSTGRES_USERNAME") -replace '^POSTGRES_USERNAME=', '') | ||
$APP_IDENTITY_NAME = ((azd env get-values | Select-String -Pattern "SERVICE_WEB_IDENTITY_NAME") -replace '^SERVICE_WEB_IDENTITY_NAME=', '') | ||
$POSTGRES_HOST = (azd env get-value POSTGRES_HOST) | ||
if (-not $?) { | ||
Write-Host "Failed to find a value or POSTGRES_HOST in your azd environment. Make sure you run azd up first." | ||
exit 1 | ||
} | ||
$POSTGRES_USERNAME = (azd env get-value POSTGRES_USERNAME) | ||
$APP_IDENTITY_NAME = (azd env get-value SERVICE_WEB_IDENTITY_NAME) | ||
|
||
if ([string]::IsNullOrEmpty($POSTGRES_HOST) -or [string]::IsNullOrEmpty($POSTGRES_USERNAME) -or [string]::IsNullOrEmpty($APP_IDENTITY_NAME)) { | ||
Write-Host "Can't find POSTGRES_HOST, POSTGRES_USERNAME, and SERVICE_WEB_IDENTITY_NAME environment variables. Make sure you run azd up first." | ||
exit 1 | ||
} | ||
|
||
python ./src/backend/fastapi_app/setup_postgres_azurerole.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --app-identity-name $APP_IDENTITY_NAME | ||
python ./src/backend/fastapi_app/setup_postgres_azurerole.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --app-identity-name $APP_IDENTITY_NAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
$POSTGRES_HOST = ((azd env get-values | Select-String -Pattern "POSTGRES_HOST") -replace '^POSTGRES_HOST=', '') | ||
$POSTGRES_USERNAME = ((azd env get-values | Select-String -Pattern "POSTGRES_USERNAME") -replace '^POSTGRES_USERNAME=', '') | ||
$POSTGRES_PASSWORD = ((azd env get-values | Select-String -Pattern "POSTGRES_PASSWORD") -replace '^POSTGRES_PASSWORD=', '') | ||
$POSTGRES_HOST = (azd env get-value POSTGRES_HOST) | ||
if (-not $?) { | ||
Write-Host "Failed to find a value or POSTGRES_HOST in your azd environment. Make sure you run azd up first." | ||
exit 1 | ||
} | ||
$POSTGRES_USERNAME = (azd env get-value POSTGRES_USERNAME) | ||
$POSTGRES_DATABASE = (azd env get-value POSTGRES_DATABASE) | ||
|
||
if ([string]::IsNullOrEmpty($POSTGRES_HOST) -or [string]::IsNullOrEmpty($POSTGRES_USERNAME) -or [string]::IsNullOrEmpty($POSTGRES_PASSWORD)) { | ||
Write-Host "Can't find POSTGRES_HOST, POSTGRES_USERNAME, and POSTGRES_PASSWORD environment variables. Make sure you run azd up first." | ||
if ([string]::IsNullOrEmpty($POSTGRES_HOST) -or [string]::IsNullOrEmpty($POSTGRES_USERNAME) -or [string]::IsNullOrEmpty($POSTGRES_DATABASE)) { | ||
Write-Host "Can't find POSTGRES_HOST, POSTGRES_USERNAME, and POSTGRES_DATABASE environment variables. Make sure you run azd up first." | ||
exit 1 | ||
} | ||
|
||
python ./backend/src/fastapi_app/setup_postgres_database.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --password $POSTGRES_PASSWORD | ||
python ./src/backend/fastapi_app/setup_postgres_database.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --database $POSTGRES_DATABASE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
$POSTGRES_HOST = ((azd env get-values | Select-String -Pattern "POSTGRES_HOST") -replace '^POSTGRES_HOST=', '') | ||
$POSTGRES_USERNAME = ((azd env get-values | Select-String -Pattern "POSTGRES_USERNAME") -replace '^POSTGRES_USERNAME=', '') | ||
$POSTGRES_PASSWORD = ((azd env get-values | Select-String -Pattern "POSTGRES_PASSWORD") -replace '^POSTGRES_PASSWORD=', '') | ||
$POSTGRES_HOST = (azd env get-value POSTGRES_HOST) | ||
if (-not $?) { | ||
Write-Host "Failed to find a value or POSTGRES_HOST in your azd environment. Make sure you run azd up first." | ||
exit 1 | ||
} | ||
$POSTGRES_USERNAME = (azd env get-value POSTGRES_USERNAME) | ||
$POSTGRES_DATABASE = (azd env get-value POSTGRES_DATABASE) | ||
|
||
if ([string]::IsNullOrEmpty($POSTGRES_HOST) -or [string]::IsNullOrEmpty($POSTGRES_USERNAME) -or [string]::IsNullOrEmpty($POSTGRES_PASSWORD)) { | ||
Write-Host "Can't find POSTGRES_HOST, POSTGRES_USERNAME, and POSTGRES_PASSWORD environment variables. Make sure you run azd up first." | ||
if ([string]::IsNullOrEmpty($POSTGRES_HOST) -or [string]::IsNullOrEmpty($POSTGRES_USERNAME) -or [string]::IsNullOrEmpty($POSTGRES_DATABASE)) { | ||
Write-Host "Can't find POSTGRES_HOST, POSTGRES_USERNAME, and POSTGRES_DATABASE environment variables. Make sure you run azd up first." | ||
exit 1 | ||
} | ||
|
||
python ./src/backend/fastapi_app/setup_postgres_seeddata.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --password $POSTGRES_PASSWORD | ||
python ./src/backend/fastapi_app/setup_postgres_seeddata.py --host $POSTGRES_HOST --username $POSTGRES_USERNAME --database $POSTGRES_DATABASE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.