Not
Bu sayfaya erişim yetkilendirme gerektiriyor. Oturum açmayı veya dizinleri değiştirmeyi deneyebilirsiniz.
Bu sayfaya erişim yetkilendirme gerektiriyor. Dizinleri değiştirmeyi deneyebilirsiniz.
Bu makalede, REST API kullanılarak Azure Backup tarafından oluşturulan bir geri yükleme noktasından dosya paylaşımının tamamının veya belirli dosyaların nasıl geri yükleneceği açıklanmaktadır. Ayrıca Azure portalını, Azure PowerShell'i, Azure CLI'yı kullanarak Azure Dosyalar'ı geri yükleyebilirsiniz.
Desteklenen Azure Dosyaları yedekleme ve geri yükleme senaryoları, bölge kullanılabilirliği ve sınırlamaları hakkında bilgi edinmek için destek matrisine bakın. Sık sorulan sorular için sık sorulan sorulara bakın.
Önkoşullar
Geri yüklemek istediğiniz yedeklenmiş bir Dosya Paylaşımınız olduğunu varsayıyoruz. Bunu bilmiyorsanız, rest API kullanarak Azure Dosyalarını yedekleme bölümüne göz atarak nasıl oluşturulacağını öğrenin.
Bu makale için aşağıdaki kaynakları kullanırız:
- RecoveryServicesVault: azurefilesvault
- Kaynak grubu: azurefiles
- Depolama Hesabı: afsaccount
- Dosya Paylaşımı: azurefiles
ContainerName ve ProtectedItemName'i al
Geri yüklemeyle ilgili API çağrılarının çoğu için {containerName} ve {protectedItemName} URI parametrelerinin değerlerini geçirmeniz gerekir. Bu parametrelerin değerlerini almak için GET backupprotectableitems işleminin yanıt gövdesindeki ID özniteliğini kullanın. Örneğimizde, korumak istediğimiz Dosya Paylaşımının kimliği:
"/Subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/azurefiles/providers/Microsoft.RecoveryServices/vaults/azurefilesvault/backupFabrics/Azure/protectionContainers/storagecontainer;storage;azurefiles;afsaccount/protectableItems/azurefileshare;azurefiles
Bu nedenle değerler aşağıdaki gibi çevrilir:
- {containername} - depolama kabı; depolama; azurefiles; afsaccount
- {protectedItemName} - azurefileshare; azurefiles
Yedeklenen Azure Dosyaları için kurtarma noktalarını getirme
Yedeklenen Dosya Paylaşımını veya dosyaları geri yüklemek için önce geri yükleme işlemini gerçekleştirmek üzere bir kurtarma noktası seçin. Yedeklenen bir öğenin kullanılabilir kurtarma noktaları Kurtarma Noktası Listesi REST API çağrısı kullanılarak listelenebilir. Tüm ilgili değerleri içeren bir GET işlemidir.
GET https://management.azure.com/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints?api-version=2019-05-13&$filter={$filter}
URI değerlerini aşağıdaki gibi ayarlayın:
- {fabricName}: Azure
- {vaultName}: azurefilesvault
- {containername}: storagecontainer; storage; azurefiles; afsaccount
- {protectedItemName}: azurefileshare; azurefiles
- {ResourceGroupName}: azurefiles
GET URI'sinde gerekli tüm parametreler bulunur. Başka bir istek gövdesine gerek yoktur.
GET https://management.azure.com/Subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/azurefiles/providers/Microsoft.RecoveryServices/vaults/azurefilesvault/backupFabrics/Azure/protectionContainers/StorageContainer;storage;azurefiles;afsaccount/protectedItems/AzureFileShare;azurefiles/recoveryPoints?api-version=2019-05-13
Kurtarma noktalarını getirme için örnek yanıt
GET URI'sı gönderildikten sonra 200 yanıtı döndürülür:
HTTP/1.1" 200 None
'Cache-Control': 'no-cache'
'Pragma': 'no-cache'
'Transfer-Encoding': 'chunked'
'Content-Type': 'application/json'
'Content-Encoding': 'gzip'
'Expires': '-1'
'Vary': 'Accept-Encoding'
'X-Content-Type-Options': 'nosniff'
'x-ms-request-id': 'd68d7951-7d97-4c49-9a2d-7fbaab55233a'
'x-ms-client-request-id': '4edb5a58-47ea-11ea-a27a-0a580af41908, 4edb5a58-47ea-11ea-a27a-0a580af41908'
'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
'Server': 'Microsoft-IIS/10.0'
'X-Powered-By': 'ASP.NET'
'x-ms-ratelimit-remaining-subscription-reads': '11998'
'x-ms-correlation-request-id': 'd68d7951-7d97-4c49-9a2d-7fbaab55233a'
'x-ms-routing-request-id': 'WESTEUROPE:20200205T073708Z:d68d7951-7d97-4c49-9a2d-7fbaab55233a'
'Date': 'Wed, 05 Feb 2020 07:37:08 GMT'
{
“value”:[
{
"eTag": null,
"id": "/Subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/azurefiles/providers/Microsoft.RecoveryServices/vaults/azurefilesvault/backupFabrics/Azure/protectionContainers/StorageContainer;storage;azurefiles;afsaccount/protectedItems/AzureFileShare;azurefiles/recoveryPoints/932881138555802864",
"location": null,
"name": "932881138555802864",
"properties": {
"fileShareSnapshotUri": "https://afsaccount.file.core.windows.net/azurefiles?sharesnapshot=2020-02-04T08:01:35.0000000Z",
"objectType": "AzureFileShareRecoveryPoint",
"recoveryPointSizeInGb": 1,
"recoveryPointTime": "2020-02-04T08:01:35+00:00",
"recoveryPointType": "FileSystemConsistent"
},
"resourceGroup": "azurefiles",
"tags": null,
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"
},
{
"eTag": null,
"id": "/Subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/azurefiles/providers/Microsoft.RecoveryServices/vaults/azurefilesvault/backupFabrics/Azure/protectionContainers/StorageContainer;storage;azurefiles;afsaccount/protectedItems/AzureFileShare;azurefiles/recoveryPoints/932878582606969225",
"location": null,
"name": "932878582606969225",
"properties": {
"fileShareSnapshotUri": "https://afsaccount.file.core.windows.net/azurefiles?sharesnapshot=2020-02-03T08:05:30.0000000Z",
"objectType": "AzureFileShareRecoveryPoint",
"recoveryPointSizeInGb": 1,
"recoveryPointTime": "2020-02-03T08:05:30+00:00",
"recoveryPointType": "FileSystemConsistent"
},
"resourceGroup": "azurefiles",
"tags": null,
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"
},
{
"eTag": null,
"id": "/Subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/azurefiles/providers/Microsoft.RecoveryServices/vaults/azurefilesvault/backupFabrics/Azure/protectionContainers/StorageContainer;storage;azurefiles;afsaccount/protectedItems/AzureFileShare;azurefiles/recoveryPoints/932890167574511261",
"location": null,
"name": "932890167574511261",
"properties": {
"fileShareSnapshotUri": "https://afsaccount.file.core.windows.net/azurefiles?sharesnapshot=2020-02-02T08:03:50.0000000Z",
"objectType": "AzureFileShareRecoveryPoint",
"recoveryPointSizeInGb": 1,
"recoveryPointTime": "2020-02-02T08:03:50+00:00",
"recoveryPointType": "FileSystemConsistent"
},
"resourceGroup": "azurefiles",
"tags": null,
"type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"
},
Kurtarma noktası, yukarıdaki yanıtta {name} alanıyla tanımlanır.
REST API kullanarak tam paylaşım kurtarma
Dosya Paylaşımı'nın tamamını özgün veya alternatif bir konuma geri yüklemek için bu geri yükleme seçeneğini kullanın. Geri yüklemeyi tetikleme bir POST isteğidir ve bu işlemi geri yükleme REST API'sini tetikleyerek gerçekleştirebilirsiniz.
POST https://management.azure.com/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore?api-version=2019-05-13
{containerName} ve {protectedItemName} değerleri burada ayarlanmıştır ve recoveryPointID, yukarıda belirtilen kurtarma noktasının {name} alanıdır.
POST https://management.azure.com/Subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/azurefiles/providers/Microsoft.RecoveryServices/vaults/azurefilesvault/backupFabrics/Azure/protectionContainers/StorageContainer;storage;azurefiles;afsaccount/protectedItems/AzureFileShare%3Bazurefiles/recoveryPoints/932886657837421071/restore?api-version=2019-05-13'
İstek gövdesi oluşturma
Azure Dosyalar için geri yüklemeyi tetikleme için, istek gövdesinin bileşenleri şunlardır:
| Adı | Tür | Açıklama |
|---|---|---|
| Özellikler | Azure Dosya Paylaşım Geri Yükleme İsteği | RestoreRequestResource özellikleri |
İstek gövdesinin tanımlarının tam listesi ve diğer ayrıntılar için Trigger Restore REST API belgesine bakın.
Özgün konuma geri yükleme
Orijinal konuma geri yükleme için istek gövdesi örneği
Aşağıdaki istek gövdesi, Azure Dosyalar geri yüklemesini tetikleme için gereken özellikleri tanımlar:
{
"properties":{
"objectType":"AzureFileShareRestoreRequest",
"recoveryType":"OriginalLocation",
"sourceResourceId":"/subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/AzureFiles/providers/Microsoft.Storage/storageAccounts/afsaccount",
"copyOptions":"Overwrite",
"restoreRequestType":"FullShareRestore"
}
}
Alternatif konuma geri yükleme
Alternatif konum kurtarma için aşağıdaki parametreleri belirtin:
- targetResourceId: Yedeklenen içeriğin geri yüklendiği depolama hesabı. Hedef depolama hesabının kasayla aynı konumda olması gerekir.
- name: Yedeklenen içeriğin geri yüklendiği hedef depolama hesabı içindeki Dosya Paylaşımı.
- targetFolderPath: Verilerin geri yüklendiği Dosya Paylaşımı altındaki klasör.
Alternatif konuma geri yükleme için istek gövdesi örneği
Aşağıdaki istek gövdesi, afsaccount depolama hesabındaki azurefiles Dosya Paylaşımını afaccount1 depolama hesabındaki azurefiles1 Dosya Paylaşımına geri yükler.
{
"properties":{
"objectType":"AzureFileShareRestoreRequest",
"recoveryType":"AlternateLocation",
"sourceResourceId":"/subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/AzureFiles/providers/Microsoft.Storage/storageAccounts/afsaccount",
"copyOptions":"Overwrite",
"restoreRequestType":"FullShareRestore",
"restoreFileSpecs":[
{
"targetFolderPath":"restoredata"
}
],
"targetDetails":{
"name":"azurefiles1",
"targetResourceId":"/subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/AzureFiles/providers/Microsoft.Storage/storageAccounts/afaccount1"
}
}
}
Yanıt
Geri yükleme işleminin tetiklenmesi zaman uyumsuz bir işlemdir. Bu işlem ayrı olarak izlenmesi gereken başka bir işlem oluşturur. İki yanıt döndürür: başka bir işlem oluşturulduğunda 202 (Kabul Edildi) ve bu işlem tamamlandığında 200 (Tamam).
Yanıt örneği
Geri yüklemeyi tetikleme için POST URI'sini gönderdikten sonra, ilk yanıt konum üst bilgisi veya Azure-async-header ile 202 (Kabul Edildi) olur.
HTTP/1.1" 202
'Cache-Control': 'no-cache'
'Pragma': 'no-cache'
'Expires': '-1'
'Location': 'https://management.azure.com/Subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/azurefiles/providers/Microsoft.RecoveryServices/vaults/azurefilesvault/backupFabrics/Azure/protectionContainers/StorageContainer;storage;azurefiles;afsaccount/protectedItems/AzureFileShare;azurefiles/operationResults/68ccfbc1-a64f-4b29-b955-314b5790cfa9?api-version=2019-05-13'
'Retry-After': '60'
'Azure-AsyncOperation': 'https://management.azure.com/Subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/azurefiles/providers/Microsoft.RecoveryServices/vaults/azurefilesvault/backupFabrics/Azure/protectionContainers/StorageContainer;storage;azurefiles;afsaccount/protectedItems/AzureFileShare;azurefiles/operationsStatus/68ccfbc1-a64f-4b29-b955-314b5790cfa9?api-version=2019-05-13'
'X-Content-Type-Options': 'nosniff'
'x-ms-request-id': '2426777d-c5ec-44b6-a324-384f8947460c'
'x-ms-client-request-id': '3c743096-47eb-11ea-ae90-0a580af41908, 3c743096-47eb-11ea-ae90-0a580af41908'
'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
'X-Powered-By': 'ASP.NET'
'x-ms-ratelimit-remaining-subscription-writes': '1198'
'x-ms-correlation-request-id': '2426777d-c5ec-44b6-a324-384f8947460c'
'x-ms-routing-request-id': 'WESTEUROPE:20200205T074347Z:2426777d-c5ec-44b6-a324-384f8947460c'
'Date': 'Wed, 05 Feb 2020 07:43:47 GMT'
Ardından get komutuyla konum üst bilgisini veya Azure-AsyncOperation üst bilgisini kullanarak sonuçta elde edilen işlemi izleyin.
GET https://management.azure.com/Subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/azurefiles/providers/Microsoft.RecoveryServices/vaults/azurefilesvault/backupOperations/68ccfbc1-a64f-4b29-b955-314b5790cfa9?api-version=2016-12-01
İşlem tamamlandığında, yanıt gövdesinde ortaya çıkan geri yükleme işinin kimliği ile birlikte 200 (Tamam) kodunu döndürür.
HTTP/1.1" 200
'Cache-Control': 'no-cache'
'Pragma': 'no-cache'
'Transfer-Encoding': 'chunked'
'Content-Type': 'application/json'
'Content-Encoding': 'gzip'
'Expires': '-1'
'Vary': 'Accept-Encoding'
'X-Content-Type-Options': 'nosniff'
'x-ms-request-id': '41ee89b2-3be4-40d8-8ff6-f5592c2571e3'
'x-ms-client-request-id': '3c743096-47eb-11ea-ae90-0a580af41908, 3c743096-47eb-11ea-ae90-0a580af41908'
'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
'Server': 'Microsoft-IIS/10.0'
'X-Powered-By': 'ASP.NET'
'x-ms-ratelimit-remaining-subscription-reads': '11998'
'x-ms-correlation-request-id': '41ee89b2-3be4-40d8-8ff6-f5592c2571e3'
'x-ms-routing-request-id': 'WESTEUROPE:20200205T074348Z:41ee89b2-3be4-40d8-8ff6-f5592c2571e3'
'Date': 'Wed, 05 Feb 2020 07:43:47 GMT'
{
"id": "/Subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/azurefiles/providers/Microsoft.RecoveryServices/vaults/azurefilesvault/backupJobs/a7e97e42-4e54-4d4b-b449-26fcf946f42c",
"location": null,
"name": "a7e97e42-4e54-4d4b-b449-26fcf946f42c",
"properties": {
"actionsInfo": [
"Cancellable"
],
"activityId": "3c743096-47eb-11ea-ae90-0a580af41908",
"backupManagementType": "AzureStorage",
"duration": "0:00:01.863098",
"endTime": null,
"entityFriendlyName": "azurefiles",
"errorDetails": null,
"extendedInfo": {
"dynamicErrorMessage": null,
"propertyBag": {},
"tasksList": []
},
"jobType": "AzureStorageJob",
"operation": "Restore",
"startTime": "2020-02-05T07:43:47.144961+00:00",
"status": "InProgress",
"storageAccountName": "afsaccount",
"storageAccountVersion": "Storage"
},
"resourceGroup": "azurefiles",
"tags": null,
"type": "Microsoft.RecoveryServices/vaults/backupJobs"
}
Alternatif konum kurtarma için yanıt gövdesi şöyle olur:
{
"id": "/Subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/azurefiles/providers/Microsoft.RecoveryServices/vaults/azurefilesvault/backupJobs/7e0ee41e-6e31-4728-a25c-98ff6b777641",
"location": null,
"name": "7e0ee41e-6e31-4728-a25c-98ff6b777641",
"properties": {
"actionsInfo": [
"Cancellable"
],
"activityId": "6077be6e-483a-11ea-a915-0a580af4ad72",
"backupManagementType": "AzureStorage",
"duration": "0:00:02.171965",
"endTime": null,
"entityFriendlyName": "azurefiles",
"errorDetails": null,
"extendedInfo": {
"dynamicErrorMessage": null,
"propertyBag": {
"Data Transferred (in MB)": "0",
"Job Type": "Recover to an alternate file share",
"Number Of Failed Files": "0",
"Number Of Restored Files": "0",
"Number Of Skipped Files": "0",
"RestoreDestination": "afaccount1/azurefiles1/restoredata",
"Source File Share Name": "azurefiles",
"Source Storage Account Name": "afsaccount",
"Target File Share Name": "azurefiles1",
"Target Storage Account Name": "afaccount1"
},
"tasksList": []
},
"jobType": "AzureStorageJob",
"operation": "Restore",
"startTime": "2020-02-05T17:10:18.106532+00:00",
"status": "InProgress",
"storageAccountName": "afsaccount",
"storageAccountVersion": "ClassicCompute"
},
"resourceGroup": "azurefiles",
"tags": null,
"type": "Microsoft.RecoveryServices/vaults/backupJobs"
}
Yedekleme işi uzun süre çalışan bir işlem olduğundan, REST API belgesi kullanılarak izleme işlerinde açıklandığı gibi izlenmelidir.
REST API kullanarak öğe düzeyinde kurtarma
Tek tek dosyaları veya klasörleri özgün veya alternatif bir konuma geri yüklemek için bu geri yükleme seçeneğini kullanabilirsiniz.
POST https://management.azure.com/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore?api-version=2019-05-13
{containerName} ve {protectedItemName} değerleri burada ayarlanmıştır ve recoveryPointID, yukarıda belirtilen kurtarma noktasının {name} alanıdır.
POST https://management.azure.com/Subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/azurefiles/providers/Microsoft.RecoveryServices/vaults/azurefilesvault/backupFabrics/Azure/protectionContainers/StorageContainer;storage;azurefiles;afsaccount/protectedItems/AzureFileShare%3Bazurefiles/recoveryPoints/932886657837421071/restore?api-version=2019-05-13'
REST API kullanarak öğe düzeyinde kurtarma için istek gövdesi oluşturma
Azure Dosyalar için geri yüklemeyi tetikleme için, istek gövdesinin bileşenleri şunlardır:
| Adı | Tür | Açıklama |
|---|---|---|
| Özellikler | Azure Dosya Paylaşım Geri Yükleme İsteği | RestoreRequestResource özellikleri |
İstek gövdesinin tanımlarının tam listesi ve diğer ayrıntılar için Trigger Restore REST API belgesine bakın.
REST API kullanarak öğe düzeyinde kurtarma için özgün konuma geri yükleme
Aşağıdaki istek gövdesi, afsaccount depolama hesabındaki azurefiles Dosya Paylaşımı'ndaki Restoretest.txt dosyasını geri yüklemektir.
İstek Gövdesi Oluştur
{
"properties":{
"objectType":"AzureFileShareRestoreRequest",
"copyOptions":"Overwrite",
"recoveryType":"OriginalLocation",
"restoreFileSpecs":[
{
"fileSpecType":"File",
"path":"RestoreTest.txt",
"targetFolderPath":null
}
],
"restoreRequestType":"ItemLevelRestore",
"sourceResourceId":"/subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/azurefiles/providers/Microsoft.storage/storageAccounts/afsaccount",
"targetDetails":null
}
}
REST API kullanarak öğe düzeyinde kurtarma için alternatif konuma geri yükleme
Aşağıdaki istek gövdesi, afsaccount depolama hesabındaki azurefiles Dosya Paylaşımı'ndaki Restoretest.txt dosyasını afaccount1 depolama hesabındaki azurefiles1 Dosya Paylaşımı'nın restoredata klasörüne geri yüklemektir.
İstek gövdesi oluşturma
{
"properties":{
"objectType":"AzureFileShareRestoreRequest",
"recoveryType":"AlternateLocation",
"sourceResourceId":"/subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/AzureFiles/providers/Microsoft.Storage/storageAccounts/afsaccount",
"copyOptions":"Overwrite",
"restoreRequestType":"ItemLevelRestore",
"restoreFileSpecs":[
{
"path":"Restore/RestoreTest.txt",
"fileSpecType":"File",
"targetFolderPath":"restoredata"
}
],
"targetDetails":{
"name":"azurefiles1",
"targetResourceId":"/subscriptions/ef4ab5a7-c2c0-4304-af80-af49f48af3d1/resourceGroups/AzureFiles/providers/Microsoft.Storage/storageAccounts/afaccount1"
}
}
}
Yanıt, tam paylaşım geri yüklemeleri için yukarıda açıklanan şekilde işlenmelidir.
Sonraki adımlar
Azure portalı, AzurePowerShell, Azure CLI, REST API kullanarak Azure Dosyalar yedeklemelerini yönetin.