Share via


Azure PowerShell을 사용하여 웹에 대한 백업 삭제

이 샘플 스크립트는 App Service에 관련 리소스가 있는 웹앱을 만든 다음 이에 대한 일회성 백업을 만듭니다.

이 스크립트를 실행하려면 웹앱의 기존 백업이 필요합니다. 만들려면 웹앱 백업 또는 웹앱에 대한 예약된 백업 만들기를 참조하세요.

샘플 스크립트

참고 항목

Azure Az PowerShell 모듈을 사용하여 Azure와 상호 작용하는 것이 좋습니다. 시작하려면 Azure PowerShell 설치를 참조하세요. Az PowerShell 모듈로 마이그레이션하는 방법에 대한 자세한 내용은 Azure PowerShell을 AzureRM에서 Azure로 마이그레이션을 참조하세요.

# This sample script creates a web app in App Service with its related resources, and then creates a one-time backup for it.
# To run this script, you need an existing backup for a web app. To create one, see Backup up a web app or Create a scheduled backup for a web app.

$resourceGroupName = "myResourceGroup"
$webappname = "<replace-with-your-app-name>"

# List statuses of all backups that are complete or currently executing.
Get-AzWebAppBackupList -ResourceGroupName $resourceGroupName -Name $webappname

# Note the BackupID property of the backup you want to delete

# Delete the backup by specifying the BackupID
Remove-AzWebAppBackup -ResourceGroupName $resourceGroupName -Name $webappname `
-BackupId '<replace-with-BackupID>'

배포 정리

스크립트 샘플을 실행한 후에는 다음 명령을 사용하여 리소스 그룹, 웹앱 및 모든 관련된 리소스를 제거할 수 있습니다.

Remove-AzResourceGroup -Name myResourceGroup -Force

스크립트 설명

이 스크립트는 다음 명령을 사용합니다. 테이블에 있는 각 명령은 명령에 해당하는 문서에 연결됩니다.

명령 주의
Get-AzWebAppBackupList 웹앱의 백업 목록을 가져옵니다.
Remove-AzWebAppBackup 웹앱의 지정된 백업을 제거합니다.

다음 단계

Azure PowerShell 모듈에 대한 자세한 내용은 Azure PowerShell 설명서를 참조하세요.

Azure App Service Web Apps에 대한 추가 Azure PowerShell 샘플은 Azure PowerShell 샘플에서 확인할 수 있습니다.