我想在禁用状态下创建加密存储帐户。但默认情况下,在创建存储时启用加密。仪表板中没有选项可禁用它。我引用了Microsoft API并尝试了以下请求,但它无效。
print(a)
['']
['Kansas City is 232\u2009m above sea level and located at 39.05° N 94.50°
W. Kansas City has a population of 475378. Local time in Kansas City is
CST.']
['Kansas City 1 – 3 Day Weather Forecast Summary: Mostly dry. Freeze-thaw
conditions (max 10°C on Wed afternoon, min -2°C on Thu night). Wind will be
generally light.']
[' Local time in Kansas City: CST']
['View 3 Hour Detailed Kansas City Weather Forecast for Today']
['Kansas City 4 – 7 Day Weather Forecast Summary: Mostly dry. Very mild (max
12°C on Mon afternoon, min 1°C on Sun night). Winds decreasing (fresh winds
from the SSW on Sat morning, light winds from the ENE by Sun night).']
['Kansas City 7 – 10 Day Weather Forecast Summary: Light rain (total 2mm),
mostly falling on Wed morning. Very mild (max 17°C on Wed afternoon, min 7°C
on Thu night). Wind will be generally light.']
['© 2017 Meteo365.com']
响应:
{
"sku": {
"name": "Standard_LRS"
},
"kind": "Storage",
"location": "westus2",
"encryption": {
"services": {
"blob": {
"enabled": False
}
}
}}
请帮我解决这个问题。
答案 0 :(得分:0)
您收到此错误的原因是encryption
属性应该在properties
属性中。请将您的请求正文更改为:
{
"sku": {
"name": "Standard_LRS"
},
"kind": "Storage",
"location": "westus2",
"properties": {
"encryption": {
"keySource": "Microsoft.Storage"
"services": {
"blob": {
"enabled": False
}
}
}
}
}
或者你可以做的其他事情就是一起摆脱encryption
属性。因此,在这种情况下,您的请求正文看起来像:
{
"sku": {
"name": "Standard_LRS"
},
"kind": "Storage",
"location": "westus2",
"properties": {
}
}
但是我很好奇你为什么要在休息时禁用加密。
答案 1 :(得分:0)
我在我的实验室中使用以下脚本进行了测试:
{
"sku": {
"name": "Standard_LRS"
},
"kind": "Storage",
"location": "westus2",
"properties": {
}
}
但是当我访问Azure门户网站时发现 blob仍然是加密的。
我还测试了许多其他可能的模板,但在创建存储帐户时都未能禁用加密。我认为它可能是由设计引起的:Azure强制每个存储帐户在开始时加密。
如果您仍想禁用加密,可以使用以下powershell脚本执行此操作:
Set-AzureRmStorageAccount -ResourceGroupName "ResourceGroupName" -AccountName "YourstorageAccountName" -DisableEncryptionService blob
您可以在this document中查看有关Set-AzureRmStorageAccount
的更多详情。
希望这有帮助!