Azure Storage Sync

This page shows how to write Terraform and Azure Resource Manager for Storage Sync and write them securely.

azurerm_storage_sync (Terraform)

The Sync in Storage can be configured in Terraform with the resource name azurerm_storage_sync. The following sections describe 1 example of how to use the resource and its parameters.

Example Usage from GitHub

resources_storage_sync.tf#L1
resource "azurerm_storage_sync" "sync" {
  #depends_on          = [azurerm_resource_provider_registration.storage_sync]
  name                = local.resource_storage_sync_name
  resource_group_name = module.resource_group.name
  location            = module.resource_group.location
}

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a Storage Sync.

Tips: Best Practices for The Other Azure Storage Resources

In addition to the azurerm_storage_account, Azure Storage has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.

risk-label

azurerm_storage_account

Ensure to use HTTPS connections

It is better to use HTTPS instead of HTTP, which could be vulnerable to person-in-the-middle attacks.

risk-label

azurerm_storage_account_network_rules

Ensure to allow Trusted Microsoft Services to bypass

It is better to allow Trusted Microsoft Services to bypass. They are not able to access storage account unless rules are set to allow them explicitly.

Review your Azure Storage settings

In addition to the above, there are other security points you should be aware of making sure that your .tf files are protected in Shisho Cloud.

Microsoft.StorageSync/storageSyncServices (Azure Resource Manager)

The storageSyncServices in Microsoft.StorageSync can be configured in Azure Resource Manager with the resource name Microsoft.StorageSync/storageSyncServices. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

template.json
{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "virtualNetworks_file_server_onp_name": {
template.json
{
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workbookDisplayName": {
      "type": "string",
template.json
{
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workbookDisplayName": {
      "type": "string",
template.json
{
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workbookDisplayName": {
      "type": "string",
template.json
{
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workbookDisplayName": {
      "type": "string",
template.json
{
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workbookDisplayName": {
      "type": "string",

Parameters

  • apiVersion required - string
  • location required - string

    Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed.

  • name required - string

    Name of Storage Sync Service resource.

  • properties required
      • incomingTrafficPolicy optional - string

        Incoming Traffic Policy.

  • tags optional - string

    Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters.

  • type required - string

Frequently asked questions

What is Azure Storage Sync?

Azure Storage Sync is a resource for Storage of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure Storage Sync?

For Terraform, the wesley-trust/Terraform source code example is useful. See the Terraform Example section for further details.

For Azure Resource Manager, the kohei3110/file-server-on-azure, HasanIftakher/Azure-Monitor and mydur/AzMon source code examples are useful. See the Azure Resource Manager Example section for further details.