Skip to content

Commit

Permalink
Rename Azure authentication intermediates
Browse files Browse the repository at this point in the history
To match https://github.com/CDCgov/cfazuR/tree/kg-expand-readme

Co-authored-by: Katie Gostic (she/her) <[email protected]>
  • Loading branch information
zsusswein and kgostic authored Aug 26, 2024
1 parent 3d1b053 commit e0a3a59
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions R/azure.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ download_file_from_container <- function(
#' Load Azure Blob endpoint using credentials in environment variables
#'
#' This **impure** function depends on the environment variables:
#' * TENANT_ID
#' * SUBSCRIPTION
#' * RESOURCE_GROUP
#' * STORAGE_ACCOUNT
#' * az_tenant_id
#' * az_subscription_id
#' * az_resource_group
#' * az_storage_account
#'
#' It will error out if any of the above is not set.
#' @param container_name The Azure Blob Storage container associated with the
Expand All @@ -92,19 +92,19 @@ fetch_blob_container <- function(container_name) {
)
cli::cli_alert_info("Loading Azure credentials from env vars")
# nolint start: object_name_linter
TENANT_ID <- fetch_credential_from_env_var("TENANT_ID")
SUBSCRIPTION <- fetch_credential_from_env_var("SUBSCRIPTION")
RESOURCE_GROUP <- fetch_credential_from_env_var("RESOURCE_GROUP")
STORAGE_ACCOUNT <- fetch_credential_from_env_var("STORAGE_ACCOUNT")
az_tenant_id <- fetch_credential_from_env_var("az_tenant_id ")
az_subscription_id<- fetch_credential_from_env_var("az_subscription_id")
az_resource_group<- fetch_credential_from_env_var("az_resource_group")
az_storage_account<- fetch_credential_from_env_var("az_storage_account")
# nolint end: object_name_linter
cli::cli_alert_success("Credentials loaded successfully")


cli::cli_alert_info("Authenticating with loaded credentials")
az <- AzureRMR::get_azure_login(TENANT_ID)
subscription <- az$get_subscription(SUBSCRIPTION)
resource_group <- subscription$get_resource_group(RESOURCE_GROUP)
storage_account <- resource_group$get_storage_account(STORAGE_ACCOUNT)
az <- AzureRMR::get_azure_login(az_tenant_id )
subscription <- az$get_subscription(az_subscription_id)
resource_group <- subscription$get_resource_group(az_resource_group)
storage_account <- resource_group$get_storage_account(az_storage_account)

# Getting the access key
keys <- storage_account$list_keys()
Expand Down

0 comments on commit e0a3a59

Please sign in to comment.