Skip to main content
Version: Latest (Core: 0.57.x, Azure: 0.43.x)

delete-operation-response-codes

@azure-tools/typespec-azure-resource-manager/delete-operation-response-codes

Synchronous

Synchronous delete operations should use the ArmResourceDeleteSync template. They must have 200, 204, default and no other responses.

❌ Incorrect

@armResourceOperations
interface Employees {
@armResourceDelete(Employee)
delete(...ApiVersionParameter): {
@statusCode _: 200;
result: boolean;
};
}

✅ Correct

@armResourceOperations
interface Employees {
delete is ArmResourceDeleteSync<Employee>;
}

Asynchronous

Long-running (LRO) delete operations should use the ArmResourceDeleteWithoutOkAsync template. They must have 202, 204, default, and no other responses.

❌ Incorrect

@armResourceOperations
interface Employees {
delete is ArmResourceDeleteAsync<Employee>;
}

✅ Correct

@armResourceOperations
interface Employees {
delete is ArmResourceDeleteWithoutOkAsync<Employee>;
}