lombiq / infrastructure-scripts Goto Github PK
View Code? Open in Web Editor NEWPowerShell modules for managing the hosting environment of Orchard (Core) applications in Azure.
License: BSD 3-Clause "New" or "Revised" License
PowerShell modules for managing the hosting environment of Orchard (Core) applications in Azure.
License: BSD 3-Clause "New" or "Revised" License
Similarly to how Set-AzureWebAppStorageContentFromStorageWithAzCopy
became an alternative to Set-AzureWebAppStorageContentFromStorage
in #20.
...because it didn't add the "Fixes" link to #28. You can copy this: https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/actions/runs/6488451487/workflow
When running Copy-AzureWebAppSqlDatabase
there's a deprecation warning coming from the Set-AzSqlDatabase
cmdlet (in a GitHub Actions workflow) I get the below warning:
WARNING: Upcoming breaking changes in the cmdlet 'Set-AzSqlDatabase' :
- The output type 'Microsoft.Azure.Commands.Sql.Database.Model.AzureSqlDatabaseModel' is changing
- The following properties in the output type are being deprecated : 'BackupStorageRedundancy'
- The following properties are being added to the output type : 'CurrentBackupStorageRedundancy' 'RequestedBackupStorageRedundancy'
- The change is expected to take effect from the version : '3.0.0'
The scripts under PowerShell/Azure/Sql
are built to work with databases whose connection strings are read from the consumer Web App's configuration. These scripts assume that the DB server lives in the same Resource Group as the App, which is true for our own Azure resources, but it cannot be enforced. Let's make the necessary changes to support this scenario. BTW Blob Storage Accounts don't have the same problem, because those are accessed by their name only, regardless of the Resource Group they are in.
The common entry point for these operations is Get-AzureWebAppSqlDatabase
: this module needs to have a non-mandatory parameter added called DatabaseResourceGroupName
, which is initialized to the existing ResourceGroupName
parameter. Then, DatabaseResourceGroupName
should be passed to the Get-AzSqlDatabase
command instead of ResourceGroupName
.
The same concept has to be applied to every module that calls Get-AzureWebAppSqlDatabase
.
Copy-AzureWebAppSqlDatabase
is a special case, since the copy operation has a source and a target, so it needs two parameters added instead of just one.
Better solution:
Get-AzureWebAppSqlDatabaseConnection
was updated to grab the Server by its name (in contrast to fetching a Database, this one doesn't require a ResourceGroupName parameter), and pass on its ResourceGroupName
property in the return object. The scripts calling it (including Get-AzureWebAppSqlDatabase
) and/or Get-AzureWebAppSqlDatabase
were updated to use and/or pass on this new ResourceGroupName
property.
Starting from @DAud-IcI's feedback under #5, several code styling patterns in older scripts/modules need to be brought up to par with our conventions, e.g.:
throw
and Write-Warning/Error
commands.Currently, commands have a pattern of catching exceptions, displaying an error message, then rethrowing the exception. See e.g. here or here.
When executed from a PS script, this results in outputs like this:
You see the error message, but no details.
I'd be better to also display the exception details in each of these cases, so you have a better chance of debugging the issue.
Set-AzureWebAppStorageContentFromStorage
copies blobs one by one. If you have a lot of files (like Orchard Media files), then this will take a lot of time, even if the total size is not that big (like taking >30 minutes to copy 13k blobs with 2,6 GiB total size).
Let's make this faster somehow. E.g., can containers be copied at once too? Or at least not each blob individually? Or can this loop be parallelized? While I don't know, I doubt any of the resources, including network, are maxed out on the CI machine during such a copy, so parallelization may help.
There might be some throttling as well, since the copy process might get stuck on files that are otherwise trivial.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.