azure-resource-manager-durabletask-dotnet – DevOps & Infrastructure skill for AI agents
Azure Resource Manager SDK for Durable Task Scheduler in .NET.
Install the azure-resource-manager-durabletask-dotnet skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-resource-manager-durabletask-dotne-45d11.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /azure-resource-manager-durabletask-dotnet – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-resource-manager-durabletask-dotne-45d11.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $azure-resource-manager-durabletask-dotnet – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-resource-manager-durabletask-dotne-45d11.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /azure-resource-manager-durabletask-dotnet – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-resource-manager-durabletask-dotne-45d11.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /azure-resource-manager-durabletask-dotnet – then describe the task you want done.
SKILL.md content
Azure.ResourceManager.DurableTask (.NET)
Management plane SDK for provisioning and managing Azure Durable Task Scheduler resources via Azure Resource Manager.
> ⚠️ Management vs Data Plane
> - This SDK (Azure.ResourceManager.DurableTask): Create schedulers, task hubs, configure retention policies
> - Data Plane SDK (Microsoft.DurableTask.Client.AzureManaged): Start orchestrations, query instances, send events
Installation
dotnet add package Azure.ResourceManager.DurableTask
dotnet add package Azure.IdentityThese snippets target the historical 1.0 API shape; they are not a claim about the latest version. Pin a reviewed package version and check its generated types and API version against [Microsoft's SDK reference](https://learn.microsoft.com/en-us/dotnet/api/azure.resourcemanager.durabletask.durabletaskschedulerresource?view=azure-dotnet) before adapting the examples.
Environment Variables
AZURE_SUBSCRIPTION_ID=<your-subscription-id>
AZURE_RESOURCE_GROUP=<your-resource-group>
# For service principal auth (optional)
AZURE_TENANT_ID=<tenant-id>
AZURE_CLIENT_ID=<client-id>
AZURE_CLIENT_SECRET=<client-secret>Authentication
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.DurableTask;
// Always use DefaultAzureCredential
var credential = new DefaultAzureCredential();
var armClient = new ArmClient(credential);
// Get subscription
var subscriptionId = Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID");
var subscription = armClient.GetSubscriptionResource(
new ResourceIdentifier($"/subscriptions/{subscriptionId}"));Resource Hierarchy
ArmClient
└── SubscriptionResource
└── ResourceGroupResource
└── DurableTaskSchedulerResource
├── DurableTaskHubResource
└── DurableTaskRetentionPolicyResourceCore Workflow
1. Create Durable Task Scheduler
using Azure.ResourceManager.DurableTask;
using Azure.ResourceManager.DurableTask.Models;
// Get resource group
var resourceGroup = await subscription
.GetResourceGroupAsync("my-resource-group");
// Define scheduler with Dedicated SKU
var schedulerData = new DurableTaskSchedulerData(AzureLocation.EastUS)
{
Properties = new DurableTaskSchedulerProperties
{
Sku = new DurableTaskSchedulerSku(DurableTaskSchedulerSkuName.Dedicated)
{
Capacity = 1 // Number of instances
},
// Optional: IP allowlist for network security
IPAllowlist = { "10.0.0.0/24", "192.168.1.0/24" }
}
};
// Create scheduler (long-running operation)
var schedulerCollection = resourceGroup.Value.GetDurableTaskSchedulers();
var operation = await schedulerCollection.CreateOrUpdateAsync(
WaitUntil.Completed,
"my-scheduler",
schedulerData);
DurableTaskSchedulerResource scheduler = operation.Value;
Console.WriteLine($"Scheduler created: {scheduler.Data.Name}");
Console.WriteLine($"Endpoint: {scheduler.Data.Properties.Endpoint}");2. Create Scheduler with Consumption SKU
// Consumption SKU (serverless)
var consumptionSchedulerData = new DurableTaskSchedulerData(AzureLocation.EastUS)
{
Properties = new DurableTaskSchedulerProperties
{
Sku = new DurableTaskSchedulerSku(DurableTaskSchedulerSkuName.Consumption)
// No capacity needed for consumption
}
};
var operation = await schedulerCollection.CreateOrUpdateAsync(
WaitUntil.Completed,
"my-serverless-scheduler",
consumptionSchedulerData);3. Create Task Hub
// Task hubs are created under a scheduler
var taskHubData = new DurableTaskHubData
{
// Properties are optional for basic task hub
};
var taskHubCollection = scheduler.GetDurableTaskHubs();
var hubOperation = await taskHubCollection.CreateOrUpdateAsync(
WaitUntil.Completed,
"my-taskhub",
taskHubData);
DurableTaskHubResource taskHub = hubOperation.Value;
Console.WriteLine($"Task Hub created: {taskHub.Data.Name}");4. List Schedulers
// List all schedulers in subscription
await foreach (var sched in subscription.GetDurableTaskSchedulersAsync())
{
Console.WriteLine($"Scheduler: {sched.Data.Name}");
Console.WriteLine($" Location: {sched.Data.Location}");
Console.WriteLine($" SKU: {sched.Data.Properties.Sku?.Name}");
Console.WriteLine($" Endpoint: {sched.Data.Properties.Endpoint}");
}
// List schedulers in resource group
var schedulers = resourceGroup.Value.GetDurableTaskSchedulers();
await foreach (var sched in schedulers.GetAllAsync())
{
Console.WriteLine($"Scheduler: {sched.Data.Name}");
}5. Get Scheduler by Name
// Get existing scheduler
var existingScheduler = await schedulerCollection.GetAsync("my-scheduler");
Console.WriteLine($"Found: {existingScheduler.Value.Data.Name}");
// Or use extension method
var schedulerResource = armClient.GetDurableTaskSchedulerResource(
DurableTaskSchedulerResource.CreateResourceIdentifier(
subscriptionId,
"my-resource-group",
"my-scheduler"));
var scheduler = await schedulerResource.GetAsync();6. Update Scheduler
// Get current scheduler
var scheduler = await schedulerCollection.GetAsync("my-scheduler");
// Update with new configuration
var updateData = new DurableTaskSchedulerData(scheduler.Value.Data.Location)
{
Properties = new DurableTaskSchedulerProperties
{
Sku = new DurableTaskSchedulerSku(DurableTaskSchedulerSkuName.Dedicated)
{
Capacity = 2 // Scale up
},
IPAllowlist = { "10.0.0.0/16" } // Update IP allowlist
}
};
var updateOperation = await schedulerCollection.CreateOrUpdateAsync(
WaitUntil.Completed,
"my-scheduler",
updateData);7. Delete Resources
// Delete task hub first
var taskHub = await scheduler.GetDurableTaskHubs().GetAsync("my-taskhub");
await taskHub.Value.DeleteAsync(WaitUntil.Completed);
// Then delete scheduler
await scheduler.DeleteAsync(WaitUntil.Completed);8. Manage Retention Policies
// Get retention policy collection
var retentionPolicies = scheduler.GetDurableTaskRetentionPolicies();
// Create or update retention policy
var retentionData = new DurableTaskRetentionPolicyData
{
Properties = new DurableTaskRetentionPolicyProperties
{
// Configure retention settings
}
};
var retentionOperation = await retentionPolicies.CreateOrUpdateAsync(
WaitUntil.Completed,
"default", // Policy name
retentionData);Key Types Reference
| Type | Purpose |
|------|---------|
| ArmClient | Entry point for all ARM operations |
| DurableTaskSchedulerResource | Represents a Durable Task Scheduler |
| DurableTaskSchedulerCollection | Collection for scheduler CRUD |
| DurableTaskSchedulerData | Scheduler creation/update payload |
| DurableTaskSchedulerProperties | Scheduler configuration (SKU, IPAllowlist) |
| DurableTaskSchedulerSku | SKU configuration (Name, Capacity, RedundancyState) |
| DurableTaskSchedulerSkuName | SKU options: Dedicated, Consumption |
| DurableTaskHubResource | Represents a Task Hub |
| DurableTaskHubCollection | Collection for task hub CRUD |
| DurableTaskHubData | Task hub creation payload |
| DurableTaskRetentionPolicyResource | Retention policy management |
| DurableTaskRetentionPolicyData | Retention policy configuration |
| DurableTaskExtensions | Extension methods for ARM client |
SKU Options
| SKU | Description | Use Case |
|-----|-------------|----------|
| Dedicated | Fixed capacity with configurable instances | Production workloads, predictable performance |
| Consumption | Serverless, auto-scaling | Development, variable workloads |
Extension Methods
The SDK provides extension methods on SubscriptionResource and ResourceGroupResource:
// On SubscriptionResource
subscription.GetDurableTaskSchedulers(); // List all in subscription
subscription.GetDurableTaskSchedulersAsync(); // Async enumerable
// On ResourceGroupResource
resourceGroup.GetDurableTaskSchedulers(); // Get collection
resourceGroup.GetDurableTaskSchedulerAsync(name); // Get by name
// On ArmClient
armClient.GetDurableTaskSchedulerResource(id); // Get by resource ID
armClient.GetDurableTaskHubResource(id); // Get task hub by IDBest Practices
1. Use WaitUntil.Completed for operations that must finish before proceeding
2. Use WaitUntil.Started when you want to poll manually or run operations in parallel
3. Always use DefaultAzureCredential — never hardcode keys
4. Handle RequestFailedException for ARM API errors
5. Use CreateOrUpdateAsync for idempotent operations
6. Delete task hubs before schedulers — schedulers with task hubs cannot be deleted
7. Use IP allowlists for network security in production
Error Handling
using Azure;… (full content is in the download package)
Related skills
- azure-resource-manager-mysql-dotnet – Azure MySQL Flexible Server SDK for .NET. Database management for MySQL Flexible Server…
- azure-resource-manager-playwright-dotnet – Azure Resource Manager SDK for Microsoft Playwright Testing in .NET.
- azure-resource-manager-redis-dotnet – Azure Resource Manager SDK for Redis in .NET.
- azure-resource-manager-sql-dotnet – Azure Resource Manager SDK for Azure SQL in .NET.
- azure-search-documents-dotnet – Azure AI Search SDK for .NET (Azure.Search.Documents). Use for building search…
- azure-search-documents-py – Azure AI Search SDK for Python. Use for vector search, hybrid search, semantic ranking…
- azure-search-documents-ts – Build search applications with vector, hybrid, and semantic search capabilities.
- azure-security-keyvault-keys-dotnet – Azure Key Vault Keys SDK for .NET. Client library for managing cryptographic keys in…