Azure / Azure/azure-quickstart-templates

Cannot convert the value of type "System.String" to type "System.Security.SecureString".

Open
#4,968 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Bicep
Stars
14.9k
Forks
16.2k
Avg merge
6d 21h
Merged PRs (30d)
6

Description

[101-webapp-managed-mysql](https://raw.githubusercontent.com/azure/azure-quickstart-templates/master/101-webapp-managed-mysql/azuredeploy.json)

### Issue Details

I'm trying to use this template with the following code (so far):

`New-AzureRmResourceGroupDeployment -Verbose -Force -Name $appName -siteName $siteName -administratorLogin $dbUser -administratorLoginPassword $dbPass -ResourceGroupName $resGrp -TemplateUri https://raw.githubusercontent.com/azure/azure-quickstart-templates/master/101-webapp-managed-mysql/azuredeploy.json`

Here's the problem - with the parameter administratorLoginPassword - if I pass a string I'm told the string cannot be converted to securestring. That makes complete sense! So - I pass in a securestring and I'm told:

> ValidateLength attribute cannot be applied to a parameter that is not a string or string[] parameter. Make the parameter a string or string[] parameter.

So where I am right now is:

If I pass a string - I'm told it needs to be a securestring.
If I pass a securestring - I'm told it needs to be a string.

I'm obviously missing something here - can anyone help? 👍

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the 101-webapp-managed-mysql/azuredeploy.json template and the New-AzureRmResourceGroupDeployment command shown in the issue. Check how administratorLoginPassword is declared and passed through the deployment; done means the template and command agree on the accepted password type and the reported validation errors no longer occur.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.