-
Notifications
You must be signed in to change notification settings - Fork 5k
Move check for AZURE_PUBLIC_NETWORK_ACCESS #2209
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -241,8 +241,7 @@ async def main(strategy: Strategy, setup_index: bool = True): | |
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser( | ||
description="Prepare documents by extracting content from PDFs, splitting content into sections, uploading to blob storage, and indexing in a search index.", | ||
epilog="Example: prepdocs.py '.\\data\*' -v", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This epilog causes a SyntaxWarning in Python 3.12, and also isnt entirely accurate. The docs for data ingestion are the most accurate. |
||
description="Prepare documents by extracting content from PDFs, splitting content into sections, uploading to blob storage, and indexing in a search index." | ||
) | ||
parser.add_argument("files", nargs="?", help="Files to be processed") | ||
|
||
|
@@ -302,6 +301,10 @@ async def main(strategy: Strategy, setup_index: bool = True): | |
|
||
load_azd_env() | ||
|
||
if os.getenv("AZURE_PUBLIC_NETWORK_ACCESS") == "Disabled": | ||
logger.error("AZURE_PUBLIC_NETWORK_ACCESS is set to Disabled. Exiting.") | ||
exit(0) | ||
|
||
use_int_vectorization = os.getenv("USE_FEATURE_INT_VECTORIZATION", "").lower() == "true" | ||
use_gptvision = os.getenv("USE_GPT4V", "").lower() == "true" | ||
use_acls = os.getenv("AZURE_ADLS_GEN2_STORAGE_ACCOUNT") is not None | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,6 @@ | |
|
||
echo 'Running "prepdocs.py"' | ||
|
||
AZURE_USE_AUTHENTICATION=$(azd env get-value AZURE_PUBLIC_NETWORK_ACCESS) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. prepdocs.ps1 was already missing this check, so we just remove it from sh and add it to prepdocs.py. |
||
AZURE_PUBLIC_NETWORK_ACCESS=$(azd env get-value AZURE_PUBLIC_NETWORK_ACCESS) | ||
|
||
if [ -n "$AZURE_USE_AUTHENTICATION" ] && [ "$AZURE_PUBLIC_NETWORK_ACCESS" = "Disabled" ]; then | ||
echo "AZURE_PUBLIC_NETWORK_ACCESS is set to Disabled. Exiting." | ||
exit 0 | ||
fi | ||
|
||
additionalArgs="" | ||
if [ $# -gt 0 ]; then | ||
additionalArgs="$@" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meant to remove this TODO in the built-in auth PR but forgot to push the removal commit before merging. This TODO isn't actually needed, since built-in auth works.