Share via


Azure Kaynak Grafı (ARG) kullanarak yedeklemelerinizi sorgulama

Azure Kaynak Grafı (ARG) kullanarak Ek ücret ödemeden Azure kaynaklarınız için yedeklemeyle ilgili bilgileri sorgulayabilirsiniz. ARG, Azure Kaynak Yönetimi'nin kapsamını genişletmek için tasarlanmış bir Azure hizmetidir. Belirli bir abonelik kümesi genelinde büyük ölçekte sorgulama özelliğiyle verimli kaynak keşfi sağlamayı amaçlar. Yedekleme meta verilerinizi sorgulamak için ARG kullanmanın başlıca avantajları şunlardır:

  • Karmaşık filtreleme, gruplandırma ve kaynak özelliklerine göre sıralama ile kaynakları büyük ölçekte sorgulama becerisi.
  • Devam eden yedekleme işleri de dahil olmak üzere yedeklemeleriniz hakkında gerçek zamanlı bilgi edinme olanağı.
  • Yedeklemeyle ilgili verileri Azure Sanal Makineler ve Depolama Hesapları gibi ilgili Azure kaynaklarıyla ilgili yararlı bilgilerle birleştirebilme.

Başlarken

ARG kullanarak yedeklemelerinizi sorgulamaya başlamak için şu adımları izleyin:

  1. Azure portal Kaynak Grafı Gezgini'ni arayın. ARG sorgu düzenleyicisine yeniden yönlendirmek için aynı seçeneği belirleyin.

    Azure Kaynak Grubu'nda arama

    Sol bölmede sorgu için kullanılabilen tüm tablolar (ve ilişkili şemaları) görüntülenir.

    • RecoveryServicesResources tablosu, iş ayrıntıları, yedekleme örneği ayrıntıları gibi yedeklemeyle ilgili kayıtların çoğunu içerir. gibi.
    • Kaynaklar tablosu, Kurtarma Hizmetleri kasaları, Azure Sanal Makineler, Depolama Hesapları gibi tüm üst düzey Azure Kaynakları hakkında bilgi içerir.

    Sorgu için kullanılabilir tablolar ve ilişkili şemalar

  2. Bu tablolardan herhangi birindeki verileri keşfetmek için sorgu düzenleyicisine Kusto sorguları yazın ve Sorgu Çalıştır'a tıklayın.

    Bu sorguların çıkışını Kaynak Grafı Gezgini'nden CSV olarak indirebilirsiniz. Bu sorguları, PowerShell, CLI veya SDK gibi ARG tarafından desteklenen tüm otomasyon istemcilerini kullanarak özel otomasyonda da kullanabilirsiniz. Veri kaynağı olarak ARG kullanarak Azure portal özel çalışma kitapları da oluşturabilirsiniz.

Not

  • En fazla 14 günlük yedekleme/geri yükleme işleri, sorgu için ARG'de kullanılabilir. Geçmiş kayıtları sorgulamak istiyorsanız Azure İzleyici Günlükleri'ni kullanmanızı öneririz.
  • ARG, uygun RBAC haklarına sahip olduğunuz kaynakları sorgulamanıza olanak tanır.

Örnek sorgular

Aşağıda, özel panolarda ve otomasyonlarda kullanabileceğiniz yedekleme verilerinizde bazı örnek ARG sorguları verilmiştir.

Yedekleme için yapılandırılmış tüm Azure VM'lerini listeleme

RecoveryServicesResources 
| where type in~ ('Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems')
| extend vaultName = case(type =~ 'microsoft.dataprotection/backupVaults/backupInstances',split(split(id, '/Microsoft.DataProtection/backupVaults/')[1],'/')[0],type =~ 'Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems',split(split(id, '/Microsoft.RecoveryServices/vaults/')[1],'/')[0],'--')
| extend dataSourceType = case(type=~'Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems',properties.backupManagementType,type =~ 'microsoft.dataprotection/backupVaults/backupInstances',properties.dataSourceSetInfo.datasourceType,'--')
| extend friendlyName = properties.friendlyName
| extend dsResourceGroup = split(split(properties.dataSourceInfo.resourceID, '/resourceGroups/')[1],'/')[0]
| extend dsSubscription = split(split(properties.dataSourceInfo.resourceID, '/subscriptions/')[1],'/')[0]
| extend lastRestorePoint = properties.lastRecoveryPoint
| extend primaryLocation = properties.dataSourceInfo.resourceLocation
| extend policyName = case(type =~ 'Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems',properties.policyName, type =~ 'microsoft.dataprotection/backupVaults/backupInstances', properties.policyInfo.name, '--')
| extend protectionState = properties.currentProtectionState
| where protectionState in~ ('ConfiguringProtection','ProtectionConfigured','ConfiguringProtectionFailed','ProtectionStopped','SoftDeleted','ProtectionError')

Son bir hafta içinde PostgreSQL için Azure Veritabanları Sunucularındaki tüm yedekleme işlerini listeleme

RecoveryServicesResources 
| where type in~ ('Microsoft.DataProtection/backupVaults/backupJobs')
| extend vaultName = case(type =~ 'microsoft.dataprotection/backupVaults/backupJobs',properties.vaultName,type =~ 'Microsoft.RecoveryServices/vaults/backupJobs',split(split(id, '/Microsoft.RecoveryServices/vaults/')[1],'/')[0],'--')
| extend friendlyName = case(type =~ 'microsoft.dataprotection/backupVaults/backupJobs',strcat(properties.dataSourceSetName , '/', properties.dataSourceName),type =~ 'Microsoft.RecoveryServices/vaults/backupJobs', properties.entityFriendlyName, '--')
| extend dataSourceType = case(type =~ 'Microsoft.RecoveryServices/vaults/backupJobs',properties.backupManagementType,type =~ 'microsoft.dataprotection/backupVaults/backupJobs',properties.dataSourceType,'--')
| extend backupInstanceName = properties.backupInstanceId
| extend dsResourceGroup = split(split(properties.dataSourceId, '/resourceGroups/')[1],'/')[0]| extend dsSubscription = split(split(properties.dataSourceId, '/subscriptions/')[1],'/')[0]
| extend status = properties.status
| extend dataSourceId = properties.dataSourceId
| extend primaryLocation = properties.dataSourceLocation
| extend jobStatus = case (properties.status == 'Completed' or properties.status == 'CompletedWithWarnings','Succeeded',properties.status == 'Failed','Failed',properties.status == 'InProgress', 'Started', properties.status), operation = case(type =~ 'microsoft.dataprotection/backupVaults/backupJobs' and tolower(properties.operationCategory) =~ 'backup' and properties.isUserTriggered == 'true',strcat('adhoc',properties.operationCategory),type =~ 'microsoft.dataprotection/backupVaults/backupJobs', tolower(properties.operationCategory), type =~ 'Microsoft.RecoveryServices/vaults/backupJobs' and tolower(properties.operation) =~ 'backup' and properties.isUserTriggered == 'true',strcat('adhoc',properties.operation),type =~ 'Microsoft.RecoveryServices/vaults/backupJobs',tolower(properties.operation), '--'),startTime = todatetime(properties.startTime),endTime = properties.endTime, duration = properties.duration
| project id, name, friendlyName, resourceGroup, vaultName, dataSourceType, operation, jobStatus, startTime, duration, backupInstanceName, dsResourceGroup, dsSubscription, status, primaryLocation, dataSourceId
| where (startTime >= ago(7d))

Yedekleme için yapılandırılmamış tüm Azure VM'lerini listeleme

Resources
| where type in~ ('microsoft.compute/virtualmachines','microsoft.classiccompute/virtualmachines') 
| extend resourceId=tolower(id) 
| join kind = leftouter ( RecoveryServicesResources
| where type == "microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers/protecteditems"
| where properties.backupManagementType == "AzureIaasVM"
| project resourceId = tolower(tostring(properties.sourceResourceId)), backupItemid = id, isBackedUp = isnotempty(id) ) on resourceId 
| extend isProtected = isnotempty(backupItemid)
| where (isProtected == (0))
| project id,name,resourceGroup,location,tags

Azure VM'leri için kullanılan tüm Yedekleme ilkelerini listeleme

RecoveryServicesResources
| where type == 'microsoft.recoveryservices/vaults/backuppolicies'
| extend vaultName = case(type == 'microsoft.recoveryservices/vaults/backuppolicies', split(split(id, 'microsoft.recoveryservices/vaults/')[1],'/')[0],type == 'microsoft.recoveryservices/vaults/backuppolicies', split(split(id, 'microsoft.recoveryservices/vaults/')[1],'/')[0],'--')
| extend datasourceType = case(type == 'microsoft.recoveryservices/vaults/backuppolicies', properties.backupManagementType,type == 'microsoft.dataprotection/backupVaults/backupPolicies',properties.datasourceTypes[0],'--')
| project id,name,vaultName,resourceGroup,properties,datasourceType
| where datasourceType == 'AzureIaasVM'

Belirli bir yedekleme ilkesiyle ilişkili tüm VM'leri listeleme

RecoveryServicesResources
| where type == "microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers/protecteditems"
| project propertiesJSON = parse_json(properties)
| where propertiesJSON.backupManagementType == "AzureIaasVM"
| project VMID=propertiesJSON.sourceResourceId, PolicyID=propertiesJSON.policyId
| where PolicyID == "<ARM ID of the given policy>"

PostgreSQL için Azure Veritabanları Sunucuları için kullanılan tüm Yedekleme ilkelerini listeleme

RecoveryServicesResources 
| where type in~ ('Microsoft.DataProtection/BackupVaults/backupPolicies')
| extend vaultName = case(type =~ 'microsoft.dataprotection/backupVaults/backupPolicies', split(split(id, '/Microsoft.DataProtection/backupVaults/')[1],'/')[0],type =~ 'microsoft.recoveryservices/vaults/backupPolicies', split(split(id, '/Microsoft.RecoveryServices/vaults/')[1],'/')[0],'--')
| extend datasourceType = case(type =~ 'Microsoft.RecoveryServices/vaults/backupPolicies', properties.backupManagementType,type =~ 'microsoft.dataprotection/backupVaults/backupPolicies',properties.datasourceTypes[0],'--')
| project id,name,vaultName,resourceGroup,properties,datasourceType
| where (datasourceType in~ ('Microsoft.DBforPostgreSQL/servers/databases'))

Sonraki adımlar

Azure Kaynak Grafı hakkında daha fazla bilgi edinin