Deploying a new instance with a GPU can be an incredible challenge.
First, go to the Azure Pricing site to see which instances are the ones you may want to use. In my case, I found that NCas v3 T4 spot instances were available for $0.06 an hour which is perfect for a BOINC node.
Second, go to the GPU manufacturer to verify which operating systems were compatible. In my case, the GPU has an Nvidia T4 which is is similar in performance to half of an RTX 3070. For a BOINC node that will do nothing else, Linux is easier than windows. The reason is that if you run BOINC in Windows, you cannot use a GPU until you login to the instance. With my choice of using SPOT instances to spin up and down automatically, this would be a problem so I chose Linux. For the T4, Ubuntu is the only Linux OS that Nvidia lists.
Third, when creating the instance in Azure, be sure to NOT specify the Trusted platform. The reason is that the Nvidia drivers cannot be installed in a secure boot environment unless you can directly interact with the virtualized BIOS boot screen.
Fourth, add the GPU extension to be installed during setup.
Fifth, on the Review and Create screen, verify that the Secure Boot option is not listed!
After the new virtual machine is running, these are the steps to install BOINC and configure it for remote monitoring:
sudo apt-get install boinc-client boinc-virtualbox
You will be prompted to read and accept the Oracle license agreement for boinc-virtualbox
sudo systemctl enable boinc-client
sudo systemctl start boinc-client
boinccmd --acct_mgr attach http://bam.boincstats.com/ youruserid yourpassword
If you have BOINC manager installed on your workstation, add an inbound rule to allow connectivity from your IP address to your hosted Azure instance on port 31416
On the instance, use the command sudo /etc/boinc-client/remote_hosts.cfg ; once in the editor, add your IP address
From within BOINC manager, under the File menu choose select computer, specify the public IP address of the instance and click OK