How to set minimum TLS version of Storage Account using Microsoft SDK?

Sara 1 Reputation point
2021-03-02T19:02:57.683+00:00

Hi,

I am trying to create a Storage Account to enforce a Minimum TLS version of 1.2, such that I can use something along the following lines:

return Retry.operation(() ->  
                azureConn.getAzure()  
                        .storageAccounts()  
                        .define(accountName)  
                        .withRegion(region)  
                        .withExistingResourceGroup(resourceGroupName)  
                        .withGeneralPurposeAccountKindV2()  
                        .withLargeFileShares(true)  
                        .withSku(StorageAccountSkuType.SKU)  
                        .withTags(tags)  
                        //.minimumTLS(String value)  
                        .create())  

I don't find anything from Microsoft to allow me to create my account to specify. TLS. Please guide me what I can do?

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,687 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. deherman-MSFT 33,306 Reputation points Microsoft Employee
    2021-03-02T21:13:39.82+00:00

    @
    Here is a thread which appears to have resolution using Microsoft.Azure.Management.Storage and StorageAccountCreateParameters Class.

    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);  
          
              
    

    Hope this helps. Let me know if you have further questions or issues.

    -------------------------------

    Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments