in_azure_vm {AzureVMmetadata} | R Documentation |
Check if R is running in an Azure VM
in_azure_vm() get_vm_cert(nonce = NULL)
nonce |
An optional string to use as a nonce. |
These functions check if R is running in an Azure VM by attempting to contact the instance metadata host. in_azure_vm
simply returns TRUE or FALSE based on whether it succeeds. get_vm_cert
provides a stronger check, by retrieving the VM's certificate and throwing an error if this is not found. Note that you should still verify the certificate's authenticity before relying on it.
For in_azure_vm
, a boolean. For get_vm_cert
, a PKCS-7 certificate object.