簡體   English   中英

有沒有辦法通過電源 shell 或 ARM 模板獲取 Azure 存儲同步服務中注冊服務器的服務器 ID?

[英]Is there a way to get the server ID of the registered server in an Azure storage sync service through power shell or ARM template?

{
  "name": "string",
  "type": "Microsoft.StorageSync/storageSyncServices/syncGroups/serverEndpoints",
  "apiVersion": "2019-06-01",
  "properties": {
    "serverLocalPath": "string",
    "cloudTiering": "string",
    "volumeFreeSpacePercent": "integer",
    "tierFilesOlderThanDays": "integer",
    "friendlyName": "string",
    "serverResourceId": "string",
    "offlineDataTransfer": "string",
    "offlineDataTransferShareName": "string"
  }
}

需要以上述模板格式作為服務器資源 id 傳遞的內容以進行存儲同步。 我們如何獲取服務器 ID?

是的。 使用Az.StorageSync模塊中的Get-AzStorageSyncServerEndpoint cmdlet 列出給定同步組中的所有服務器終結點。

Get-AzStorageSyncServerEndpoint -ResourceGroupName "myResourceGroup" -StorageSyncServiceName "mysyncservice" -SyncGroupName "testsyncgroup"

示例響應:

SyncGroupName                               : testsyncgroup
StorageSyncServiceName                      : mysyncservice
ServerLocalPath                             : C:\Users\onpremwindows\Desktop\myfolder
ServerResourceId                            : /subscriptions/***/resourceGroups/myResourceGroup/providers/microsoft.stor
                                              agesync/storageSyncServices/mysyncservice/registeredServers/8ec8b78c-0739-195r-856e-2e7r5ta2c13w
ServerEndpointName                          : 94e9fd59-23d6-9854-99c1-3e9a8ab73760
ProvisioningState                           : Succeeded
LastWorkflowId                              : storageSyncServices/mysyncservice/workflows/bd3o8c77-7183-4a46-8830-9b156dd2f011
LastOperationName                           : ICreateServerEndpointWorkflow
FriendlyName                                : onpremwindows
SyncStatus                                  : Microsoft.Azure.Commands.StorageSync.Models.PSServerEndpointHealth
CloudTiering                                : Off
VolumeFreeSpacePercent                      : 20
TierFilesOlderThanDays                      :
OfflineDataTransfer                         : Off
OfflineDataTransferShareName                :
OfflineDataTransferStorageAccountResourceId :
OfflineDataTransferStorageAccountTenantId   :
InitialDownloadPolicy                       : NamespaceThenModifiedFiles
LocalCacheMode                              : UpdateLocallyCachedFiles
ResourceId                                  : /subscriptions/***/resourceGroups/myResourceGroup/providers/microsoft.stor
                                              agesync/storageSyncServices/mysyncservice/syncGroups/testsyncgroup/serverEndpoints/94e9fd59-23d6-9854-99c1-3e9a8ab73760
ResourceGroupName                           : myResourceGroup
Type                                        : microsoft.storagesync/storageSyncServices/syncGroups/serverEndpoints

8ec8b78c-0739-195r-856e-2e7r5ta2c13w將是您可以傳遞的 ServerId。

您也可以使用Get-AzStorageSyncService cmdlet 獲取 ServerId:

Get-AzStorageSyncService -ResourceGroupName "myResourceGroup" -StorageSyncServiceName "mysyncservice"

示例響應:

StorageSyncServiceName    : mysyncservice
ServerName                : 8ec8b78c-0739-195r-856e-2e7r5ta2c13w
ServerCertificate         :
AgentVersion              : 8.0.0.0
ServerOSVersion           : 10.0.14393.0
ServerManagementErrorCode : 0
LastHeartBeat             : 12/10/2019 12:55:01
ProvisioningState         : Succeeded
ServerRole                : Standalone
ClusterId                 : 00000000-0000-0000-0000-000000000000
ClusterName               :
ServerId                  : 8ec8b78c-0739-195r-856e-2e7r5ta2c13w
StorageSyncServiceUid     : 76104503-6cd8-4812-7884-c4288e87a8cd
LastWorkflowId            : storageSyncServices/finalsync/workflows/0e3bc737-7619-4b42-81a9-aec36e3fbf53
LastOperationName         : ICreateRegisteredServerWorkflow
DiscoveryEndpointUri      : https://tm-server.xxx.com:443
ResourceLocation          : eastasia
ServiceLocation           : eastasia
FriendlyName              : onpremwindows
ManagementEndpointUri     : https://tm-server.xxx.com:443
MonitoringEndpointUri     : https://tm-server.xxx.com:443
ResourceId                : /subscriptions/***/resourceGroups/myResourceGroup/providers/microsoft.storagesync/storageSyncServices/mysyncservice/registeredServers/8ec8b78c-0739-195r-856e-2e7r5ta2c13w
ResourceGroupName         : myResourceGroup
Type                      : microsoft.storagesync/storageSyncServices/registeredServers

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM