-
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR updates quickstart sample applications across multiple languages to use EntraID (Entra ID) authentication instead of connection string-based authentication for Azure App Configuration.
Key Changes:
- Replaced connection string authentication with DefaultAzureCredential for EntraID authentication
- Updated environment variable from
AZURE_APPCONFIG_CONNECTION_STRINGtoAZURE_APPCONFIGURATION_ENDPOINT - Added required identity/authentication libraries across all language examples
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/QuickStart/Python/QuickStartApp/QuickStartApp.py | Updated to use DefaultAzureCredential with endpoint-based authentication, added azure.identity import |
| examples/QuickStart/JavaScript/QuickStartApp/QuickStartApp.js | Updated to use DefaultAzureCredential with endpoint-based authentication, added @azure/identity import |
| examples/QuickStart/JavaScript/QuickStartApp/package.json | Added @azure/identity dependency for authentication support |
| examples/QuickStart/JavaSpring/QuickStart/src/main/resources/bootstrap.properties | Changed from connection-string to endpoint property for EntraID authentication |
| examples/QuickStart/JavaSpring/QuickStart/pom.xml | Added azure-identity-spring dependency for authentication support |
| examples/QuickStart/DotNet/QuickStartApp/Program.cs | Updated to use DefaultAzureCredential with endpoint-based authentication, includes proper error handling |
| examples/QuickStart/DotNet/QuickStartApp/QuickStartApp.csproj | Added Azure.Identity package reference with version 1.14.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "@azure/app-configuration-provider": "latest", | ||
| "@azure/identity": "latest" |
Copilot
AI
Dec 12, 2025
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.
Using "latest" as the version for npm packages is not recommended for production or example code, as it can lead to unexpected breaking changes and makes the examples non-reproducible. Consider pinning to specific versions or using semantic version ranges (e.g., "^2.0.0") to ensure stability while still allowing patch updates.
| "@azure/app-configuration-provider": "latest", | |
| "@azure/identity": "latest" | |
| "@azure/app-configuration-provider": "^1.0.0", | |
| "@azure/identity": "^3.3.0" |
| import os | ||
|
|
||
| connection_string = os.environ.get("AZURE_APPCONFIG_CONNECTION_STRING") | ||
| endpoint = os.environ.get("AZURE_APPCONFIGURATION_ENDPOINT") |
Copilot
AI
Dec 12, 2025
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.
Unlike the .NET example which includes explicit error handling for a missing environment variable, this code will silently pass None to the load function if AZURE_APPCONFIGURATION_ENDPOINT is not set. This could result in unclear error messages for users following the quickstart. Consider adding validation similar to the .NET example to provide a clear error message when the environment variable is not set.
| const { DefaultAzureCredential } = require("@azure/identity"); | ||
|
|
||
| const endpoint = process.env.AZURE_APPCONFIGURATION_ENDPOINT; | ||
|
|
Copilot
AI
Dec 12, 2025
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.
Unlike the .NET example which includes explicit error handling for a missing environment variable, this code will pass undefined to the load function if AZURE_APPCONFIGURATION_ENDPOINT is not set. This could result in unclear error messages for users following the quickstart. Consider adding validation similar to the .NET example to provide a clear error message when the environment variable is not set.
| if (!endpoint) { | |
| throw new Error("AZURE_APPCONFIGURATION_ENDPOINT environment variable is not set. Please set it to the endpoint of your Azure App Configuration instance."); | |
| } |
| </dependency> | ||
| <dependency> | ||
| <groupId>com.azure.spring</groupId> | ||
| <artifactId>azure-identity-spring</artifactId> |
Copilot
AI
Dec 12, 2025
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.
The pom.xml adds the azure-identity-spring dependency but doesn't specify a version. While this may work if a dependencyManagement section defines the version elsewhere, it's a best practice to be explicit about dependency versions in quickstart examples to ensure reproducibility. Consider specifying the version explicitly or ensure it's clearly defined in the dependencyManagement section.
| <artifactId>azure-identity-spring</artifactId> | |
| <artifactId>azure-identity-spring</artifactId> | |
| <version>5.14.0</version> |
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Azure.Identity" Version="1.14.0" /> | ||
| <PackageReference Include="Microsoft.Extensions.Configuration.AzureAppConfiguration" Version="6.0.1" /> |
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.
Is there a newer version we can update to?
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.
The latest version of Microsoft.Extensions.Configuration.AzureAppConfiguration is 8.4.0
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.
Updated Microsoft.Extensions.Configuration.AzureAppConfiguration version to 8.4.0
Co-authored-by: Zhenlan Wang <zhenlwa@microsoft.com>
Co-authored-by: Zhenlan Wang <zhenlwa@microsoft.com>
…github.com/Azure/AppConfiguration into user/maryanne/update_quick_start_apps_auth
zhenlan
left a comment
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.
Approving the PR but please don't merge it. We should coordinate this PR with the updated portal release and minimize the time they are inconsistent.
This PR
Updates our quick start sample apps to use EntraID auth instead of connection string