-
Notifications
You must be signed in to change notification settings - Fork 77
Update quickstart sample app to use EntraID authentication #1117
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 1 commit
cd02dd8
a4a9b11
0f4f788
09acf6f
3c99923
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 |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| { | ||
| "dependencies": { | ||
| "@azure/app-configuration-provider": "latest" | ||
| "@azure/app-configuration-provider": "latest", | ||
| "@azure/identity": "latest" | ||
MaryanneNjeri marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| spring.application.name=QuickStart | ||
| # Either a connection string or endpoint needs to be provided per store. | ||
| # All possible configurations can be found in the [README](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/spring-cloud-azure-starter-appconfiguration-config) | ||
| spring.cloud.azure.appconfiguration.stores[0].connection-string= ${AZURE_APPCONFIG_CONNECTION_STRING} | ||
| spring.cloud.azure.appconfiguration.stores[0].endpoint= ${AZURE_APPCONFIGURATION_ENDPOINT} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,12 +2,13 @@ | |
| load, | ||
| SettingSelector | ||
| ) | ||
| from azure.identity import DefaultAzureCredential | ||
| import os | ||
|
|
||
| connection_string = os.environ.get("AZURE_APPCONFIG_CONNECTION_STRING") | ||
| endpoint = os.environ.get("AZURE_APPCONFIGURATION_ENDPOINT") | ||
|
||
|
|
||
| # Connect to Azure App Configuration using a connection string. | ||
| config = load(connection_string=connection_string) | ||
| # Connect to Azure App Configuration using EntraID authentication. | ||
MaryanneNjeri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| config = load(endpoint=endpoint, credential=DefaultAzureCredential()) | ||
|
|
||
| # Find the key "message" and print its value. | ||
| print(config["message"]) | ||
Uh oh!
There was an error while loading. Please reload this page.