app_configuration_kv_write
Use this tool to write or update key-value pairs in Azure App Configuration, including optional labels and content types, enabling efficient configuration management.
Instructions
Write or update a key-value in Azure App Configuration
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content_type | No | Content type of the value (optional, e.g. 'application/json') | |
| key | Yes | The key to write | |
| label | No | The label for the key-value (optional) | |
| value | Yes | The value to store |
Implementation Reference
- mcp_server_azure/azure_server.py:364-387 (handler)Handler implementation for app_configuration_kv_write tool: creates a ConfigurationSetting with provided key, value, optional label and content_type, then uses app_config_client.set_configuration_setting to write or update it in Azure App Configuration, and formats the result.elif name == "app_configuration_kv_write": from azure.appconfiguration import ConfigurationSetting # Create a configuration setting setting = ConfigurationSetting( key=arguments["key"], value=arguments["value"], label=arguments.get("label", None), content_type=arguments.get("content_type", None) ) # Set or update the configuration setting result = app_config_client.set_configuration_setting(setting) # Format result for display response = { "key": result.key, "value": result.value, "content_type": result.content_type, "label": result.label, "etag": result.etag, "last_modified": result.last_modified.isoformat() if result.last_modified else None }
- Input schema definition for the app_configuration_kv_write tool, specifying required key and value, optional label and content_type.Tool( name="app_configuration_kv_write", description="Write or update a key-value in Azure App Configuration", inputSchema={ "type": "object", "properties": { "key": { "type": "string", "description": "The key to write", }, "value": { "type": "string", "description": "The value to store", }, "label": { "type": "string", "description": "The label for the key-value (optional)", }, "content_type": { "type": "string", "description": "Content type of the value (optional, e.g. 'application/json')", }, }, "required": ["key", "value"], }, ),
- mcp_server_azure/azure_server.py:172-176 (registration)Tool registration via @server.list_tools() decorator, which returns get_azure_tools() including the app_configuration_kv_write tool.async def list_tools() -> list[Tool]: """List available Azure tools""" logger.debug("Handling list_tools request") return get_azure_tools() # Use get_azure_tools
- mcp_server_azure/azure_tools.py:330-375 (registration)Function defining the list of App Configuration tools, including app_configuration_kv_write, returned by get_azure_tools() for server registration.def get_app_configuration_tools() -> list[Tool]: return [ Tool( name="app_configuration_kv_read", description="Read key-values from Azure App Configuration", inputSchema={ "type": "object", "properties": { "key": { "type": "string", "description": "The key to read (optional, use * for wildcards, e.g. 'app1/*')", }, "label": { "type": "string", "description": "The label filter (optional, use '\\0' for no label, '*' for any label)", }, }, "required": [], }, ), Tool( name="app_configuration_kv_write", description="Write or update a key-value in Azure App Configuration", inputSchema={ "type": "object", "properties": { "key": { "type": "string", "description": "The key to write", }, "value": { "type": "string", "description": "The value to store", }, "label": { "type": "string", "description": "The label for the key-value (optional)", }, "content_type": { "type": "string", "description": "Content type of the value (optional, e.g. 'application/json')", }, }, "required": ["key", "value"], }, ),