Skip to content

AvoidUsingConvertToSecureStringWithPlainText when set azure keyvault secret #1948

@alexryazanov

Description

@alexryazanov

AvoidUsingConvertToSecureStringWithPlainText error is triggered when set azure keyvault secret from the example:
https://learn.microsoft.com/en-us/powershell/module/az.keyvault/set-azkeyvaultsecret?view=azps-10.4.1#example-1-modify-the-value-of-a-secret-using-default-attributes
How we can replace:
$Secret = ConvertTo-SecureString -String 'Password' -AsPlainText -Force Set-AzKeyVaultSecret -VaultName 'Contoso' -Name 'ITSecret' -SecretValue $Secret
to avoid triggering the error?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions