Windows Azure CloudBlobContainer.CreateIfNotExist : One of the request inputs is out of range.

简介:


By Daniel Du

I am working on my Blob storage sample of windows Azure and I get an exception as below when I create a blob container.

“One of the request inputs is out of range”

image

The code is pretty simple,

    private void EnsureContainnerExits()

    {

      var container = GetContainner();

 

      container.CreateIfNotExist();//exception

 

      var permission = container.GetPermissions();

      permission.PublicAccess = BlobContainerPublicAccessType.Container;

 

      container.SetPermissions(permission);

    }

 

    private CloudBlobContainer GetContainner()

    {

      var account = CloudStorageAccount.FromConfigurationSetting("DataConnectionString");

      var client = account.CreateCloudBlobClient();

 

      return client.GetContainerReference(

        RoleEnvironment.GetConfigurationSettingValue("ContainerName"));

    }

To make the container name configurable, I put it into CSCFG file. it can be accessed from webrole’s “property” –“Settings”, or edit the CSCFG file directly. I named the container name as “Gallery”.

image

The reason I got the error is that I used incorrect container name, according to the container naming specification on MSDN, it is supposed be to all lower case, while I am using a capital character. It is not a big deal, just a tip need to pay attention to, hope it is helpful if you come across the same issue.

作者: 峻祁连
邮箱:junqilian@163.com 
出处: http://junqilian.cnblogs.com 
转载请保留此信息。



本文转自峻祁连. Moving to Cloud/Mobile博客园博客,原文链接:http://www.cnblogs.com/junqilian/archive/2012/08/27/2658783.html ,如需转载请自行联系原作者
目录
打赏
0
0
0
0
23
分享
相关文章
|
14天前
|
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 2 月更新)
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 2 月更新)
42 11
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 2 月更新)
|
14天前
|
Windows Server 2025 中文版、英文版下载 (2025 年 2 月更新)
Windows Server 2025 中文版、英文版下载 (2025 年 2 月更新)
41 7
Windows Server 2025 中文版、英文版下载 (2025 年 2 月更新)
|
14天前
|
Windows Server 2019 中文版、英文版下载 (2025 年 2 月更新)
Windows Server 2019 中文版、英文版下载 (2025 年 2 月更新)
56 22
Windows Server 2025 Active Directory 重置用户密码
密码重置是管理员日常任务之一,用户因忘记或多次输错密码导致账户锁定时需进行重置。本文介绍在Active Directory服务器上重置密码的三种方法。
Windows Server 安装 MySQL 8.0 详细指南
安装 MySQL 需要谨慎,特别注意安全配置和权限管理。根据实际业务需求调整配置,确保数据库的性能和安全。
338 9
Windows server 2012R2系统安装远程桌面服务后无法多用户同时登录是什么原因?
【11月更文挑战第15天】本文介绍了在Windows Server 2012 R2中遇到的多用户无法同时登录远程桌面的问题及其解决方法,包括许可模式限制、组策略配置问题、远程桌面服务配置错误以及网络和防火墙问题四个方面的原因分析及对应的解决方案。
253 4
使用EventLog Analyzer日志分析工具监测 Windows Server 安全威胁
Windows服务器面临多重威胁,包括勒索软件、DoS攻击、内部威胁、恶意软件感染、网络钓鱼、暴力破解、漏洞利用、Web应用攻击及配置错误等。这些威胁严重威胁服务器安全与业务连续性。EventLog Analyzer通过日志管理和威胁分析,有效检测并应对上述威胁,提升服务器安全性,确保服务稳定运行。
116 2
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等