尝试在 Azure 共享访问签名中“生成 SAS 和连接字符串”。显示以下消息“由于端点未发布,某些路由选项被禁用。” “生成 SAS 和连接字符串”按钮处于非活动状态。该按钮是否因端点未发布而处于非活动状态?有一个端点(ITLLCGlobal (ITLLCGlobal/ITLLCGlobal)、服务端点 NQUEUE)。如果这是原因,我该如何发布端点?
我已经从门户中创建了一个 SAS 令牌,一切正常,我可以访问私有 blob。
我正在尝试使用此函数动态创建新的 SAS 令牌:
function generateSasToken($uri, $sasKeyName, $sasKeyValue)
{
$targetUri = strtolower(rawurlencode(strtolower($uri)));
$expires = time();
$expiresInMins = 60;
$week = 60*60*24*7;
$expires = $expires + $week;
$toSign = $targetUri . "\n" . $expires;
$signature = rawurlencode(base64_encode(hash_hmac('sha256',
$toSign, $sasKeyValue, TRUE)));
$token = "SharedAccessSignature sr=" . $targetUri . "&sig=" . $signature . "&se=" . $expires . "&skn=" . $sasKeyName;
return $token;
}
Run Code Online (Sandbox Code Playgroud)
这确实会生成 SAS 令牌,但其格式与从门户生成的帐户范围略有不同。
当尝试使用令牌时,我收到错误:
<Error>
<Code>AuthenticationFailed</Code>
<Message>
Server failed to authenticate the request. Make sure the value …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用该azure-storage-blob包动态生成 blob SAS URL 。此解决方案仅适用于现在已弃用的azure-storage软件包,该软件包无法再安装。
我需要一种方法来模拟BlockBlobService.generate_blob_shared_access_signature生成 blob SAS URL的行为,如下所示:
from datetime import datetime, timedelta
from azure.storage.blob import (
BlockBlobService,
ContainerPermissions,
BlobPermissions,
PublicAccess,
)
AZURE_ACC_NAME = '<account_name>'
AZURE_PRIMARY_KEY = '<account_key>'
AZURE_CONTAINER = '<container_name>'
AZURE_BLOB='<blob_name>'
block_blob_service = BlockBlobService(account_name=AZURE_ACC_NAME, account_key=AZURE_PRIMARY_KEY)
sas_url = block_blob_service.generate_blob_shared_access_signature(AZURE_CONTAINER,AZURE_BLOB,permission=BlobPermissions.READ,expiry= datetime.utcnow() + timedelta(hours=1))
print('https://'+AZURE_ACC_NAME+'.blob.core.windows.net/'+AZURE_CONTAINER+'/'+AZURE_BLOB+'?'+sas_url)
Run Code Online (Sandbox Code Playgroud)
如果您有已弃用的软件包,则上述解决方案有效,但我需要一个不需要它的解决方案。
任何人都可以告诉我为什么这条线不起作用?它位于宏的datastep中.
其中1*substr(Sample_ID,6,6)<201704; (错误:where子句需要数字bla bla)
而if语句也是如此.
如果1*substr(Sample_ID,6,6)<201704;
你好,无论出于什么原因,我的if if语句对这段代码不起作用.我想让它做的是(有点明显,但无论如何),如果薪水是LE 30,000,那么新的可变收入等于低.这是我到目前为止所拥有的.
data newdd2;
input subject group$ year salary : comma7. @@;
IF (salary <= 30,000) THEN income = 'low';
datalines;
1 A 2 53,900 2 B 2 37,400 3 A 1 49,500
4 C 2 43,900 5 B 3 38,400 6 A 3 39,500
7 A 3 53,600 8 B 2 37,700 9 C 1 49,900
10 C 2 43,300 11 B 3 57,400 12 B 3 39,500
13 B 1 33,900 14 A 2 41,400 15 C …Run Code Online (Sandbox Code Playgroud) 我有一个带有多个容器和 blob 的天蓝色存储帐户:
container1 -> blob1.txt, blob2.jpg
container2 -> blob1.png
container3 ->
Run Code Online (Sandbox Code Playgroud)
我想生成一个只能从container1读取和写入的 SAS 。
第一个问题:我应该使用generateAccountSASQueryParameters还是generateBlobSASQueryParameters来执行此操作?
第二个问题:我一直在尝试使用generateBlobSASQueryParameters 来实现这一点。但是,我不断收到此错误:
<Error>
<Code>AuthenticationFailed</Code>
<Message>
Server failed to authenticate the request. Make sure the value of Authorization header is
formed correctly including the signature. RequestId:1db4c573-201e-0083-2396-ab3df5000000
Time:2019-12-05T18:05:52.8934222Z
</Message>
<AuthenticationErrorDetail>
The specified signed resource is not allowed for the this resource level
</AuthenticationErrorDetail>
</Error>
Run Code Online (Sandbox Code Playgroud)
我用来执行此操作的代码在这里:
const account = "storageaccountname";
const accountKey = "<myKey>";
const sharedKeyCredential = new AzureStorageBlob.StorageSharedKeyCredential(account, accountKey);
const blobServiceClient = new AzureStorageBlob.BlobServiceClient( …Run Code Online (Sandbox Code Playgroud)