Dsol
Dsol

Reputation: 13

Azure Linux webapp backup restore from storage container fail PowerShell

N:B Manual restore from Portal working well and Powershell restore is not working

I am going to use PowerShell via AzureDevops pipeline jobs to do the restoration.

Azure app hosted in Austalia East Web app backup goes to Australia Southeast where the Azure storage account is configured. Web app name mywebapp

I have configured Azure Linux web app backup to the Azure storage account container. I am trying to restore the backup to webapp.

Here are the steps that I used.

Deleted original web app in Australia East (mywebapp) Created a new web app in the Australia Southeast region with similar configurations.

I am trying to restore using PowerShell (backups are in Azure storage account)

Here is the command I used

Restore-AzWebAppBackup -BlobName 'myapp_202109230658.zip' -Name 'myapplive' -Overwrite -ResourceGroupName 'myapp_migrated_env' -StorageAccountUrl 'https://amyappstorage.blob.core.windows.net/appbackup?sp=r&st=xxxxxxxxxxxxxxxxxxxx0:20:03Z&spr=https&sv=2020-08-04&sr=c&sig=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx%3D' -debug

I used generated SAS URL of the storage container to StorageAccountUrl

This is the error I am getting

    {

"Code": "BadRequest", "Message": "Required parameter AccessKey is missing.", "Target": null, "Details": [ { "Message": "Required parameter AccessKey is missing." }, { "Code": "BadRequest" }, { "ErrorEntity": { "ExtendedCode": "01010", "MessageTemplate": "Required parameter {0} is missing.", "Parameters": [ "AccessKey" ], "InnerErrors": [], "Details": [], "Code": "BadRequest", "Message": "Required parameter AccessKey is missing." } } ], "Innererror": null }

Restore-AzWebAppBackup: Long running operation failed with status 'BadRequest'. DEBUG: AzureQoSEvent: Module: Az.Websites:2.8.2; CommandName: Restore-AzWebAppBackup; PSVersion: 7.1.4; IsSuccess: False; Duration: 00:03:56.0777035; Exception: Long running operation failed with status 'BadRequest'.; DEBUG: Finish sending metric. DEBUG: 2:24:56 AM - RestoreAzureWebAppBackup end processing.

Followed Azure documentation and not working restoring process.

Restore-AzWebAppBackup command does not support any accesskey parameters

Restore-AzWebAppBackup
   [-AppServicePlan <String>]
   [-Databases <DatabaseBackupSetting[]>]
   [-IgnoreConflictingHostNames]
   [-ResourceGroupName] <String>
   [-Name] <String>
   [[-Slot] <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-StorageAccountUrl] <String>
   [-BlobName] <String>
   [-Overwrite]
   [<CommonParameters>]

So I need to fix the issue and restore the web app

Upvotes: 0

Views: 244

Answers (1)

VenkateshDodda
VenkateshDodda

Reputation: 5506

We have tested in our local environment , by creating 2 webapps in central us location with same configurations. we took backup from one of the web app & tried restoring the same configuration to other web app using the below PowerShell cmdlet which is working fine.

Restore-AzWebAppBackup -ResourceGroupName "<resourcegroupName>" -Name "<webNameNeedtobeRestoredto" -StorageAccountUrl "SAStokenurl_for_generatedBackup" -BlobName "<backupFileName>" -Overwrite

"Code": "BadRequest", "Message": "Required parameter AccessKey is missing.", "Target": null, "Details": [ { "Message": "Required parameter AccessKey is missing." }, { "Code": "BadRequest" }, { "ErrorEntity": { "ExtendedCode": "01010", "MessageTemplate": "Required parameter {0} is missing.", "Parameters": [ "AccessKey" ], "InnerErrors": [], "Details": [], "Code": "BadRequest", "Message": "Required parameter AccessKey is missing." } } ], "Innererror": null }

Based on the Azure documentation ,Restore-AzWebAppBackup command doesn't have access key parameter in the cmdlet definition.

We would suggest you to open a discussion over Microsoft Q&A or raise a technical support ticker by following the link where technical support team would help you in troubleshooting the issue from platform end.

Upvotes: 0

Related Questions