-
Notifications
You must be signed in to change notification settings - Fork 4k
Add Enable-AdlStoreKeyVault cmdlet and help #4023
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6ac886e
Add Enable-AdlStoreKeyVault cmdlet and help
2616bc4
Re-run stale tests for new recordings.
95f0c1d
Address PR comments
74d1993
Add name alias and regenerate help
f8704da
Merge branch 'preview' of https://github.com/Azure/azure-powershell i…
6b4f696
Add Should process and update help.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12,008 changes: 11,452 additions & 556 deletions
12,008
...osoft.Azure.Commands.DataLakeStore.Test.ScenarioTests.AdlsAliasTests/TestAdlsAccount.json
Large diffs are not rendered by default.
Oops, something went wrong.
4,982 changes: 4,339 additions & 643 deletions
4,982
...ft.Azure.Commands.DataLakeStore.Test.ScenarioTests.AdlsAliasTests/TestAdlsFileSystem.json
Large diffs are not rendered by default.
Oops, something went wrong.
11,878 changes: 11,321 additions & 557 deletions
11,878
.../Microsoft.Azure.Commands.DataLakeStore.Test.ScenarioTests.AdlsTests/TestAdlsAccount.json
Large diffs are not rendered by default.
Oops, something went wrong.
4,912 changes: 4,271 additions & 641 deletions
4,912
...crosoft.Azure.Commands.DataLakeStore.Test.ScenarioTests.AdlsTests/TestAdlsFileSystem.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...nager/DataLakeStore/Commands.DataLakeStore/Commands/EnableAzureRmDataLakeStoreKeyVault.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// ---------------------------------------------------------------------------------- | ||
// | ||
// Copyright Microsoft Corporation | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// ---------------------------------------------------------------------------------- | ||
|
||
using Microsoft.Azure.Commands.DataLakeStore.Models; | ||
using Microsoft.Azure.Commands.DataLakeStore.Properties; | ||
using System.Management.Automation; | ||
|
||
namespace Microsoft.Azure.Commands.DataLakeStore | ||
{ | ||
[Cmdlet(VerbsLifecycle.Enable, "AzureRmDataLakeStoreKeyVault", SupportsShouldProcess = true)] | ||
[Alias("Enable-AdlStoreKeyVault")] | ||
public class EnableAzureDataLakeStoreKeyVault : DataLakeStoreCmdletBase | ||
{ | ||
[Parameter(ValueFromPipelineByPropertyName = true, Position = 0, Mandatory = true, | ||
HelpMessage = "The Data Lake Store account to enable the Key Vault for")] | ||
[ValidateNotNullOrEmpty] | ||
[Alias("AccountName","Name")] | ||
public string Account { get; set; } | ||
|
||
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, | ||
HelpMessage = "Name of resource group associated with the account.")] | ||
[ValidateNotNullOrEmpty] | ||
public string ResourceGroupName { get; set; } | ||
|
||
public override void ExecuteCmdlet() | ||
{ | ||
ConfirmAction( | ||
string.Format(Resources.EnableKeyVault, Account), | ||
Account, | ||
() => DataLakeStoreClient.EnableKeyVault(ResourceGroupName, Account)); | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/ResourceManager/DataLakeStore/Commands.DataLakeStore/Properties/Resources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
...ataLakeStore/Commands.DataLakeStore/help/Enable-AzureRmDataLakeStoreKeyVault.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
--- | ||
external help file: Microsoft.Azure.Commands.DataLakeStore.dll-Help.xml | ||
online version: | ||
schema: 2.0.0 | ||
--- | ||
|
||
# Enable-AzureRmDataLakeStoreKeyVault | ||
|
||
## SYNOPSIS | ||
Attempts to enable a user managed Key Vault for encryption of the specified Data Lake Store account. | ||
|
||
## SYNTAX | ||
|
||
``` | ||
Enable-AzureRmDataLakeStoreKeyVault [-Account] <String> [-ResourceGroupName <String>] [-WhatIf] [-Confirm] | ||
[<CommonParameters>] | ||
``` | ||
|
||
## DESCRIPTION | ||
The **Enable-AzureRmDataLakeStoreKeyVault** cmdlet attempts to enable a user managed Key Vault for encryption of the specified Data Lake Store account. | ||
|
||
## EXAMPLES | ||
|
||
### Example 1: Enable the Key Vault for the ContosoADLS account | ||
``` | ||
PS C:\>Enable-AzureRmDataLakeStoreKeyVault -Name "ContosoADLS" | ||
``` | ||
|
||
This command attempts to enable the user managed Key Vault for the Data Lake Store account named ContosoADLS. | ||
|
||
## PARAMETERS | ||
|
||
### -Account | ||
The Data Lake Store account to enable the user managed Key Vault for | ||
|
||
```yaml | ||
Type: String | ||
Parameter Sets: (All) | ||
Aliases: AccountName, Name | ||
|
||
Required: True | ||
Position: 0 | ||
Default value: None | ||
Accept pipeline input: True (ByPropertyName) | ||
Accept wildcard characters: False | ||
``` | ||
|
||
### -ResourceGroupName | ||
Name of resource group associated with the account. If not specified will attempt to be discovered. | ||
|
||
```yaml | ||
Type: String | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: True (ByPropertyName) | ||
Accept wildcard characters: False | ||
``` | ||
|
||
### -Confirm | ||
Prompts you for confirmation before running the cmdlet. | ||
|
||
```yaml | ||
Type: SwitchParameter | ||
Parameter Sets: (All) | ||
Aliases: cf | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
|
||
### -WhatIf | ||
Shows what would happen if the cmdlet runs. The cmdlet is not run. | ||
|
||
```yaml | ||
Type: SwitchParameter | ||
Parameter Sets: (All) | ||
Aliases: wi | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
|
||
### CommonParameters | ||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). | ||
|
||
## INPUTS | ||
|
||
### System.String | ||
|
||
## OUTPUTS | ||
|
||
## NOTES | ||
|
||
## RELATED LINKS | ||
|
||
[New-AzureRmDataLakeStoreAccount](./New-AzureRmDataLakeStoreAccount.md) | ||
|
||
[Set-AzureRmDataLakeStoreAccount](./Set-AzureRmDataLakeStoreAccount.md) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alias("Name")]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a break from the pattern that we have been using for other ADLA and ADLS commands. Is it expected that we should include a "Name" alias as well now? I am ok with adding it here right now, just want to make sure that I know it should be added to the other cmdlets in the future as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markcowl just spoke with PM. We would rather hold off on this to make sure it makes sense for all of our cmdlets that have an Account/AccountName parameter, since we want to ensure a consistent parameter naming across all the ADL cmdlets for users. Given this, are you ok with accepting this PR without the Alias change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@begoldsm This is just about piping scenarios. If the intention is to allow piping from generic cmdlets, then this needs to be 'Name' to allow piping by PropertyName. Otherwise, not sure why you would have piping ByPropertyName for the 'resourcegroupname' parameter