Skip to content

no-resource-delete-operation

-
@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation

Every ARM resource that provides a create operation must also provide a delete operation.

@armResourceOperations
interface EmployeeOperations {
createOrUpdate is ArmResourceCreateOrReplaceAsync<Employee>;
}
@armResourceOperations
interface EmployeeOperations {
createOrUpdate is ArmResourceCreateOrReplaceAsync<Employee>;
delete is ArmResourceDeleteWithoutOkAsync<Store>; // delete operation for a different resource
}
@armResourceOperations
interface EmployeeOperations {
createOrUpdate is ArmResourceCreateOrReplaceAsync<Employee>;
delete is ArmResourceDeleteWithoutOkAsync<Employee>;
}

Impacts the API: this corresponds to the LintDiff rule AllTrackedResourcesMustHaveDelete and causes an RPC violation. Ask the author to add a standard delete operation for the resource. Accept a suppression only when allowed by RPC guidelines.