我正在创建一个模板,用于使用 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中的已知问题,请引用this issue .
可以考虑使用非Fluent 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);
关于c# - 如何使用 Microsoft.Azure.Management.Fluent 在 Azure 存储帐户上设置最低 TLS;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65674265/