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 ,如需转载请自行联系原作者
相关文章
|
Windows 数据安全/隐私保护 安全
|
1月前
|
Unix 虚拟化 Windows
Windows Server 2025 中文版、英文版下载 (2025 年 3 月更新)
Windows Server 2025 中文版、英文版下载 (2025 年 3 月更新)
104 4
Windows Server 2025 中文版、英文版下载 (2025 年 3 月更新)
|
1月前
|
安全 数据安全/隐私保护 虚拟化
Windows Server 2022 中文版、英文版下载 (2025 年 3 月更新)
Windows Server 2022 中文版、英文版下载 (2025 年 3 月更新)
96 4
Windows Server 2022 中文版、英文版下载 (2025 年 3 月更新)
|
13天前
|
Linux 虚拟化 iOS开发
Windows Server 2008 R2 OVF (2025 年 4 月更新) - VMware 虚拟机模板
Windows Server 2008 R2 OVF (2025 年 4 月更新) - VMware 虚拟机模板
69 29
Windows Server 2008 R2 OVF (2025 年 4 月更新) - VMware 虚拟机模板
|
1月前
|
存储 运维 监控
提升Windows Server环境安全性:ADAudit Plus的五大关键优势
在Windows Server环境中,内置的安全审计工具虽有用,但存在专业门槛高、耗时及功能缺失等问题。第三方工具ADAudit Plus应运而生,其五大优势包括:日志聚合、关键活动检测、定制化报告、灵活安全配置和长期日志保留,有效提升系统监控与合规能力。选择ADAudit Plus,助力企业更高效应对审计挑战,强化安全性。
|
2月前
|
安全 Unix 虚拟化
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 2 月更新)
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 2 月更新)
82 11
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 2 月更新)
|
2月前
|
Unix 虚拟化 Windows
Windows Server 2025 中文版、英文版下载 (2025 年 2 月更新)
Windows Server 2025 中文版、英文版下载 (2025 年 2 月更新)
127 7
Windows Server 2025 中文版、英文版下载 (2025 年 2 月更新)
|
2月前
|
安全 虚拟化 Windows
Windows Server 2019 中文版、英文版下载 (2025 年 2 月更新)
Windows Server 2019 中文版、英文版下载 (2025 年 2 月更新)
112 22
下一篇
oss创建bucket