Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.27k stars 3.87k forks source link

[AppServices] RestoreAzureWebAppSnapshot fetch the data from Microsoft.Web RP similar to other commands #26685

Open vkarasala opened 1 week ago

vkarasala commented 1 week ago

[AppServices] RestoreAzureWebAppSnapshot fetch the data from Microsoft.Web RP similar to other commands

Description

Currently to fetch the source web app information we rely on Azure Resources API(https://learn.microsoft.com/en-us/rest/api/resources/resources/list?view=rest-resources-2021-04-01).

The problem with above API is that the response is paginated, and filter is applied at backend on the paginated block. So, for example, if customer has 1000 sites, in first batch ARM fetches 100 from RP and applies the filter provided. If no results found, an empty collection is returned with nextLink to further query. If the customers have 1000's of resources, we end up making a lot of calls and get no data. The changes are to simplify that process.

For background, we changed to use ARM cache 5 years ago. This is because during an outage our RP is not functional, but ARM cache can help with required data for restore.

So, the changes still retain such handling but improve by calling to WEB RP to get the required data if it functional. Fallback will be made to ARM cache if WebRP is not functional.

Tested locally

image image

Mandatory Checklist

azure-client-tools-bot-prd[bot] commented 1 week ago
️✔️Az.Accounts >
> ️✔️Build > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
️✔️Az.Network >
> ️✔️Build > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
️✔️Az.Websites >
> ️✔️Build > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
>
> ️✔️Breaking Change Check > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
>
> ️✔️Signature Check > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
>
> ️✔️Help File Existence Check > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
>
> ️✔️File Change Check > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
>
> ️✔️UX Metadata Check > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
>
> ️✔️Test > >>
>> ️✔️PowerShell Core - Linux >> >> >>
>>
>> ️✔️PowerShell Core - MacOS >> >> >>
>>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
VeryEarly commented 1 week ago

please update changelog: https://github.com/vkarasala/azure-powershell/blob/user/vkarasala/restore-snapshot-to-user-web-rp/src/Websites/Websites/ChangeLog.md

VeryEarly commented 1 week ago

/azp run

azure-pipelines[bot] commented 1 week ago
Azure Pipelines successfully started running 3 pipeline(s).
vkarasala commented 1 week ago

please update changelog: https://github.com/vkarasala/azure-powershell/blob/user/vkarasala/restore-snapshot-to-user-web-rp/src/Websites/Websites/ChangeLog.md

Updated.

jsharmaMSFT commented 1 week ago

LGTM. No mocks/tests to add here?

vkarasala commented 1 week ago

LGTM. No mocks/tests to add here?

There are none defined, also it is understandable as the Snapshots are only available after an hour, tests are hard to define for such.

VeryEarly commented 5 days ago

/azp run

azure-pipelines[bot] commented 5 days ago
Azure Pipelines successfully started running 3 pipeline(s).