zoukankan      html  css  js  c++  java
  • D365: Azure Blob Storage(二)认证访问

    D365可以通过如下三种方式认证访问Azure Blob Storage

    方式1,通过连接字符串认证访问,代码参考如下,连接字符串可以在Storage account的access key页签里面找到

    storageAccount = Microsoft.WindowsAzure.Storage.CloudStorageAccount::Parse("***************************");
    cloudBlobClient = storageAccount.CreateCloudBlobClient();
    cloudBlobContainer = cloudBlobClient.GetContainerReference("test6666");

    方式2,用Storage account和access key,代码参考如下,account和key可以在Storage account的access key里面找到

    storageCredentials = new Auth.StorageCredentials("*************","*********************************");
    storageAccount = new CloudStorageAccount(storageCredentials, true);
    cloudBlobClient = storageAccount.CreateCloudBlobClient();
    cloudBlobContainer = cloudBlobClient.GetContainerReference("test6666");

     方式3,通过sos token和URL认证访问,sos token在Storage accont的shared access signature页签下进行配置,URL地址https://blobstoragetest888.blob.core.windows.net,把其中的blobstoragetest888替换自己的storage account name即可

    storageCredentials = new Auth.StorageCredentials("sos token");
    cloudBlobClient = new CloudBlobClient(new System.Uri("url"), storageCredentials);
    cloudBlobContainer = cloudBlobClient.GetContainerReference("test6666");

  • 相关阅读:
    让思考成为一种习惯:今年,我大四了
    asp.net core源码飘香:Logging组件
    asp.net core源码飘香:Options组件
    asp.net core源码飘香:Configuration组件
    asp.net core源码飘香:从Hosting开始
    webpack code split实现原理
    css specificity
    todo:read
    React Render Props 模式
    recompose mapProps 函数指南
  • 原文地址:https://www.cnblogs.com/dingkui/p/14959519.html
Copyright © 2011-2022 走看看