Add Microsoft Azure VM Dynamic Folder for Royal TS on Windows - #142
Add Microsoft Azure VM Dynamic Folder for Royal TS on Windows#142Ghost93 wants to merge 4 commits into
Conversation
Adds a new Dynamic Folder sample under Dynamic Folder/Microsoft Azure/ Virtual Machines/ that starts one Azure VM if needed, resolves its IP, waits for the selected connection ports, and emits RDP, password-based SSH, and Azure AD-based AzSSH RoyalJSON connections. AzSSH uses the Windows Custom Terminal PTY support requested in royalapplications#141 and available in Royal TS v26.
|
Thanks for this - the deterministic IDs, credential-by-name approach, and validation are well above what most contributions arrive with, and it's nice to see #141 put to use so quickly. I'm going to decline it in its current form, for two design reasons: Not self-contained: Every sample here is a single importable Reload starts the VM. Maybe its possible to make the default false for starting the VM automatically? |
Prepare for embedding the PS7 script inline in the .rdfx wrapper so the sample is a single self-contained importable file. The wrapper update follows in the next commit.
Per reviewer feedback, every sample must be a single importable .rdfx. The PS5.1 wrapper now embeds the full PS7 logic as a single-quoted here-string, writes it to a temp .ps1 file, invokes pwsh.exe -File against it, and deletes the temp file in a finally block. The wrapper also passes an explicit -LogPath under %LOCALAPPDATA% so diagnostics survive across runs (previously derived from $PSScriptRoot). The ScriptPath Custom Property is removed and the Notes are updated to drop the download-and-configure step.
StartIfStopped in the embedded PS7 script now defaults to $false. A new StartVm Custom Property (Text, default 'false') lets users opt in per Dynamic Folder; the wrapper reads it and passes -StartIfStopped to PS7. Reloading a Dynamic Folder without enabling StartVm no longer silently starts a stopped VM. Instead the script throws, the outer catch writes an ERROR log line plus stderr, and exits with code 1 - Royal TS surfaces this as an error icon on the folder with the message in the UI.
|
Thanks for the detailed review, @sargola - both points are valid. I've pushed two follow-up commits addressing them: Self-contained ( Reload no longer starts the VM ( Ready for another look when you have a moment. |
|
Thanks for the follow-up, @Ghost93. The two original design concerns are addressed structurally: the submission is now self-contained, and starting the VM is opt-in. I took another pass through the wrapper, embedded worker, generated notes, and security-sensitive behavior. There is one blocking issue before this can be merged:
I reproduced the complete PS5.1-wrapper-to-PS7-worker path with the default The cleanest fix would be to make A few additional items should be addressed:
Once the Boolean binding issue and the documentation/security points above are addressed, I’m happy to take another look. |
Summary
Adds a new Dynamic Folder export under
Dynamic Folder/Microsoft Azure/Virtual Machines/:Azure VM (PowerShell).rdfx- importable Dynamic Folder wrapper.Source/Get-AzureVmConnections.ps1- shared PowerShell 7 script invoked by the wrapper.The sample manages one Azure virtual machine per Dynamic Folder. On reload it:
with deterministic IDs.
AzSSH uses the Windows Custom Terminal PTY support that was requested in
#141 and shipped in Royal TS v26.
The generated Custom Terminal runs
az ssh vmwith a forced TTY and Bash login shell,so Azure CLI performs Azure AD authentication and the embedded terminal keeps history
and arrow keys working correctly.
Requirements (for end users)
Install-Module Az -Scope CurrentUser) and acached
Connect-AzAccountsession.az loginsession.CredentialName(RDP) andSshCredentialName(SSH).Behavior notes
is emitted.
CustomCommandWin,Font,FontSize) are placed insidethe RoyalJSON
Propertiesdictionary to match the Royal TS 26 rJSON contract.Testing
tools/ToolboxIndexgenerator runs cleanly against the new directory.Azure VM (PowerShell).script.autogen.ps1and the source scriptparse without errors under PowerShell 7.
-TestModeemits three connections (RDP,SSH,CustomTerminal) with the AzSSHCustomCommandWininsidePropertiesand
Font/FontSizescalars.including embedded Custom Terminal AzSSH.
.rdfxin Royal TS 26 and confirms the generatedconnections open.