-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Added "Set Entities" script for Azure Table storage #222
feat: Added "Set Entities" script for Azure Table storage #222
Conversation
✅ Deploy Preview for arcus-scripting ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Todo: Add docs? If so, what folder/files exactly? |
Haven't had a thorough look yet, but can you:
If anything is unclear, let us know and we'll point you in the right direction! By default this script is going to delete all entities and add those configured in the JSON-file. Would it be an idea to use a switch-param to indicate whether the existing entries should be removed? This way this can be created to simply add new entries as well? |
Great stuff! Thanks for your PR! 🎉 Thanks again for your enthusiasm! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for these changes already! 🎉🎉 Looks great. Super job on providing the necessary logs and error handling for missing resources or values. Will bring great user experience to our library. Much appreciated!
Added some suggestions, but the biggest missing link here are tests (both unit and integration tests).
Unit tests could check for regular success/failure paths, while the integration tests can actually run this functionality against a real storage account. The tests would have to setup/teardown entities before/after running the script to make it stable.
Are you up for this, or should we help out?
I'll first let my buddy @pim-simons have a look at this too.
src/Arcus.Scripting.Storage.Table/Scripts/Set-AzTableStorageEntities.ps1
Outdated
Show resolved
Hide resolved
src/Arcus.Scripting.Storage.Table/Scripts/Set-AzTableStorageEntities.ps1
Outdated
Show resolved
Hide resolved
src/Arcus.Scripting.Storage.Table/Scripts/Set-AzTableStorageEntities.ps1
Outdated
Show resolved
Hide resolved
src/Arcus.Scripting.Storage.Table/Scripts/Set-AzTableStorageEntities.ps1
Outdated
Show resolved
Hide resolved
src/Arcus.Scripting.Storage.Table/Scripts/Set-AzTableStorageEntities.ps1
Show resolved
Hide resolved
src/Arcus.Scripting.Storage.Table/Scripts/Set-AzTableStorageEntities.ps1
Outdated
Show resolved
Hide resolved
src/Arcus.Scripting.Storage.Table/Scripts/Set-AzTableStorageEntities.ps1
Show resolved
Hide resolved
src/Arcus.Scripting.Storage.Table/Scripts/Set-AzTableStorageEntities.ps1
Outdated
Show resolved
Hide resolved
docs/preview/03-Features/powershell/azure-storage/azure-storage-table.md
Outdated
Show resolved
Hide resolved
Unit and integration tests have been added, but annoyingly I cannot figure out how to run the DevOps pipeline for this PR 🙈 |
/azp run CI - Arcus.Scripting |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
src/Arcus.Scripting.Storage.Table/Scripts/Set-AzTableStorageEntities.ps1
Outdated
Show resolved
Hide resolved
Triggered it: seems like the built-in PowerShell JSON deserialization expects (always?) a JSON object, while we're testing with arrays. |
I had the same issue on my machine, had to update the Powershell version to |
/azp run CI - Arcus.Scripting |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run CI - Arcus.Scripting |
Azure Pipelines successfully started running 1 pipeline(s). |
…e true or false response for the command
/azp run CI - Arcus.Scripting |
Azure Pipelines successfully started running 1 pipeline(s). |
Strange that this pipeline is not triggered automatically. Could it be that the main branch on the PR-branch is still |
Not really sure, but at least the tests are now all working correctly and finished successfully 😉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super. This looks ready!
Thx for both validation+tests. ❤️
Added new "AzTable-SetEntities" script.
This script will first connect to the specified Azure Storage Account / Table.
Then it will first delete all existing entities on the specified table.
Finally it will insert new entities based on a JSON configuration file.
An example of this configuration file looks like: