Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.86k forks source link

Get-AzWebAppSnapshot and Restore-AzWebAppSnapshot fail when `-UseDisasterRecovery` is passed. #26267

Open danbuchal-mom opened 1 month ago

danbuchal-mom commented 1 month ago

Description

Passing -UseDisasterRecovery causes InternalServerError (The remote name could not be resolved: 'waws-prod-bn1-013dr.api.azurewebsites.windows.net')

This issue is also noted in the ScenarioTests: https://github.com/Azure/azure-powershell/blob/3d831ac6827ded389166060fc67e1b40930f66ad/src/Websites/Websites.Test/ScenarioTests/WebAppBackupRestoreTests.ps1#L356C12-L356C32

Issue script & Debug output

$snapshot = (Get-AzWebAppSnapshot -Name $SourceName -ResourceGroupName $SourceResourceGroupName -UseDisasterRecovery -Debug)[0]

DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions/[redacted]/resourceGroups/[redacted]/providers/Microsoft.Web/sites/[redacted]/snapshotsdr?api-version=2021-01-15

Headers:
x-ms-client-request-id        : ffd7df45-405c-49f2-a736-ba626bf83f65
Accept-Language               : en-US

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
InternalServerError

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-AspNet-Version              : 4.0.30319
X-Powered-By                  : ASP.NET
x-ms-failure-cause            : service
x-ms-ratelimit-remaining-subscription-reads: 249
x-ms-ratelimit-remaining-subscription-global-reads: 3749
x-ms-request-id               : e659fbe0-a538-4d01-9959-2f993ceb6cb6
x-ms-correlation-request-id   : e659fbe0-a538-4d01-9959-2f993ceb6cb6
x-ms-routing-request-id       : EASTUS:20241010T184426Z:e659fbe0-a538-4d01-9959-2f993ceb6cb6
X-Content-Type-Options        : nosniff
X-Cache                       : CONFIG_NOCACHE
X-MSEdge-Ref                  : Ref A: FCBA7D33FCA746E487E6D4567DAD0586 Ref B: BL2AA2010202039 Ref C: 2024-10-10T18:44:26Z
Date                          : Thu, 10 Oct 2024 18:44:25 GMT

Body:
{
  "Code": "InternalServerError",
  "Message": "The remote name could not be resolved: 'waws-prod-bn1-013dr.api.azurewebsites.windows.net'",
  "Target": null,
  "Details": [
    {
      "Message": "The remote name could not be resolved: 'waws-prod-bn1-013dr.api.azurewebsites.windows.net'"
    },
    {
      "Code": "InternalServerError"
    },
    {
      "ErrorEntity": {
        "Code": "InternalServerError",
        "Message": "The remote name could not be resolved: 'waws-prod-bn1-013dr.api.azurewebsites.windows.net'"
      }
    }
  ],
  "Innererror": null
}

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.23
PSEdition                      Core
GitCommitId                    7.2.23
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     3.0.2                 Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     5.1.0                 Az.KeyVault                         {Add-AzKeyVaultCertificate, Add-AzKeyVaultCertificateContact, Add-AzKeyVaultKey, Add-AzKe…
Script     6.13.0                Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…}
Script     1.2.2                 Az.TrafficManager                   {Add-AzTrafficManagerCustomHeaderToEndpoint, Add-AzTrafficManagerCustomHeaderToProfile, A…
Script     3.1.2                 Az.Websites                         {Add-AzWebAppAccessRestrictionRule, Add-AzWebAppTrafficRouting, Edit-AzWebAppBackupConfig…

Error output

Message        : Operation returned an invalid status code 'InternalServerError'
StackTrace     :    at Microsoft.Azure.Management.WebSites.WebAppsOperations.ListSnapshotsFromDRSecondaryWithHttpMessagesAsync(String resourceGroupName,        
                 String name, Dictionary`2 customHeaders, CancellationToken cancellationToken)
                    at Microsoft.Azure.Management.WebSites.WebAppsOperationsExtensions.ListSnapshotsFromDRSecondaryAsync(IWebAppsOperations operations, String  
                 resourceGroupName, String name, CancellationToken cancellationToken)
                    at Microsoft.Azure.Management.WebSites.WebAppsOperationsExtensions.ListSnapshotsFromDRSecondary(IWebAppsOperations operations, String       
                 resourceGroupName, String name)
                    at Microsoft.Azure.Commands.WebApps.Utilities.WebsitesClient.GetSiteSnapshots(String resourceGroupName, String webSiteName, String
                 slotName, Boolean useDrSecondary)
                    at Microsoft.Azure.Commands.WebApps.Cmdlets.BackupRestore.GetAzureWebAppSnapshot.ExecuteCmdlet()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : Microsoft.Azure.Management.WebSites.Models.DefaultErrorResponseException
InvocationInfo : {Get-AzWebAppSnapshot}
Line           :         $snapshot = (Get-AzWebAppSnapshot -Name $SourceName -ResourceGroupName $SourceResourceGroupName -UseDisasterRecovery -Debug)[0]  
microsoft-github-policy-service[bot] commented 1 month ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @antcp, @AzureAppServiceCLI.