-
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
Conversation
|
||
@bp.route("/") | ||
async def index(): | ||
# TODO: use msal loginRedirect on a blankish page |
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.
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 comment
The 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.
|
||
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 comment
The 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.
Purpose
This PR moves the check for AZURE_PUBLIC_NETWORK_ACCESS into prepdocs.py itself, to avoid having duplicate (and currently incorrect) logic in the shell scripts.
The drawback is that it will take another second before it realizes it shouldn't run prepdocs, but in this case, since the majority of developers do not have AZURE_PUBLIC_NETWORK_ACCESS disabled, that seems fine.
This PR is based on #2197 which I wasn't able to update for some reason, so I made a new PR.
Does this introduce a breaking change?
When developers merge from main and run the server, azd up, or azd deploy, will this produce an error?
If you're not sure, try it out on an old environment.
Does this require changes to learn.microsoft.com docs?
This repository is referenced by this tutorial
which includes deployment, settings and usage instructions. If text or screenshot need to change in the tutorial,
check the box below and notify the tutorial author. A Microsoft employee can do this for you if you're an external contributor.
Type of change
Code quality checklist
See CONTRIBUTING.md for more details.
python -m pytest
).python -m pytest --cov
to verify 100% coverage of added linespython -m mypy
to check for type errorsruff
andblack
manually on my code.