View source: R/client_endpoint.R
storage_endpoint | R Documentation |
Create a storage endpoint object, for interacting with blob, file, table, queue or ADLSgen2 storage.
storage_endpoint(endpoint, key = NULL, token = NULL, sas = NULL, api_version, service) blob_endpoint(endpoint, key = NULL, token = NULL, sas = NULL, api_version = getOption("azure_storage_api_version")) file_endpoint(endpoint, key = NULL, token = NULL, sas = NULL, api_version = getOption("azure_storage_api_version")) adls_endpoint(endpoint, key = NULL, token = NULL, sas = NULL, api_version = getOption("azure_storage_api_version")) ## S3 method for class 'storage_endpoint' print(x, ...) ## S3 method for class 'adls_endpoint' print(x, ...)
endpoint |
The URL (hostname) for the endpoint. This must be of the form |
key |
The access key for the storage account. |
token |
An Azure Active Directory (AAD) authentication token. This can be either a string, or an object of class AzureToken created by AzureRMR::get_azure_token. The latter is the recommended way of doing it, as it allows for automatic refreshing of expired tokens. |
sas |
A shared access signature (SAS) for the account. |
api_version |
The storage API version to use when interacting with the host. Defaults to |
service |
For |
x |
For the print method, a storage endpoint object. |
... |
For the print method, further arguments passed to lower-level functions. |
This is the starting point for the client-side storage interface in AzureRMR. storage_endpoint
is a generic function to create an endpoint for any type of Azure storage while adls_endpoint
, blob_endpoint
and file_endpoint
create endpoints for those types.
If multiple authentication objects are supplied, they are used in this order of priority: first an access key, then an AAD token, then a SAS. If no authentication objects are supplied, only public (anonymous) access to the endpoint is possible.
storage_endpoint
returns an object of S3 class "adls_endpoint"
, "blob_endpoint"
, "file_endpoint"
, "queue_endpoint"
or "table_endpoint"
depending on the type of endpoint. All of these also inherit from class "storage_endpoint"
. adls_endpoint
, blob_endpoint
and file_endpoint
return an object of the respective class.
Note that while endpoint classes exist for all storage types, currently AzureStor only includes methods for interacting with ADLSgen2, blob and file storage.
AzureStor supports connecting to the Azure SDK and Azurite emulators for blob and queue storage. To connect, pass the full URL of the endpoint, including the account name, to the blob_endpoint
and queue_endpoint
methods (the latter from the AzureQstor package). The warning about an unrecognised endpoint can be ignored. See the linked pages, and the examples below, for details on how to authenticate with the emulator.
Note that the Azure SDK emulator is no longer being actively developed; it's recommended to use Azurite for development work.
create_storage_account, adls_filesystem, create_adls_filesystem, file_share, create_file_share, blob_container, create_blob_container
## Not run: # obtaining an endpoint from the storage account resource object stor <- AzureRMR::get_azure_login()$ get_subscription("sub_id")$ get_resource_group("rgname")$ get_storage_account("mystorage") stor$get_blob_endpoint() # creating an endpoint standalone blob_endpoint("https://mystorage.blob.core.windows.net/", key="access_key") # using an OAuth token for authentication -- note resource is 'storage.azure.com' token <- AzureAuth::get_azure_token("https://storage.azure.com", "myaadtenant", "app_id", "password") adls_endpoint("https://myadlsstorage.dfs.core.windows.net/", token=token) ## Azurite storage emulator: # connecting to Azurite with the default account and key (these also work for the Azure SDK) azurite_account <- "devstoreaccount1" azurite_key <- "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" blob_endpoint(paste0("http://127.0.0.1:10000/", azurite_account), key=azurite_key) # to use a custom account name and key, set the AZURITE_ACCOUNTS env var before starting Azurite Sys.setenv(AZURITE_ACCOUNTS="account1:key1") blob_endpoint("http://127.0.0.1:10000/account1", key="key1") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.