The preferred way for exporting telemetry is using the Diagnostic Settings.
Continuous export has been deprecated and is only supported for classic Application Insights resources. Workspace-based Application Insights resources must use diagnostic settings.
Alternatively, you can use Application Insights REST API to build custom solutions.