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

[Don't Merge!][SecureString] [Autorest-based][Az.App] Update AzureFileAccountKey from String to SecureString #26927

Open
wants to merge 2 commits into
base: generation
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/App/App.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ flatten-userassignedidentity: false
disable-transform-identity-type: true

directive:
- from: swagger-document
where: $.definitions.AzureFileProperties.properties.accountKey
transform: $["format"] = "password"
- from: swagger-document
where: $.definitions.Certificate.properties.properties.properties.password
transform: >-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ schema: 2.0.0
# New-AzContainerAppConnectedEnvStorage

## SYNOPSIS
Create storage for a connectedEnvironment.
create storage for a connectedEnvironment.

## SYNTAX

### CreateExpanded (Default)
```
New-AzContainerAppConnectedEnvStorage -ConnectedEnvironmentName <String> -Name <String>
-ResourceGroupName <String> [-SubscriptionId <String>] [-AzureFileAccessMode <String>]
[-AzureFileAccountKey <String>] [-AzureFileAccountName <String>] [-AzureFileShareName <String>]
[-AzureFileAccountKey <SecureString>] [-AzureFileAccountName <String>] [-AzureFileShareName <String>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### CreateViaIdentityConnectedEnvironmentExpanded
```
New-AzContainerAppConnectedEnvStorage -ConnectedEnvironmentInputObject <IAppIdentity> -Name <String>
[-AzureFileAccessMode <String>] [-AzureFileAccountKey <String>] [-AzureFileAccountName <String>]
[-AzureFileAccessMode <String>] [-AzureFileAccountKey <SecureString>] [-AzureFileAccountName <String>]
[-AzureFileShareName <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### CreateViaIdentityExpanded
```
New-AzContainerAppConnectedEnvStorage -InputObject <IAppIdentity> [-AzureFileAccessMode <String>]
[-AzureFileAccountKey <String>] [-AzureFileAccountName <String>] [-AzureFileShareName <String>]
[-AzureFileAccountKey <SecureString>] [-AzureFileAccountName <String>] [-AzureFileShareName <String>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

Expand All @@ -49,7 +49,7 @@ New-AzContainerAppConnectedEnvStorage -ConnectedEnvironmentName <String> -Name <
```

## DESCRIPTION
Create storage for a connectedEnvironment.
create storage for a connectedEnvironment.

## EXAMPLES

Expand Down Expand Up @@ -90,7 +90,7 @@ Accept wildcard characters: False
Storage account key for azure file.

```yaml
Type: System.String
Type: System.Security.SecureString
Parameter Sets: CreateExpanded, CreateViaIdentityConnectedEnvironmentExpanded, CreateViaIdentityExpanded
Aliases:

Expand Down
12 changes: 6 additions & 6 deletions src/App/App.Autorest/docs/New-AzContainerAppManagedEnvStorage.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ schema: 2.0.0
# New-AzContainerAppManagedEnvStorage

## SYNOPSIS
Create storage for a managedEnvironment.
create storage for a managedEnvironment.

## SYNTAX

### CreateExpanded (Default)
```
New-AzContainerAppManagedEnvStorage -EnvName <String> -Name <String> -ResourceGroupName <String>
[-SubscriptionId <String>] [-AzureFileAccessMode <String>] [-AzureFileAccountKey <String>]
[-SubscriptionId <String>] [-AzureFileAccessMode <String>] [-AzureFileAccountKey <SecureString>]
[-AzureFileAccountName <String>] [-AzureFileShareName <String>] [-DefaultProfile <PSObject>] [-Confirm]
[-WhatIf] [<CommonParameters>]
```

### CreateViaIdentityExpanded
```
New-AzContainerAppManagedEnvStorage -InputObject <IAppIdentity> [-AzureFileAccessMode <String>]
[-AzureFileAccountKey <String>] [-AzureFileAccountName <String>] [-AzureFileShareName <String>]
[-AzureFileAccountKey <SecureString>] [-AzureFileAccountName <String>] [-AzureFileShareName <String>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### CreateViaIdentityManagedEnvironmentExpanded
```
New-AzContainerAppManagedEnvStorage -ManagedEnvironmentInputObject <IAppIdentity> -Name <String>
[-AzureFileAccessMode <String>] [-AzureFileAccountKey <String>] [-AzureFileAccountName <String>]
[-AzureFileAccessMode <String>] [-AzureFileAccountKey <SecureString>] [-AzureFileAccountName <String>]
[-AzureFileShareName <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

Expand All @@ -49,7 +49,7 @@ New-AzContainerAppManagedEnvStorage -EnvName <String> -Name <String> -ResourceGr
```

## DESCRIPTION
Create storage for a managedEnvironment.
create storage for a managedEnvironment.

## EXAMPLES

Expand Down Expand Up @@ -90,7 +90,7 @@ Accept wildcard characters: False
Storage account key for azure file.

```yaml
Type: System.String
Type: System.Security.SecureString
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded, CreateViaIdentityManagedEnvironmentExpanded
Aliases:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,34 @@ schema: 2.0.0
# Update-AzContainerAppConnectedEnvStorage

## SYNOPSIS
Update storage for a connectedEnvironment.
update storage for a connectedEnvironment.

## SYNTAX

### UpdateExpanded (Default)
```
Update-AzContainerAppConnectedEnvStorage -ConnectedEnvironmentName <String> -Name <String>
-ResourceGroupName <String> [-SubscriptionId <String>] [-AzureFileAccessMode <String>]
[-AzureFileAccountKey <String>] [-AzureFileAccountName <String>] [-AzureFileShareName <String>]
[-AzureFileAccountKey <SecureString>] [-AzureFileAccountName <String>] [-AzureFileShareName <String>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### UpdateViaIdentityConnectedEnvironmentExpanded
```
Update-AzContainerAppConnectedEnvStorage -ConnectedEnvironmentInputObject <IAppIdentity> -Name <String>
[-AzureFileAccessMode <String>] [-AzureFileAccountKey <String>] [-AzureFileAccountName <String>]
[-AzureFileAccessMode <String>] [-AzureFileAccountKey <SecureString>] [-AzureFileAccountName <String>]
[-AzureFileShareName <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### UpdateViaIdentityExpanded
```
Update-AzContainerAppConnectedEnvStorage -InputObject <IAppIdentity> [-AzureFileAccessMode <String>]
[-AzureFileAccountKey <String>] [-AzureFileAccountName <String>] [-AzureFileShareName <String>]
[-AzureFileAccountKey <SecureString>] [-AzureFileAccountName <String>] [-AzureFileShareName <String>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

## DESCRIPTION
Update storage for a connectedEnvironment.
update storage for a connectedEnvironment.

## EXAMPLES

Expand Down Expand Up @@ -107,7 +107,7 @@ Accept wildcard characters: False
Storage account key for azure file.

```yaml
Type: System.String
Type: System.Security.SecureString
Parameter Sets: (All)
Aliases:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,34 @@ schema: 2.0.0
# Update-AzContainerAppManagedEnvStorage

## SYNOPSIS
Update storage for a managedEnvironment.
update storage for a managedEnvironment.

## SYNTAX

### UpdateExpanded (Default)
```
Update-AzContainerAppManagedEnvStorage -EnvName <String> -Name <String> -ResourceGroupName <String>
[-SubscriptionId <String>] [-AzureFileAccessMode <String>] [-AzureFileAccountKey <String>]
[-SubscriptionId <String>] [-AzureFileAccessMode <String>] [-AzureFileAccountKey <SecureString>]
[-AzureFileAccountName <String>] [-AzureFileShareName <String>] [-DefaultProfile <PSObject>] [-Confirm]
[-WhatIf] [<CommonParameters>]
```

### UpdateViaIdentityExpanded
```
Update-AzContainerAppManagedEnvStorage -InputObject <IAppIdentity> [-AzureFileAccessMode <String>]
[-AzureFileAccountKey <String>] [-AzureFileAccountName <String>] [-AzureFileShareName <String>]
[-AzureFileAccountKey <SecureString>] [-AzureFileAccountName <String>] [-AzureFileShareName <String>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### UpdateViaIdentityManagedEnvironmentExpanded
```
Update-AzContainerAppManagedEnvStorage -ManagedEnvironmentInputObject <IAppIdentity> -Name <String>
[-AzureFileAccessMode <String>] [-AzureFileAccountKey <String>] [-AzureFileAccountName <String>]
[-AzureFileAccessMode <String>] [-AzureFileAccountKey <SecureString>] [-AzureFileAccountName <String>]
[-AzureFileShareName <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

## DESCRIPTION
Update storage for a managedEnvironment.
update storage for a managedEnvironment.

## EXAMPLES

Expand Down Expand Up @@ -107,7 +107,7 @@ Accept wildcard characters: False
Storage account key for azure file.

```yaml
Type: System.String
Type: System.Security.SecureString
Parameter Sets: (All)
Aliases:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Describe 'AzContainerAppConnectedEnvStorage' {
It 'CreateExpanded' {
{
# $storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $env.resourceGroupConnected -AccountName $env.storageAccount2).Value[0]
$storageAccountKey = "1234"
$storageAccountKey = "1234" | ConvertTo-SecureString -AsPlainText

$config = New-AzContainerAppConnectedEnvStorage -ConnectedEnvironmentName $env.connectedEnv1 -ResourceGroupName $env.resourceGroupConnected -Name $env.connectedEnvStorage -AzureFileAccessMode 'ReadWrite' -AzureFileAccountKey $storageAccountKey -AzureFileAccountName azpstestsa -AzureFileShareName azps-rw-sharename
$config.AzureFileShareName | Should -Be "azps-rw-sharename"
Expand All @@ -45,7 +45,7 @@ Describe 'AzContainerAppConnectedEnvStorage' {
It 'UpdateExpanded' {
{
# $storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $env.resourceGroupConnected -AccountName $env.storageAccount2).Value[0]
$storageAccountKey = "1234"
$storageAccountKey = "1234" | ConvertTo-SecureString -AsPlainText

$config = Update-AzContainerAppConnectedEnvStorage -ConnectedEnvironmentName $env.connectedEnv1 -ResourceGroupName $env.resourceGroupConnected -Name $env.connectedEnvStorage -AzureFileAccessMode 'ReadWrite' -AzureFileAccountKey $storageAccountKey -AzureFileAccountName azpstestsa -AzureFileShareName azps-rw-sharename
$config.AzureFileShareName | Should -Be "azps-rw-sharename"
Expand All @@ -56,7 +56,7 @@ Describe 'AzContainerAppConnectedEnvStorage' {
It 'UpdateViaIdentityExpanded' {
{
# $storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $env.resourceGroupConnected -AccountName $env.storageAccount2).Value[0]
$storageAccountKey = "1234"
$storageAccountKey = "1234" | ConvertTo-SecureString -AsPlainText
$config = Get-AzContainerAppConnectedEnvStorage -ConnectedEnvironmentName $env.connectedEnv1 -ResourceGroupName $env.resourceGroupConnected -Name $env.connectedEnvStorage

$config = Update-AzContainerAppConnectedEnvStorage -InputObject $config -AzureFileAccessMode 'ReadWrite' -AzureFileAccountKey $storageAccountKey -AzureFileAccountName azpstestsa -AzureFileShareName azps-rw-sharename
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Describe 'AzContainerAppManagedEnvStorage' {
It 'CreateExpanded' {
{
# $storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $env.resourceGroupManaged -AccountName $env.storageAccount1).Value[0]
$storageAccountKey = "1234"
$storageAccountKey = "1234" | ConvertTo-SecureString -AsPlainText

$config = New-AzContainerAppManagedEnvStorage -EnvName $env.managedEnv1 -ResourceGroupName $env.resourceGroupManaged -Name $env.managedEnvStorage -AzureFileAccessMode 'ReadWrite' -AzureFileAccountKey $storageAccountKey -AzureFileAccountName $env.storageAccount1 -AzureFileShareName azps-rw-sharename
$config.AzureFileShareName | Should -Be "azps-rw-sharename"
Expand All @@ -45,7 +45,7 @@ Describe 'AzContainerAppManagedEnvStorage' {
It 'UpdateExpanded' {
{
# $storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $env.resourceGroupManaged -AccountName $env.storageAccount1).Value[0]
$storageAccountKey = "1234"
$storageAccountKey = "1234" | ConvertTo-SecureString -AsPlainText

$config = Update-AzContainerAppManagedEnvStorage -EnvName $env.managedEnv1 -ResourceGroupName $env.resourceGroupManaged -Name $env.managedEnvStorage -AzureFileAccessMode 'ReadWrite' -AzureFileAccountKey $storageAccountKey -AzureFileAccountName $env.storageAccount1 -AzureFileShareName azps-rw-sharename
$config.AzureFileShareName | Should -Be "azps-rw-sharename"
Expand All @@ -55,7 +55,7 @@ Describe 'AzContainerAppManagedEnvStorage' {
It 'UpdateViaIdentityExpanded' {
{
# $storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $env.resourceGroupManaged -AccountName $env.storageAccount1).Value[0]
$storageAccountKey = "1234"
$storageAccountKey = "1234" | ConvertTo-SecureString -AsPlainText
$config = Get-AzContainerAppManagedEnvStorage -EnvName $env.managedEnv1 -ResourceGroupName $env.resourceGroupManaged -Name $env.managedEnvStorage

$config = Update-AzContainerAppManagedEnvStorage -InputObject $config -AzureFileAccessMode 'ReadWrite' -AzureFileAccountKey $storageAccountKey -AzureFileAccountName $env.storageAccount1 -AzureFileShareName azps-rw-sharename
Expand Down
Loading