Azure Gov Backups fail due to incorrect Azure API URL
For Azure government customers that wish to migrate/ utilize Azure blob storage for backups, by default will fail to use the blob.core.windows.govapi endpoint thus causing the backups job to fail
Issue
When attempting to setup Azure Blob Storage as the method for remote backup storage for Immuta on Azure Gov Cloud. You might run into an error like the following:
The real cause is due to Azure Gov Cloud using a different government API endpoint for such operations, you can see the commercial one is used in the above error:
Commercial URL Endpoint: https:// <storage_account>. blob. core. windows. net
Government URL Endpoint: https:// <storage_account>. blob.core.windows.govapi
This causes the operation to immediately fail as it will never reach the blob storage account.
Resolution
Adding the domain: parameter to the azblob backup section to override this will fix the issue. The backup section will look something like the following:
backup:# set to true to enable backupsenabled:truetype:azblobrestore:# set to true to enable restoring from backups on initial installenabled:true# Cron schedule to run backups onschedule:"0 0 * * *"azblob:# We use the azblob go package, which creates a url like this# azblob://container_name/container_prefix/database/ # By using the domain option we can pass the --url-var=domain=foo option to the azblob, changing the base url.domain:"blob.core.windows.govapi"container:"container_name"#containerPrefix: "container_prefix"#azStorageAccount: "storage_account"#azStorageKey: "storage_key"azStorageSASToken:"sas_token"