Skip to content

fix issue 210: deploy-to-aca.ps1: StateStore connection string trunca…#211

Open
sebastianstephan wants to merge 2 commits intoAzureCosmosDB:mainfrom
sebastianstephan:issue-210-connection-string-on-mac
Open

fix issue 210: deploy-to-aca.ps1: StateStore connection string trunca…#211
sebastianstephan wants to merge 2 commits intoAzureCosmosDB:mainfrom
sebastianstephan:issue-210-connection-string-on-mac

Conversation

@sebastianstephan
Copy link
Contributor

Fix

Replace PtrToStringAuto with PtrToStringBSTR, which correctly reads the BSTR length prefix and decodes the full UTF-16 string on all platforms.
Free the BSTR pointer via ZeroFreeBSTR in a finally block.
Remove escaped quotes from the stateStoreConnectionString Bicep parameter.

Testing

Verified on macOS with PowerShell Core — full connection string is now correctly passed to the Bicep deployment.

@sandeepsnairms
Copy link
Collaborator

Hi @sebastianstephan,

The fix doesn't work on Windows. Looks like we need to have separate code sections for Windows and Non-Windows. On windows after applying the fix Step 4 never completes.

…d the script with separate handling of windows and non-windows platforms
@sebastianstephan
Copy link
Contributor Author

@sandeepsnairms I fixed it again and made the script distinguishe between windows systems and non windows systems. For Windows I stick with the original solution from you. For non-windows I picked the alternative approach. The new script for ACA deployment was tested on MacOS and Windows and now works properly on both. Feel free to merge :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants