Moedim.ACA.Sessions
1.0.0
dotnet add package Moedim.ACA.Sessions --version 1.0.0
NuGet\Install-Package Moedim.ACA.Sessions -Version 1.0.0
<PackageReference Include="Moedim.ACA.Sessions" Version="1.0.0" />
<PackageVersion Include="Moedim.ACA.Sessions" Version="1.0.0" />
<PackageReference Include="Moedim.ACA.Sessions" />
paket add Moedim.ACA.Sessions --version 1.0.0
#r "nuget: Moedim.ACA.Sessions, 1.0.0"
#:package Moedim.ACA.Sessions@1.0.0
#addin nuget:?package=Moedim.ACA.Sessions&version=1.0.0
#tool nuget:?package=Moedim.ACA.Sessions&version=1.0.0
Moedim.ACA.Sessions
The second letter in the Hebrew alphabet is the ב bet/beit. Its meaning is "house". In the ancient pictographic Hebrew it was a symbol resembling a tent on a landscape.
A C# library for Azure Container Apps dynamic sessions - enabling secure, isolated code execution for AI agents and applications.
🚀 Overview
Moedim.ACA.Sessions provides a robust C# wrapper around Azure Container Apps' serverless code interpreter sessions, designed specifically for integration with Agentic AI frameworks where AI agents need to execute code safely and securely. This library enables AI agents to:
- Execute Python code in isolated, sandboxed environments
- Create and manipulate files (including PowerPoint presentations, Excel files, charts, etc.)
- Process data and generate visualizations
- Install and use popular Python packages (NumPy, pandas, matplotlib, etc.)
- Maintain session state across multiple code executions
Hire me
Please send email if you consider to hire me.
Give a Star! ⭐
If you like or are using this project to learn or start your solution, please give it a star. Thanks!
Install
dotnet add package Moedim.ACA.Sessions
Projects
Moedim.ACA.Sessions- actual libraryMoedim.ACA.Sessions.Example- usage
Configuration
appsettings.json
{
"ACASessions": {
"AzureTokenProvider": {
"RefreshBeforeMinutes": 5,
"Scopes": [
"https://dynamicsessions.io/.default"
]
},
"SessionsHttpClient": {
"Endpoint": "https://{region}.dynamicsessions.io/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/sessionPools/{sessionPoolName}",
"ApiVersion": "2024-02-02-preview"
}
}
}
🔐 Authentication
Azure RBAC Requirements Your application needs the following roles on the session pool:
- Azure ContainerApps Session Executor
- Contributor
Using Azure CLI (Development)
az account get-access-token --resource https://dynamicsessions.io
💻 Usage Examples
Basic Code Execution
// Register all ACA Sessions services
services.AddACASessions();
public class DataAnalysisAgent
{
private readonly ICodeInterpreter _codeInterpreter;
public DataAnalysisAgent(ICodeInterpreter codeInterpreter)
{
_codeInterpreter = codeInterpreter;
}
public async Task<string> AnalyzeDataAsync(string csvData, string sessionId)
{
// Upload CSV data
await _codeInterpreter.UploadFileAsync(new FileUploadRequest
{
SessionId = sessionId,
FileName = "data.csv",
FileContent = Encoding.UTF8.GetBytes(csvData)
}, CancellationToken.None);
// Analyze data and create visualization
var analysisCode = """
import pandas as pd
import matplotlib.pyplot as plt
import json
# Load and analyze data
df = pd.read_csv('/mnt/data/data.csv')
# Generate summary statistics
summary = {
'total_rows': len(df),
'columns': list(df.columns),
'numeric_summary': df.describe().to_dict()
}
# Create visualization
plt.figure(figsize=(10, 6))
df.hist(bins=20, figsize=(12, 8))
plt.suptitle('Data Distribution')
plt.tight_layout()
plt.savefig('/mnt/data/analysis_chart.png', dpi=300, bbox_inches='tight')
# Save analysis results
with open('/mnt/data/analysis_results.json', 'w') as f:
json.dump(summary, f, indent=2)
print("Analysis complete!")
print(f"Dataset contains {len(df)} rows and {len(df.columns)} columns")
""";
var result = await _codeInterpreter.ExecuteAsync(new CodeExecutionRequest
{
SessionId = sessionId,
Code = analysisCode,
SanitizeInput = true
}, CancellationToken.None);
return result.ToString();
}
}
References
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Azure.Identity (>= 1.17.0)
- Microsoft.Extensions.Configuration (>= 9.0.9)
- Microsoft.Extensions.DependencyInjection (>= 9.0.9)
- Microsoft.Extensions.Http (>= 9.0.9)
- Microsoft.Extensions.Options (>= 9.0.9)
-
net9.0
- Azure.Identity (>= 1.17.0)
- Microsoft.Extensions.Configuration (>= 9.0.9)
- Microsoft.Extensions.DependencyInjection (>= 9.0.9)
- Microsoft.Extensions.Http (>= 9.0.9)
- Microsoft.Extensions.Options (>= 9.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 218 | 10/16/2025 |
| 1.0.0-preview.30 | 149 | 10/16/2025 |