Skip to content
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

Add Default Values for Environment Variables in Workspace Connections Notebook #2010

Merged
merged 9 commits into from
Jan 5, 2023
10 changes: 5 additions & 5 deletions sdk/python/resources/connections/connections.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@
"from azure.ai.ml.entities import UsernamePasswordConfiguration\n",
"\n",
"# fetching secrets from env var to secure access, these secrets can be set outside or source code\n",
"acr_username = os.environ[\"ACR_USERNAME\"]\n",
"acr_password = os.environ[\"ACR_PASSWORD\"]\n",
"acr_username = os.getenv(\"ACR_USERNAME\", \"username\")\n",
"acr_password = os.getenv(\"ACR_PASSWORD\", \"password\")\n",
"\n",
"credentials = UsernamePasswordConfiguration(\n",
" username=acr_username, password=acr_password\n",
Expand Down Expand Up @@ -144,7 +144,7 @@
"from azure.ai.ml.entities import PatTokenConfiguration\n",
"\n",
"# fetching secrets from env var to secure access, these secrets can be set outside or source code\n",
"git_pat = os.environ[\"GIT_PAT\"]\n",
"git_pat = os.getenv(\"GIT_PAT\", \"git_pat\")\n",
"\n",
"credentials = PatTokenConfiguration(pat=git_pat)\n",
"\n",
Expand Down Expand Up @@ -175,9 +175,9 @@
"from azure.ai.ml.entities import SasTokenConfiguration\n",
"\n",
"# fetching secrets from env var to secure access, these secrets can be set outside or source code\n",
"python_feed_sas = os.environ[\"PYTHON_FEED_SAS\"]\n",
"python_feed_sas = os.getenv(\"PYTHON_FEED_SAS\", \"python_feed_sas\")\n",
"\n",
"credentials = SasTokenConfiguration(pat=python_feed_sas)\n",
"credentials = SasTokenConfiguration(sas_token=python_feed_sas)\n",
"\n",
"ws_connection = WorkspaceConnection(\n",
" name=\"<connection_name>\",\n",
Expand Down