The Web API in PI was designed to be the superior method to succeed other legacy protocols. Are we just sticking to the old solutions and stay away from modern ones because no one was able to make it work?
OPC UA is by no means a legacy protocol, and OSI/AVEVA actively maintain the connector, and they actively develop new features (albeit slowly) for the adapter. PI Web API was largely meant as a replacement for legacy PI API and as an alternative to directly using PI AFSDK. It allows PI developers to deploy lightweight/cross-platform http clients instead of depending directly on large Windows only libraries. It was not meant to replace interfaces/connectors/adapters.
If you're wanting to move data from Ignition to PI, and that data can be accessed with OPC UA, you are probably better off starting with PI Adapter for OPC UA (which will send OMF data to PI Web API). If you run into some issue, you could probably augment your solution with some custom PI Web API apps if needed, but the adapter is going to be your best starting point for getting tag data to PI. (& If you need history, consider the RDBMS adapter)
As for the OPC-UA, from my research, it seems to be clunky and not an ideal production solution.
Do you mean OPC UA in general, or specifically the AVEVA/OSI/PI Adapter or connector? If the former, I think you're simply mistaken, as OPC UA is industry standard for system interoperation. I'm pretty familiar with the AVEVA Adapter for OPC UA, I'll be the first to say it certainly has some issues, but for simple data ingress to PI, I think you should start there.
If a Web API request is sent for each single value, it won't be efficient for sure. However, if the values are sent in bulk, I trust that it shall be much more efficient than other methods. Just similar to grouping data in MQTT packets.
I don't doubt that you could be nearly as efficient as the adapter, but when performance testing the OPC UA adapter, PI Web API is the bottleneck. This is why I asked what scale you're looking for. If you're trying to push data more than the adapter can, you have too high of an expectation for PI Web API. AVEVA advertises that the adapter can do 50,000 events per second (I'm very skeptic of this number).
Would you mind elaborating more on this:
The hyperlink in that text you screenshotted is a link to the PI Web API documentation that explains the authentication methods and how to configure them within your AF database. There's a section in there about "Other Security Settings" that explains CSRF and other issues. OSI/AVEVA used to have some working examples in a few scripting languages of how to use PI Web API, I would start with getting one of those to work, then work on moving that to Ignition. This way you can isolate issues connecting to PI Web API, and work with AVEVA support to resolve them. I'm happy to help as much as I can with PI Web API, but during my time at OSIsoft and AVEVA, I always had the security settings turned off in my local dev instance, and I don't remember all the specifics to getting it configured "correctly."
Which username and password to be used since Active Directory is used for authentication? Or is it just a dedicated account that is configured to access PI?
If I remember correctly, this would be the credentials for the AD account that has access to PI. Remember there are several places where access needs to be given to this user within a PI System ( PI Data Archive, PI Asset Framework, and PI Web API each have their own authorization settings, I think)
Wouldn't having the username and password as text create risk?
Yes. If you're using HTTPS, then the password is at least encrypted, however. AVEVA recommends using Bearer authentication.
For now I'm trying to send but I want to succeed doing both.
If you can share more info about your overall use case, including deployment architecture, tag counts, event counts, etc. I can try to list a few options for you.
I worked as a developer at OSIsoft/AVEVA for around 7 years before I started at Inductive Automation last year.