![](/img/trans.png)
[英]How to list resources in a resource group with Microsoft.Azure.Management.Fluent?
[英]How to set minimum TLS on Azure Storage Account using Microsoft.Azure.Management.Fluent;
我正在使用 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);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.