English 中文(简体)
如何在R中使用带有“sp”前缀的AzureStor生成有效的SAS令牌?
原标题:How to generate a valid sas token with AzureStor in R with "sp" prefix?

我一直在尝试使用以下代码生成有效的SAS令牌。STORAGE_ACCOUNT_NAMESTORAGE_ACCOUNT_KEY肯定已由我和其他几个人仔细检查。出于某种原因,当我通过此过程创建令牌时,我得到一个以sv开头的令牌,但当我在门户上生成令牌时,我得到一个以sp开头的令牌。

我已尝试使用as.POSIXct等更改日期,但即使是文档也显示Sys.Date ()是可以接受的,因此我不确定其他参数或输入应该有所不同。有人知道我在生成有效的SAS令牌时缺少什么吗?

library(AzureStor)

sas_token <- get_service_sas(
    account = config[["storage_account_name"]],
    resource = resource_name,
    key = config[["storage_account_key"]],
    service = "blob",
    permissions = "r",
    resource_type = "b",
    protocol = "https",
    start = Sys.time(),
    expiry = Sys.time() +1 
)
问题回答

MYMEMORY警告:您今天使用了所有可用的免费翻译。下一个可用的00小时00分04秒访问HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP翻译更多

MYMEMORY警告:您今天使用了所有可用的免费翻译。下一个可用的00小时00分02秒访问HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP翻译更多

  1. Account SAS : An account SAS, secured by the storage account key, authorizes access to storage services’ resources. It empowers delegation for operations like read, write, and delete on blob containers, tables, queues, and file shares. Access similar to a user delegation SAS can be achieved by obtaining an account SAS through the get_account_sas call.
  2. Service SAS : A service SAS provides more precise access control compared to an account SAS. It enables creating SAS tokens that grant access exclusively to designated blobs in a container or files within a file share. To generate a service SAS, you can use the get_service_sas call.

MYMEMORY警告:您今天使用了所有可用的免费翻译。下一个在00小时00分01秒内可用访问HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP翻译更多

您可以尝试按照上述文档使用get_account_sas生成 SAS令牌。

get_account_sas("mystorage", "access_key", start=Sys.Date(), expiry=Sys.Date() + 7)

字符串sv = & ss = & srt = &... & sig =中的部件顺序无关紧要。重要的是每个部分的价值。您可以在这里看到 C + + SDK也像 R SDK一样首先返回 sv。

我建议将SDK生成的值与 Azure上生成的值之间的 ss、 srt、 sp部分进行比较 ,也许参数设置不正确。





相关问题
How to plot fitted model over observed time series

This is a really really simple question to which I seem to be entirely unable to get a solution. I would like to do a scatter plot of an observed time series in R, and over this I want to plot the ...

REvolution for R

since the latest Ubuntu release (karmic koala), I noticed that the internal R package advertises on start-up the REvolution package. It seems to be a library collection for high-performance matrix ...

R - capturing elements of R output into text files

I am trying to run an analysis by invoking R through the command line as follows: R --no-save < SampleProgram.R > SampleProgram.opt For example, consider the simple R program below: mydata =...

R statistical package: wrapping GOFrame objects

I m trying to generate GOFrame objects to generate a gene ontology mapping in R for unsupported organisms (see http://www.bioconductor.org/packages/release/bioc/vignettes/GOstats/inst/doc/...

Changing the order of dodged bars in ggplot2 barplot

I have a dataframe df.all and I m plotting it in a bar plot with ggplot2 using the code below. I d like to make it so that the order of the dodged bars is flipped. That is, so that the bars labeled "...

Strange error when using sparse matrices and glmnet

I m getting a weird error when training a glmnet regression. invalid class "dgCMatrix" object: length(Dimnames[[2]]) must match Dim[2] It only happens occasionally, and perhaps only under larger ...

Generating non-duplicate combination pairs in R

Sorry for the non-descriptive title but I don t know whether there s a word for what I m trying to achieve. Let s assume that I have a list of names of different classes like c( 1 , 2 , 3 , 4 ) ...

Per panel smoothing in ggplot2

I m plotting a group of curves, using facet in ggplot2. I d like to have a smoother applied to plots where there are enough points to smooth, but not on plots with very few points. In particular I d ...

热门标签