Skip to content

Conversation

@MaryanneNjeri
Copy link
Contributor

This PR

Updates our quick start sample apps to use EntraID auth instead of connection string

Copy link
Contributor

Copilot AI left a 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_STRING to AZURE_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.

Comment on lines +3 to +4
"@azure/app-configuration-provider": "latest",
"@azure/identity": "latest"
Copy link

Copilot AI Dec 12, 2025

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.

Suggested change
"@azure/app-configuration-provider": "latest",
"@azure/identity": "latest"
"@azure/app-configuration-provider": "^1.0.0",
"@azure/identity": "^3.3.0"

Copilot uses AI. Check for mistakes.
import os

connection_string = os.environ.get("AZURE_APPCONFIG_CONNECTION_STRING")
endpoint = os.environ.get("AZURE_APPCONFIGURATION_ENDPOINT")
Copy link

Copilot AI Dec 12, 2025

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.

Copilot uses AI. Check for mistakes.
const { DefaultAzureCredential } = require("@azure/identity");

const endpoint = process.env.AZURE_APPCONFIGURATION_ENDPOINT;

Copy link

Copilot AI Dec 12, 2025

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.

Suggested change
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.");
}

Copilot uses AI. Check for mistakes.
</dependency>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-identity-spring</artifactId>
Copy link

Copilot AI Dec 12, 2025

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.

Suggested change
<artifactId>azure-identity-spring</artifactId>
<artifactId>azure-identity-spring</artifactId>
<version>5.14.0</version>

Copilot uses AI. Check for mistakes.

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.14.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.AzureAppConfiguration" Version="6.0.1" />
Copy link
Member

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?

Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Member

@zhenlan zhenlan left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants