c# - 如何使用 Microsoft.Azure.Management.Fluent 在 Azure 存储帐户上设置最小 TLS;
问题描述
我正在使用 Microsoft.Azure.Management.Fluent C# 库创建用于预配 azure 资源的模板。
IAzure azure = Azure.Authenticate("./authfile.txt").WithDefaultSubscription();
var sa = await azure.StorageAccounts.Define(StorageAccount)
.WithRegion(Region.USCentral)
.WithExistingResourceGroup(ResourceGroup)
.WithBlobEncryption()
.WithGeneralPurposeAccountKindV2()
.WithFileEncryption()
.WithOnlyHttpsTraffic()
.WithSku(StorageAccountSkuType.Standard_LRS)
.WithHnsEnabled(true)
.CreateAsync();
我希望我的存储帐户至少具有 TLS1.2,尽管我无法找到在此处设置所需 TLS 版本的方法。
如何在此处创建 TLS1.2 要求?
解决方案
这是 Fluent API 中的一个已知问题,请参考这个问题。
您可以考虑使用非流利的 sdk:Microsoft.Azure.Management.Storage。
例如:
var storageManagementClient = new StorageManagementClient(azureCredentials)
{
SubscriptionId = subscriptionId
};
var storageAccountCreateParameters = new StorageAccountCreateParameters
{
//set the tls here.
MinimumTlsVersion = "TLS1_2"
//other settings.
};
await storageManagementClient.StorageAccounts.CreateAsync(resourceGroupName, accountName, storageAccountCreateParameters);
推荐阅读
- cytoscape - Cytoscape(桌面应用程序):选择所有通过边缘连接的具有给定属性的相邻节点
- javascript - db.close() promise pending : 测试运行完成后一秒 Jest 没有退出
- nginx - nginx反向代理上游初始连接很慢
- java - Kotlin 上的服务器-客户端应用程序问题
- python-3.x - Python 3 子进程不会以 signal.SIGINT 终止
- html - Bootstrap4 与 IE 和 Edge 的兼容性 - 导航下拉菜单和视频标签问题
- botframework - botframework 的 PromptOptions 类中的验证
- r - 如何为因子中的水平分配值?
- c++ - 对 qt_static_plugin_QWaylandEglStreamBufferIntegrationPlugin 的未定义引用
- laravel - 如何在 Laravel 中隐藏一个块?