AzureKeyVault (version 1.0.0)

create_key_vault: Create Azure key vault

Description

Method for the AzureRMR::az_resource_group class.

Value

An object of class az_key_vault representing the created key vault.

Usage

create_key_vault(name, location = self$location, initial_access = default_access(),
                 sku = "Standard", ..., wait = TRUE)

Arguments

  • name: The name of the key vault.

  • location: The location/region in which to create the account. Defaults to the resource group location.

  • initial_access: The user or service principals that will have access to the vault. This should be a list of objects of type [vault_access_policy], created by the function of the same name. The default is to grant access to the logged-in user or service principal of the current Resource Manager client.

  • sku: The sku for the vault. Set this to "Premium" to enable the use of hardware security modules (HSMs).

  • ...: Other named arguments to pass to the az_key_vault initialization function.

  • wait: Whether to wait for the resource creation to complete before returning.

Details

This method deploys a new key vault resource, with parameters given by the arguments. A key vault is a secure facility for storing and managing encryption keys, certificates, storage account keys, and generic secrets.

A new key vault will have access granted to the user or service principal used to sign in to the Azure Resource Manager client. To manage access policies after creation, use the add_principal, list_principals and remove_principal methods of the key vault object.

See Also

get_key_vault, delete_key_vault, az_key_vault, vault_access_policy

Azure Key Vault documentation, Azure Key Vault API reference

Examples

Run this code
# NOT RUN {
rg <- AzureRMR::get_azure_login()$
    get_subscription("subscription_id")$
    get_resource_group("rgname")

# create a new key vault
rg$create_key_vault("mykeyvault")

# create a new key vault, and grant access to a service principal
gr <- AzureGraph::get_graph_login()
svc <- gr$get_service_principal("app_id")
rg$create_key_vault("mykeyvault",
    initial_access=list(vault_access_policy(svc, tenant=NULL)))

# }

Run the code above in your browser using DataLab