Skip to content
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

Deployment fails if there are multiple CosmosDB accounts in the RG #233

Open
aserfass-msft opened this issue Apr 2, 2024 · 1 comment
Open
Assignees

Comments

@aserfass-msft
Copy link

aserfass-msft commented Apr 2, 2024

Brief description of your issue

While executing "New-WinGetSource", there is a bug if there are multiple CosmosDB accounts in the RG (like from multiple attempts to deploy a WinGetSource)

Steps to reproduce

This line throws an error (New-ARMObjects.ps1, line 80):
$CosmosAccountEndpointValue = ConvertTo-SecureString -String $($(Get-AzCosmosDBAccount -ResourceGroupName $AzResourceGroup).DocumentEndpoint) -AsPlainText -Force

If there are multiple attempts to create a WinGetSource in the RG, the above command returns multiple values for the Endpoint and ConcertTo-SecureString can't convert a list so it throw this error:
"ConvertTo-SecureString: Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'String'. Specified method is not supported."

Example: this command
$(Get-AzCosmosDBAccount -ResourceGroupName $AzResourceGroup).DocumentEndpoint

returns:
https://firstdeploymentname.documents.azure.com:443/
https://seconddeploymentname.documents.azure.com:443/

Expected behavior

The code should only be looking for the values from the current deployment rather than all deployments in the RG

Actual behavior

Deployment fails because too many values are returned when one was expected.

Environment

Windows Package Manager v1.7.10861
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22631.3296
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.10861.0
@RDMacLachlan RDMacLachlan self-assigned this Apr 11, 2024
@RDMacLachlan
Copy link
Member

Thank you for this feedback

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

No branches or pull requests

3 participants