@PawelDrzyzga-5087, For the connection of the VPN when the application is running in the background. It depends on the app action in the background on iOS and how the VPN works. For example, if the app is running in the background, will it be considered as connecting? Is the VPN thought the connection is on or consider it on-demand and close it and etc. We suggest to contact VPN developer and Apple support to double confirm on this,
https://developer.apple.com/documentation/networkextension/personal_vpn/vpn_on_demand_rules
Note: non-Microsoft link, just for the reference.
Hope it can help.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.