Skip to content

[Databricks] Support CMK #12131

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 3 commits into from
Jun 12, 2020
Merged
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
148 changes: 148 additions & 0 deletions src/Databricks/Az.Databricks.format.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,80 @@
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20180401.CreatedBy</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20180401.CreatedBy</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>ApplicationId</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Oid</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Puid</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>ApplicationId</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Oid</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Puid</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20180401.Encryption</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20180401.Encryption</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>KeyName</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>KeySource</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>KeyVaultUri</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>KeyVersion</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>KeyName</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>KeySource</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>KeyVaultUri</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>KeyVersion</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20180401.ErrorDetail</Name>
<ViewSelectedBy>
Expand Down Expand Up @@ -103,6 +177,40 @@
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20180401.ManagedIdentityConfiguration</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20180401.ManagedIdentityConfiguration</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>PrincipalId</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>TenantId</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Type</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>PrincipalId</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>TenantId</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Type</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20180401.Operation</Name>
<ViewSelectedBy>
Expand Down Expand Up @@ -405,6 +513,28 @@
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20180401.WorkspaceEncryptionParameter</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20180401.WorkspaceEncryptionParameter</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>Type</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>Type</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20180401.WorkspaceListResult</Name>
<ViewSelectedBy>
Expand Down Expand Up @@ -434,6 +564,9 @@
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>CreatedDateTime</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>ManagedResourceGroupId</Label>
</TableColumnHeader>
Expand All @@ -443,10 +576,19 @@
<TableColumnHeader>
<Label>UiDefinitionUri</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>WorkspaceId</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>WorkspaceUrl</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>CreatedDateTime</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>ManagedResourceGroupId</PropertyName>
</TableColumnItem>
Expand All @@ -456,6 +598,12 @@
<TableColumnItem>
<PropertyName>UiDefinitionUri</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>WorkspaceId</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>WorkspaceUrl</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
Expand Down
10 changes: 5 additions & 5 deletions src/Databricks/Az.Databricks.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
}
}
if(-not $accountsModule) {
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'1.7.2' } | Measure-Object).Count -gt 0
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'1.7.4' } | Measure-Object).Count -gt 0
if($hasAdequateVersion) {
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 1.7.2 -Scope Global -PassThru
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 1.7.4 -Scope Global -PassThru
}
}
}

if(-not $accountsModule) {
Write-Error "`nThis module requires $accountsName version 1.7.2 or greater. For installation instructions, please see: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps" -ErrorAction Stop
} elseif (($accountsModule.Version -lt [System.Version]'1.7.2') -and (-not $localAccounts)) {
Write-Error "`nThis module requires $accountsName version 1.7.2 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to remove '.PSSharedModules' in your home directory. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
Write-Error "`nThis module requires $accountsName version 1.7.4 or greater. For installation instructions, please see: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps" -ErrorAction Stop
} elseif (($accountsModule.Version -lt [System.Version]'1.7.4') -and (-not $localAccounts)) {
Write-Error "`nThis module requires $accountsName version 1.7.4 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to remove '.PSSharedModules' in your home directory. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
}
Write-Information "Loaded Module '$($accountsModule.Name)'"

Expand Down
1 change: 1 addition & 0 deletions src/Databricks/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Added support for customer-managed keys.

## Version 0.1.0
* the first preview release
Expand Down
10 changes: 6 additions & 4 deletions src/Databricks/check-dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ if(-not $Isolated) {
return
}

function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum) {
function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
if($predicate) {
$module = Get-Module -ListAvailable -Name $moduleName
if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0)) {
$null = New-Item -ItemType Directory -Force -Path $path
Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
if($versionMinimum) {
if ($requiredVersion) {
Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path
}elseif($versionMinimum) {
Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path
} else {
Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path
Expand All @@ -44,8 +46,8 @@ if(Test-Path -Path $localModulesPath) {
$env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
}

DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '1.7.2'
DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -versionMinimum ''
DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '1.7.4'
DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'

$tools = Join-Path $PSScriptRoot 'tools'
$resourceDir = Join-Path $tools 'Resources'
Expand Down
Loading