以下是部署存储同步服务、同步组和服务器端点的工作 ARM 模板。
当您按照此处所述向您的存储同步服务器注册服务器时,您可以获得serverResourceId属性,但采用 ResourceId 格式:
/subscriptions/***/resourceGroups/***/providers/microsoft.storagesync/storageSyncServices/mystoragesyncservice/registeredServers/85fa92da-2b2e-447c-d3rg-f8bf43c4064f
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storagesyncservicename": {
"type": "string",
"defaultValue": "mystoragesyncservice"
}
},
"variables": {},
"resources": [
{
"type": "microsoft.storagesync/storageSyncServices",
"apiVersion": "2020-03-01",
"name": "[parameters('storagesyncservicename')]",
"location": "westus2",
"properties": {
"incomingTrafficPolicy": "AllowAllTraffic"
}
},
{
"type": "microsoft.storagesync/storageSyncServices/syncGroups",
"apiVersion": "2020-03-01",
"name": "[concat(parameters('storagesyncservicename'), '/mystoragesyncgroup')]",
"dependsOn": [
"[resourceId('microsoft.storagesync/storageSyncServices', parameters('storagesyncservicename'))]"
],
"properties": {}
},
{
"type": "microsoft.storagesync/storageSyncServices/syncGroups/serverEndpoints",
"apiVersion": "2020-03-01",
"name": "[concat(parameters('storagesyncservicename'), '/mystoragesyncgroup/5770750b-a1e6-4910-9781-1482fdee757a')]",
"dependsOn": [
"[resourceId('microsoft.storagesync/storageSyncServices/syncGroups', parameters('storagesyncservicename'), 'mystoragesyncgroup')]",
"[resourceId('microsoft.storagesync/storageSyncServices', parameters('storagesyncservicename'))]"
],
"properties": {
"serverLocalPath": "D:\\Data",
"cloudTiering": "Off",
"volumeFreeSpacePercent": 20,
"friendlyName": "mytestafs",
"serverResourceId": "/subscriptions/***/resourceGroups/***/providers/microsoft.storagesync/storageSyncServices/mystoragesyncservice/registeredServers/85fa92da-2b2e-447c-d3rg-f8bf43c4064f",
"offlineDataTransfer": "Off",
"initialDownloadPolicy": "NamespaceThenModifiedFiles",
"localCacheMode": "UpdateLocallyCachedFiles"
}
}
]
}