The Enable-AzRecoveryServicesBackupAutoProtection cmdlet sets up automatic protection of current and any future SQL DBs within the given instance with the supplied policy.
This command allows users to automatically protect all existing unprotected SQL DBs and any DB which will be added later with the given policy. Since the instruction is to back up all future DBs, the operation is done at a SQLInstance level, Azure backup service will then regularly scan auto-protected containers for any new DBs and automatically protect them.
The first cmdlet gets a default policy object, and then stores it in the $Pol variable.
The second cmdlet fetches the relevant SQLInstance which is a protectable item. The 3rd command then sets up auto protection for this instance using the policy in $Pol.
Example 2
This commands allows users to automatically protect all existing unprotected DBs and any DB which will be added later with the given policy. (autogenerated)
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.