Azure / azure-cli

Azure Command-Line Interface
MIT License
4.01k stars 2.98k forks source link

az vmware script-execution create not splitting combined string into 2 certificate sas urls #25390

Closed fskelly closed 2 weeks ago

fskelly commented 1 year ago

Related command

Main command - az vmware script-execution create

$SSLCertificatesSasUrl1 = 'https://avsgwcsa14a2c2da.blob.core.windows.net/ldaps-blog-post/avs-gwc-dc001.cer?sp=r&st=2023-01-23T11:38:21Z&se=2023-01-23T19:38:21Z&spr=[redacted]]' $SSLCertificatesSasUrlSecure1 = ConvertTo-SecureString $SSLCertificatesSasUrl1 -AsPlainText $SSLCertificatesSasUrl2 = 'https://avsgwcsa14a2c2da.blob.core.windows.net/ldaps-blog-post/avs-gwc-dc002.cer?sp=r&st=2023-01-23T11:38:40Z&se=2023-01-23T19:38:40Z&spr=[redacted]}' $SSLCertificatesSasUrlSecure2 = ConvertTo-SecureString $SSLCertificatesSasUrl2 -AsPlainText

$SSLCertificatesSasUrlCombinedString = $SSLCertificatesSasUrl1 + ',' + $SSLCertificatesSasUrl2

az vmware script-execution create --name fdsages56t42543251-4 --resource-group avs-germanywestcentral-private_cloud_rg --private-cloud avs-fta-gwc --script-cmdlet-id "Microsoft.AVS.Management/5.0.85/New-LDAPSIdentitySource" --timeout P0Y0M0DT0H60M60S --parameter name=GroupName type=Value value='avs-vcenter-admins' --parameter name=SSLCertificatesSasUrl type=SecureValue secureValue=$SSLCertificatesSasUrlCombinedString --parameter name=Credential type=Credential username=[redacted] '[redacted]' --parameter name=BaseDNGroups type=Value value='[redacted]' --parameter name=BaseDNUsers type=Value value='[redacted]' --parameter name=SecondaryUrl type=Value value='ldaps://[redacted]:636' --parameter name=PrimaryUrl type=Value value='ldaps://[redacted]:636' --parameter name=DomainAlias type=Value value='avsemea' --parameter name=DomainName type=Value value='avsemea.com' --parameter name=Name type=Value value='avsemea.com'

Describe the bug $SSLCertificatesSasUrlCombinedString = $SSLCertificatesSasUrl1 + ',' + $SSLCertificatesSasUrl2 When looking into the run-execution status on the Azure Portal, the $SSLCertificatesSasUrlCombinedString is not split according to the "," separator.

To Reproduce Run command after using replacing the redacted values, the $SSLCertificatesSasUrlCombinedString will be treated as a single value, so only 1 certificate will be seen and not 2.

Expected behavior $SSLCertificatesSasUrlCombinedString shoudl be split and process two certificates, one for each ldap server

Environment summary Single AVS deployment with a vnet connected to and ADDS vnet containing 2 ADDS Servers.

ghost commented 1 year ago

Thank you for your feedback. This has been routed to the support team for assistance.

yonzhan commented 1 year ago

route to CXP team

et1975 commented 2 months ago

@fskelly could you check please if it's still an issue? We'll need fresh logs to determine of the CLI or the tail-end scripts are at fault.

et1975 commented 2 weeks ago

There is an issue with the CLI parser where it requires double quotes to escape some characters, to anyone who hits a problem like this the workaround is to wrap double-quotes around single-quotes, ie. "'value'".