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
8 changes: 8 additions & 0 deletions src/durabletask/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
Release History
===============

1.0.0b9
+++++++
* Add `az durabletask taskqueue` commands to manage task queues and configure their throughput.
* Add `az durabletask scheduler failover-instance` commands to configure partner schedulers and perform graceful or forced failover.
* Update ARM API version to `2026-07-01-preview` for task hub create, delete, list, show, and wait operations, scheduler restart, and transparent data encryption commands.
* Add `--auto-rotation-enabled` support to scheduler transparent data encryption create and update commands.
* Add Python 3.15 support.

1.0.0b8
+++++
* Update ARM API version to `2026-05-01-preview` for task hub commands.
Expand Down
51 changes: 50 additions & 1 deletion src/durabletask/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ For more information on how to use this service, run the following CLI commands:

` az durabletask scheduler -h `
` az durabletask taskhub -h `
` az durabletask taskqueue -h `
` az durabletask scheduler failover-instance -h `
` az durabletask retention-policy -h `

You can create a scheduler with the following command:
Expand Down Expand Up @@ -43,4 +45,51 @@ Show a retention policy for a particular scheduler:
` az durabletask retention-policy show -g <resource-group-name> --scheduler-name <scheduler-name> `

Delete a retention policy for a particular scheduler:
` az durabletask retention-policy delete -g <resource-group-name> --scheduler-name <scheduler-name> `
` az durabletask retention-policy delete -g <resource-group-name> --scheduler-name <scheduler-name> `

## Task queues ##

These examples assume the scheduler and task hub already exist. Replace the sample names with your resource names.
Taskqueue commands use `-t` or `--taskhub-name` to select the task hub.

Create a task queue with a throughput of 100 actions per second:
` az durabletask taskqueue create -g myResourceGroup -s myScheduler -t myTaskHub -n myTaskQueue --actions-per-second 100 `

Update the task queue throughput to 200 actions per second:
` az durabletask taskqueue update -g myResourceGroup -s myScheduler -t myTaskHub -n myTaskQueue --actions-per-second 200 `

List task queues in a task hub:
` az durabletask taskqueue list -g myResourceGroup -s myScheduler -t myTaskHub `

Show a task queue:
` az durabletask taskqueue show -g myResourceGroup -s myScheduler -t myTaskHub -n myTaskQueue `

Delete a task queue:
` az durabletask taskqueue delete -g myResourceGroup -s myScheduler -t myTaskHub -n myTaskQueue `

## Scheduler failover instances ##

These examples assume the schedulers already exist. Replace the sample resource ID with the resource ID of your partner scheduler.

Create a failover instance with a partner scheduler:
` az durabletask scheduler failover-instance create -g myResourceGroup -s myScheduler --partner-scheduler-resource-id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myPartnerResourceGroup/providers/Microsoft.DurableTask/schedulers/myPartnerScheduler `

Update the partner scheduler for a failover instance:
` az durabletask scheduler failover-instance update -g myResourceGroup -s myScheduler --partner-scheduler-resource-id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myPartnerResourceGroup/providers/Microsoft.DurableTask/schedulers/myNewPartnerScheduler `

Show the failover configuration:
` az durabletask scheduler failover-instance show -g myResourceGroup -s myScheduler `

Trigger a graceful failover for a scheduler:
` az durabletask scheduler failover-instance failover -g myResourceGroup -s myScheduler `

**Warning:** Forced failover can cause data loss. Use the following command only when you accept that risk:
` az durabletask scheduler failover-instance force-failover-allow-data-loss -g myResourceGroup -s myScheduler `

## Scheduler restart and encryption ##

Restart a scheduler:
` az durabletask scheduler restart -g myResourceGroup -n myScheduler `

Enable automatic rotation of customer-managed encryption keys on an existing encryption configuration:
` az durabletask scheduler transparent-data-encryption update -g myResourceGroup --scheduler-name myScheduler --auto-rotation-enabled true `
8 changes: 0 additions & 8 deletions src/durabletask/azext_durabletask/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,3 @@ def load_arguments(self, _): # pylint: disable=unused-argument
c.argument('identity', options_list=['--identity'],
help='Resource ID of a user-assigned managed identity. '
'If omitted, the system-assigned managed identity is used.')

with self.argument_context('durabletask scheduler restart') as c:
c.argument('resource_group_name', options_list=['--resource-group', '-g'],
help='Name of the resource group containing the scheduler.',
required=True)
c.argument('scheduler_name', options_list=['--name', '-n'],
help='Name of the Durable Task scheduler.',
required=True)
36 changes: 0 additions & 36 deletions src/durabletask/azext_durabletask/_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import logging
logger = logging.getLogger(__name__)

API_VERSION = "2026-05-01-preview"

RESOURCE_TYPE_MAP = {
"microsoft.web/sites": "functionapp",
"microsoft.app/containerapps": "containerapp",
Expand Down Expand Up @@ -577,37 +575,3 @@ def attach_scheduler(cmd, resource_group_name, scheduler_name, task_hub_name, #
result["identityResourceId"] = identity
result["identityClientId"] = client_id
return result


def restart_scheduler(cmd, resource_group_name, scheduler_name):
"""Restart a Durable Task scheduler by calling POST /restart on the resource."""
from azure.cli.core.util import send_raw_request

cli_ctx = cmd.cli_ctx

# Retrieve the scheduler to validate it exists and get its resource ID.
logger.info("Retrieving scheduler '%s' in resource group '%s'...",
scheduler_name, resource_group_name)
scheduler = _SchedulerShow(cli_ctx=cli_ctx)(command_args={
"resource_group": resource_group_name,
"name": scheduler_name,
})
scheduler_id = scheduler.get("id")
if not scheduler_id:
raise ResourceNotFoundError(
f"Scheduler '{scheduler_name}' not found in resource group "
f"'{resource_group_name}'. Please verify the name and resource group."
)

arm_endpoint = cli_ctx.cloud.endpoints.resource_manager.rstrip('/')
url = f"{arm_endpoint}{scheduler_id}/restart?api-version={API_VERSION}"

logger.info("Restarting scheduler '%s'...", scheduler_name)
send_raw_request(cli_ctx, 'POST', url)
logger.info("Scheduler '%s' restart initiated successfully.", scheduler_name)

return {
"schedulerName": scheduler_name,
"resourceGroupName": resource_group_name,
"status": "Restart initiated",
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from ._create import *
from ._delete import *
from ._list import *
from ._restart import *
from ._show import *
from ._update import *
from ._wait import *
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from azure.cli.core.aaz import *


@register_command(
"durabletask scheduler restart",
)
Comment thread
berndverst marked this conversation as resolved.
class Restart(AAZCommand):
"""Restart a Scheduler

:example: Restart a scheduler
az durabletask scheduler restart --resource-group myResourceGroup --scheduler-name myScheduler
"""

_aaz_info = {
"version": "2026-07-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.durabletask/schedulers/{}/restart", "2026-07-01-preview"],
]
}

def _handler(self, command_args):
super()._handler(command_args)
self._execute_operations()
return None

_args_schema = None

@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
if cls._args_schema is not None:
return cls._args_schema
cls._args_schema = super()._build_arguments_schema(*args, **kwargs)

# define Arg Group ""

_args_schema = cls._args_schema
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
_args_schema.scheduler_name = AAZStrArg(
options=["-n", "--name", "--scheduler-name"],
help="The name of the Scheduler",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,64}$",
),
)
return cls._args_schema

def _execute_operations(self):
self.pre_operations()
self.SchedulersRestart(ctx=self.ctx)()
self.post_operations()

@register_callback
def pre_operations(self):
pass

@register_callback
def post_operations(self):
pass

class SchedulersRestart(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(request=request, stream=False, **kwargs)
if session.http_response.status_code in [204]:
return self.on_204(session)

return self.on_error(session.http_response)

@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/restart",
**self.url_parameters
)

@property
def method(self):
return "POST"

@property
def error_format(self):
return "MgmtErrorFormat"

@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"schedulerName", self.ctx.args.scheduler_name,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
}
return parameters

@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2026-07-01-preview",
required=True,
),
}
return parameters

def on_204(self, session):
pass


class _RestartHelper:
"""Helper class for Restart"""


__all__ = ["Restart"]
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
)
class Update(AAZCommand):
"""Update a Scheduler

:example: Update a scheduler's IP allowlist and tags
az durabletask scheduler update --resource-group testrg --name testscheduler --ip-allowlist "[0.0.0.0/0]" --tags "{department:research}"

:example: Update a scheduler to disable public network access
az durabletask scheduler update --resource-group testrg --name testscheduler --public-network-access Disabled
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from azure.cli.core.aaz import *


@register_command_group(
"durabletask scheduler failover-instance",
)
class __CMDGroup(AAZCommandGroup):
"""Manage Failover Instance
"""
pass


__all__ = ["__CMDGroup"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from .__cmd_group import *
from ._create import *
from ._delete import *
from ._failover import *
from ._force_failover_allow_data_loss import *
from ._show import *
from ._update import *
from ._wait import *
Loading
Loading