If your dependency needs a full installation then a VM will likely be the simplest option.
Another option could be containerisation;
Assuming the application is a windows app, I'd suggest looking at Web App for Containers.
This provides more flexibility around the environment for your API.
Eg, in your Dockerfile - you can initiate a silent install of an application with PowerShell.
SHELL ["powershell"]
RUN powershell $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'; rm .\AzureCLI.msi