R interface to VM instance metadata
Перейти к файлу
microsoft-github-policy-service[bot] 8af9e1ccc0
Auto merge mandatory file pr
This pr is auto merged as it contains a mandatory file and is opened for more than 10 days.
2023-03-28 16:44:30 +00:00
.github/workflows switch to Github Actions, change maintainer email 2020-10-15 01:55:44 +11:00
R doc pass 2019-08-23 10:59:26 +10:00
man doc pass 2019-08-23 10:59:26 +10:00
.Rbuildignore switch to Github Actions, change maintainer email 2020-10-15 01:55:44 +11:00
.gitignore ignores 2019-08-03 15:54:24 +10:00
CODE_OF_CONDUCT.md Initial commit 2019-08-02 22:20:32 -07:00
CONTRIBUTING.md 1st code commit 2019-08-03 17:35:15 +10:00
DESCRIPTION bump to dev version 2021-01-13 05:53:36 +11:00
LICENSE license -> license.md for CRAN 2019-08-03 15:52:48 +10:00
LICENSE.md license -> license.md for CRAN 2019-08-03 15:52:48 +10:00
NAMESPACE more updating 2019-08-03 18:48:43 +10:00
README.md fix badge url 2020-10-15 01:56:56 +11:00
SECURITY.md Microsoft mandatory file 2023-01-24 16:00:33 +00:00

README.md

AzureVMmetadata

CRAN Downloads R-CMD-check

A simple package to access the instance metadata service in an Azure virtual machine.

The primary repo for this package is at https://github.com/Azure/AzureVMmetadata; please submit issues and PRs there. It is also mirrored at the Cloudyr org at https://github.com/cloudyr/AzureVMmetadata. You can install the development version of the package from GitHub:

devtools::install_github("Azure/AzureVMmetadata")

Accessing metadata

AzureVMmetadata exposes three environments that contain the metadata for the VM:

  • instance: The instance metadata, containing 2 components: compute and network
  • attested: The attested metadata, containing the base64-encoded PKCS-7 certificate for the VM
  • events: The scheduled events for the VM

The first two are automatically populated when the package is loaded; you can also manually update them with the update_instance_metadata() and update_attested_metadata() functions. events is not populated at package startup (it causes the event scheduler service to be started on the VM, which can take up to several minutes), but you can update it manually with update_scheduled_events().

## these will only be meaningful when run in an Azure VM

# all compute metadata
AzureVMmetadata::instance$compute

# VM name and ID
AzureVMmetadata::instance$compute$name
AzureVMmetadata::instance$compute$vmId

# VM resource details: subscription, resource group, ID
AzureVMmetadata::instance$compute$subscriptionId
AzureVMmetadata::instance$compute$resourceGroupName
AzureVMmetadata::instance$compute$resourceId

# all network metadata
AzureVMmetadata::instance$network

# IPv4 address details (1st network interface)
AzureVMmetadata::instance$network$interface[[1]]$ipv4

# raw PKCS-7 certificate for the VM
AzureVMmetadata::attested$signature

# certificate as an openssl::cert object
AzureVMmetadata::get_vm_cert()