Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion examples/QuickStart/DotNet/QuickStartApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
using Microsoft.Extensions.Configuration;
using Azure.Identity;

Uri endpoint = new(Environment.GetEnvironmentVariable("AZURE_APPCONFIGURATION_ENDPOINT") ??
throw new InvalidOperationException("The environment variable 'AZURE_APPCONFIGURATION_ENDPOINT' is not set or is empty."));

var builder = new ConfigurationBuilder();
builder.AddAzureAppConfiguration(options =>
{
options.Connect(Environment.GetEnvironmentVariable("AZURE_APPCONFIG_CONNECTION_STRING"))
options.Connect(endpoint, new DefaultAzureCredential())
.Select("QuickStartApp*");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
</PropertyGroup>

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

</Project>
8 changes: 5 additions & 3 deletions examples/QuickStart/JavaScript/QuickStartApp/QuickStartApp.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const { load } = require("@azure/app-configuration-provider");
const connectionString = process.env.AZURE_APPCONFIG_CONNECTION_STRING;
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.
async function run() {
console.log("Sample 1: Load key-values with default selector");

// Connect to Azure App Configuration using a connection string and load all key-values with null label.
const settings = await load(connectionString);
// Connect to Azure App Configuration using Microsoft Entra ID authentication and load all key-values with null label.
const settings = await load(endpoint, new DefaultAzureCredential());

console.log("---Consume configuration as a Map---");
// Find the key "message" and print its value.
Expand Down
3 changes: 2 additions & 1 deletion examples/QuickStart/JavaScript/QuickStartApp/package.json
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"
Comment on lines +3 to +4
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.
}
}
4 changes: 4 additions & 0 deletions examples/QuickStart/JavaSpring/QuickStart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-appconfiguration-config-web</artifactId>
</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.
</dependency>
</dependencies>

<dependencyManagement>
Expand Down
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}
7 changes: 4 additions & 3 deletions examples/QuickStart/Python/QuickStartApp/QuickStartApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
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.

# Connect to Azure App Configuration using a connection string.
config = load(connection_string=connection_string)
# Connect to Azure App Configuration using Microsoft Entra ID authentication.
config = load(endpoint=endpoint, credential=DefaultAzureCredential())

# Find the key "message" and print its value.
print(config["message"])
Loading