Needs to run copy only backup on secondary node.
Backups to Azure fails with the error "UploadCompete error: The remote server returned an error: (413) The request body is too large and exceeds the maximum permissible limit.."
Check if the database is part of an availability group and is not enabled for read access. LiteSpeed will not be able to gather information about the database size and it will upload the backup in one stripe exceeding Azur's limits.
Workarounds:
1. Enable read-only access to the database in the availability group.
2. Run the backup with striping. Please note that number of stripes used depends on backup/database size. The following calculation will determine the number of files to stripe the backup across. The below will calculate a safe number of stripes to use even in the case of attached files.
Number of stripes = <db size> / (<max allowed size for file/blod at cloud in GB> -5GB)
Script example:
exec master.dbo.xp_backup_database
@database = N'AdventureWorks2010',
@backupname = N'AdventureWorks2012 - Full Database Backup',
@compression = 8,
@filename = N'AdventureWorks2012_1.bak',
@filename = N'AdventureWorks2012_2.bak',
@CloudVendor = N'AzureBlob',
@CloudAccessKeyEnc = N'accesskeyenc',
@cloudSecretKeyEnc = N'secrekeyenc',
@CloundBucketName = N'work',
@AzureBlogType = N'Block',
@UseSSL = 1, @init = 0, @OLRMAP = 1,
@with = N'STATS = 10', @with = N'COPY_ONLY', @with = N'CHECKSUM',
@logging = 2--,--@verify = 1