本文へスキップ
Skillpedia
自動化48k · #3906

azure-appconfiguration-java

できること

このツールを使うと、アプリケーションの設定を一か所にまとめて管理できます。パスワードやURLなどの重要な情報を保存したり、アプリのどの機能を有効にするかを制御したりできます。

使う場面

  • ✓パスワードやアクセスキーを安全に保存したいとき。
  • ✓コードを変更せずに、アプリの機能をオンやオフにしたいとき。
  • ✓アプリの複数の部分で同じ設定を共有したいとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-appconfiguration-java/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-appconfiguration-java/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“地図サービスのAPIキーを保存して、「beta_map」機能をテストユーザーだけに有効にしてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

設定をキーと値のペアとして中央のサービスに追加します。すると、アプリがこのサービスに接続して、必要な設定を取得します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Azure App Configuration SDK for Java

Client library for Azure App Configuration, a managed service for centralizing application configurations.

Installation

<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-data-appconfiguration</artifactId>
    <version>1.8.0</version>
</dependency>

Or use Azure SDK BOM:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.azure</groupId>
            <artifactId>azure-sdk-bom</artifactId>
            <version>{bom_version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>com.azure</groupId>
        <artifactId>azure-data-appconfiguration</artifactId>
    </dependency>
</dependencies>

Prerequisites

  • Azure App Configuration store
  • Connection string or Entra ID credentials

Environment Variables

AZURE_APPCONFIG_CONNECTION_STRING=Endpoint=https://<store>.azconfig.io;Id=<id>;Secret=<secret>
AZURE_APPCONFIG_ENDPOINT=https://<store>.azconfig.io

Client Creation

With Connection String

import com.azure.data.appconfiguration.ConfigurationClient;
import com.azure.data.appconfiguration.ConfigurationClientBuilder;

ConfigurationClient configClient = new ConfigurationClientBuilder()
    .connectionString(System.getenv("AZURE_APPCONFIG_CONNECTION_STRING"))
    .buildClient();

Async Client

import com.azure.data.appconfiguration.ConfigurationAsyncClient;

ConfigurationAsyncClient asyncClient = new ConfigurationClientBuilder()
    .connectionString(connectionString)
    .buildAsyncClient();

With Entra ID (Recommended)

import com.azure.identity.DefaultAzureCredentialBuilder;

ConfigurationClient configClient = new ConfigurationClientBuilder()
    .credential(new DefaultAzureCredentialBuilder().build())
    .endpoint(System.getenv("AZURE_APPCONFIG_ENDPOINT"))
    .buildClient();

Key Concepts

Concept Description
Configuration Setting Key-value pair with optional label
Label Dimension for separating settings (e.g., environments)
Feature Flag Special setting for feature management
Secret Reference Setting pointing to Key Vault secret
Snapshot Point-in-time immutable view of settings

Configuration Setting Operations

Create Setting (Add)

Creates only if setting doesn't exist:

import com.azure.data.appconfiguration.models.ConfigurationSetting;

ConfigurationSetting setting = configClient.addConfigurationSetting(
    "app/database/connection", 
    "Production", 
    "Server=prod.db.com;Database=myapp"
);

Create or Update Setting (Set)

Creates or overwrites:

ConfigurationSetting setting = configClient.setConfigurationSetting(
    "app/cache/enabled", 
    "Production", 
    "true"
);

Get Setting

ConfigurationSetting setting = configClient.getConfigurationSetting(
    "app/database/connection", 
    "Production"
);
System.out.println("Value: " + setting.getValue());
System.out.println("Content-Type: " + setting.getContentType());
System.out.println("Last Modified: " + setting.getLastModified());

Conditional Get (If Changed)

import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;

Response<ConfigurationSetting> response = configClient.getConfigurationSettingWithResponse(
    setting,      // Setting with ETag
    null,         // Accept datetime
    true,         // ifChanged - only fetch if modified
    Context.NONE
);

if (response.getStatusCode() == 304) {
    System.out.println("Setting not modified");
} else {
    ConfigurationSetting updated = response.getValue();
}

Update Setting

ConfigurationSetting updated = configClient.setConfigurationSetting(
    "app/cache/enabled", 
    "Production", 
    "false"
);

Conditional Update (If Unchanged)

// Only update if ETag matches (no concurrent modifications)
Response<ConfigurationSetting> response = configClient.setConfigurationSettingWithResponse(
    setting,     // Setting with current ETag
    true,        // ifUnchanged
    Context.NONE
);

Delete Setting

ConfigurationSetting deleted = configClient.deleteConfigurationSetting(
    "app/cache/enabled", 
    "Production"
);

Conditional Delete


…
よくある質問

「フィーチャーフラグ」とは何ですか?

アプリの一部の機能をオンやオフに切り替えるスイッチのようなものです。新機能を全員に公開する前に、少人数のユーザーでテストするときに役立ちます。

アプリはどの設定を使うか、どうやって判断するのですか?

アプリは特定の場所から設定を取得するようにプログラムされています。「本番」「テスト」などの環境ごとに設定を取得するように指定できます。

パスワードをここに保存しても安全ですか?

はい、Azure App Configurationは、機密情報を安全に管理するために設計された安全なサービスです。

詳細

作者による元の説明

Azure App Configuration SDK for Java. Centralized application configuration management with key-value settings, feature flags, and snapshots.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#3906
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル