Search This Blog

Wednesday, March 1, 2023

ask chatGPT to create azure scripts ~~

 https://platform.openai.com/playground

azure backup scripts 1. Creating a Backup Plan #!/bin/bash # Create a resource group az group create --name myResourceGroup --location eastus # Create a storage account az storage account create --name mystorageaccount --location eastus --resource-group myResourceGroup --sku Standard_LRS # Create a recovery services vault az backup vault create --name myRecoveryServicesVault --resource-group myResourceGroup --location eastus # Register the storage account with the recovery services vault az backup vault storage register --resource-group myResourceGroup --vault-name myRecoveryServicesVault --storage-account mystorageaccount --name myStorageAccount # Create a backup policy az backup policy create --resource-group myResourceGroup --vault-name myRecoveryServicesVault --name myBackupPolicy --recovery-point-retention 7 --backup-management-type AzureIaasVM # Assign the backup policy to the recovery services vault az backup policy assign --resource-group myResourceGroup --vault-name myRecoveryServicesVault --name myBackupPolicy 2. Running a Backup


No comments:

Post a Comment