<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      【Azure Blob】關閉Blob 匿名訪問,iOS Objective-C SDK連接Storage Account報錯

      問題描述

      iOS Objective-C 應用,連接Azure Storage Account, 根據官網Example代碼,在沒有關閉Storage Account的匿名訪問時,程序正常運行。

      但是,只要關閉了匿名訪問,上傳blob到Container中,就會報錯:Public access is not permitted on this storage account 

       

      問題解答

      查看示例代碼:

      -(void)createContainerWithPublicAccess{
          NSError *accountCreationError;
      
          // Create a storage account object from a connection string.
          AZSCloudStorageAccount *account = [AZSCloudStorageAccount accountFromConnectionString:@"DefaultEndpointsProtocol=https;AccountName=your_account_name_here;AccountKey=your_account_key_here" error:&accountCreationError];
      
          if(accountCreationError){
              NSLog(@"Error in creating account.");
          }
      
          // Create a blob service client object.
          AZSCloudBlobClient *blobClient = [account getBlobClient];
      
          // Create a local container object.
          AZSCloudBlobContainer *blobContainer = [blobClient containerReferenceFromName:@"containerpublic"];
      
          // Create container in your Storage account if the container doesn't already exist
          [blobContainer createContainerIfNotExistsWithAccessType:AZSContainerPublicAccessTypeContainer requestOptions:nil operationContext:nil completionHandler:^(NSError *error, BOOL exists){
              if (error){
                  NSLog(@"Error in creating container.");
              }
          }];
      }

      關鍵就是 blobContainer createContainerIfNotExistsWithAccessType:AZSContainerPublicAccessTypeContainer  這一句代碼。因為示例代碼中使用的是Public Access方式create container,雖然連接字符串中由Account Key,但是代碼中使用的是Public Access。所以當關閉Public Access后,程序就會報錯。

      把 AZSContainerPublicAccessTypeContainer  修改為  AZSContainerPublicAccessTypeOff  就可以了。

       

      NOTES:

      • No public read access: The container and its blobs can be accessed only with an authorized request. This option is the default for all new containers.
      • Public read access for container and its blobs: Container and blob data can be read by anonymous request, except for container permission settings and container metadata. Clients can enumerate blobs within the container by anonymous request, but cannot enumerate containers within the storage account.
      • Public read access for blobs only: Blobs within the container can be read by anonymous request, but container data is not available anonymously. Anonymous clients cannot enumerate the blobs within the container.

       

      參考資料

      設置Storage Account Container容器權限 : https://learn.microsoft.com/zh-cn/previous-versions/azure/storage/blobs/storage-ios-how-to-use-blob-storage#set-container-permissions

       

      [END]

      posted @ 2024-07-05 21:47  路邊兩盞燈  閱讀(53)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 亚洲精品一区二区制服| 日韩精品永久免费播放平台| 久久一亚色院精品全部免费| 给我播放片在线观看| 亚洲美女少妇偷拍萌白酱| 亚洲综合天堂一区二区三区| 国产精品自在自线免费观看| 成人深夜节目在线观看| 亚洲国产天堂一区二区三区| 亚洲人午夜精品射精日韩| 亚洲精品麻豆一区二区| 日本三级香港三级三级人妇久 | 中文字幕日韩有码av| 国产精品一精品二精品三| 野花韩国高清电影| 久久av高潮av喷水av无码| 一区二区三区激情都市| 亚洲国产aⅴ成人精品无吗 | 免费人妻av无码专区| 丰满少妇高潮无套内谢| 小污女小欲女导航| 国产一区二区三区四区色| 国产亚洲精品第一综合| 国模雨珍浓密毛大尺度150p | 国偷自产一区二区免费视频| 久久综合伊人| 无码 人妻 在线 视频| 综合久久婷婷综合久久| 久久综合97丁香色香蕉| 成 年 人 黄 色 大 片大 全| 亚洲中文字幕在线无码一区二区| 一本大道无码av天堂| 伊人久久大香线蕉网av| 亚洲成人av在线资源网| 国产男女爽爽爽免费视频| 久久综合色之久久综合色| 亚洲性线免费观看视频成熟| 亚洲精品一区二区区别| 亚洲国产一区二区精品专| 亚洲va在线∨a天堂va欧美va| 囯产精品久久久久久久久久妞妞 |