How to add custom button on sales order view admin page Magento 2?

Add Custom Button on Sales Order View Page on the admin panel toolbar Magento to add extra features to the order view page.

Using Button, You can add URL to redirect to another page with your custom requirement.

To add a custom button, you need to create before plugin for the PushButtons() method from the Magento\Backend\Block\Widget\Button\Toolbar class.

Create di.xml file under the adminhtml scope,
Path: app/code/Jesadiya/OrderViewButton/etc/adminhtml/di.xml

Path: app/code/Jesadiya/OrderViewButton/Plugin/Block/Widget/Button/ToolbarPlugin.php

This is the plugin we made to add toolbar button on order view page, We are checking for the layout of sales_order_edit, if the layout is correct, we will add a button to the toolbar.

sales_order_edit is the layout responsible for the Render Content on the Order View Page.

Sales order toolbar admin panel
Sales Order Custom button on Toolbar

When you click on the My Button, It will be redirected to the given URL.

You can add the same button with Invoice, Shipping View Toolbar also using comparing layout of the respective page.

You can add a custom tab in Sales Order View by, Add tab in Admin Order view page.