Skip to content

Commit 7918761

Browse files
committed
replaces the azure logic with {azkit}
1 parent 6e2ffde commit 7918761

2 files changed

Lines changed: 7 additions & 15 deletions

File tree

DESCRIPTION

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Depends:
1919
R (>= 4.4.0)
2020
Imports:
2121
arrow,
22-
AzureAuth,
22+
azkit,
2323
AzureStor,
2424
bs4Dash,
2525
cachem,
@@ -69,7 +69,8 @@ Suggests:
6969
usethis,
7070
watchr (>= 0.0.0.9000)
7171
Remotes:
72-
github::tomjemmett/watchr
72+
github::tomjemmett/watchr,
73+
github::the-strategy-unit/azkit
7374
Config/testthat/edition: 3
7475
Encoding: UTF-8
7576
Language: en-GB

R/fct_azure_storage.R

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,9 @@ load_provider_data <- function(
2626
#'
2727
#' @return the adls filesystem
2828
get_adls_fs <- function() {
29-
ep_uri <- Sys.getenv("LOCAL_STORAGE_EP")
29+
token <- azkit::get_auth_token()
3030

31-
ep <- if (ep_uri != "") {
32-
sa_key <- Sys.getenv("LOCAL_STORAGE_KEY")
33-
34-
AzureStor::adls_endpoint(ep_uri, key = sa_key)
35-
} else {
36-
ep_uri <- Sys.getenv("AZ_STORAGE_EP")
37-
token <- AzureAuth::get_managed_token("https://storage.azure.com/") |>
38-
AzureAuth::extract_jwt()
39-
40-
AzureStor::adls_endpoint(ep_uri, token = token)
41-
}
42-
AzureStor::adls_filesystem(ep, Sys.getenv("AZ_STORAGE_CONTAINER"))
31+
Sys.getenv("AZ_STORAGE_EP") |>
32+
AzureStor::adls_endpoint(token = token) |>
33+
AzureStor::adls_filesystem(Sys.getenv("AZ_STORAGE_CONTAINER"))
4334
}

0 commit comments

Comments
 (0)