az_subscription {AzureRMR}R Documentation

Azure subscription class

Description

Class representing an Azure subscription.

Format

An R6 object of class az_subscription.

Methods

Details

Generally, the easiest way to create a subscription object is via the get_subscription or list_subscriptions methods of the az_rm class. To create a subscription object in isolation, call the new() method and supply an Oauth 2.0 token of class AzureToken, along with the ID of the subscription.

Operations

The do_operation() method allows you to carry out arbitrary operations on the subscription. It takes the following arguments:

Consult the Azure documentation for what operations are supported.

Role-based access control

AzureRMR implements a subset of the full RBAC functionality within Azure Active Directory. You can retrieve role definitions and add and remove role assignments, at the subscription, resource group and resource levels. See rbac for more information.

See Also

Azure Resource Manager overview

For role-based access control methods, see rbac

For management locks, see lock

Examples

## Not run: 

# recommended way to retrieve a subscription object
sub <- get_azure_login("myaadtenant")$
    get_subscription("subscription_id")

# retrieve list of resource group objects under this subscription
sub$list_resource_groups()

# get a resource group
sub$get_resource_group("rgname")

# check if a resource group exists, and if not, create it
rg_exists <- sub$resource_group_exists("rgname")
if(!rg_exists)
    sub$create_resource_group("rgname", location="australiaeast")

# delete a resource group
sub$delete_resource_group("rgname")

# get provider API versions for some resource types
sub$get_provider_api_version("Microsoft.Compute", "virtualMachines")
sub$get_provider_api_version("Microsoft.Storage", "storageAccounts")


## End(Not run)

[Package AzureRMR version 2.4.4 Index]