Skip to content

Commit

Permalink
Migrate Databricks from generation to main (#26830)
Browse files Browse the repository at this point in the history
* Move Databricks to main

* Update ChangeLog.md

* Update ChangeLog.md

---------

Co-authored-by: Yabo Hu <yabhu@microsoft.com>
  • Loading branch information
azure-powershell-bot and VeryEarly authored Dec 4, 2024
1 parent 82440fb commit 31b4221
Show file tree
Hide file tree
Showing 25 changed files with 437 additions and 183 deletions.
7 changes: 4 additions & 3 deletions src/Databricks/Databricks.Autorest/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ if(-not $Isolated -and -not $Debugger) {
$binFolder = Join-Path $PSScriptRoot 'bin'
$objFolder = Join-Path $PSScriptRoot 'obj'

$isAzure = [System.Convert]::ToBoolean('true')

if(-not $Debugger) {
Write-Host -ForegroundColor Green 'Cleaning build folders...'
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
Expand Down Expand Up @@ -143,7 +145,7 @@ if($NoDocs) {
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
}
$null = New-Item -ItemType Directory -Force -Path $docsFolder
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
$addComplexInterfaceInfo = !$isAzure
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
}

Expand Down Expand Up @@ -178,5 +180,4 @@ if (-not $DisableAfterBuildTasks){
}
}


Write-Host -ForegroundColor Green '-------------Done-------------'
Write-Host -ForegroundColor Green '-------------Done-------------'
Original file line number Diff line number Diff line change
Expand Up @@ -315,33 +315,36 @@ function New-AzDatabricksWorkspace {
${VnetAddressPrefix},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.EnhancedSecurityMonitoringValue])]
[Alias('EnhancedSecurityMonitoringValue')] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.EnhancedSecurityMonitoringValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.EnhancedSecurityMonitoringValue]
# Status of Enhanced Security Monitoring feature.
${EnhancedSecurityMonitoringValue},
${EnhancedSecurityMonitoring},

[Parameter()]
[Alias('AutomaticClusterUpdateValue')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.AutomaticClusterUpdateValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.AutomaticClusterUpdateValue]
# Status of automated cluster updates feature.
${AutomaticClusterUpdateValue},
${AutomaticClusterUpdate},

[Parameter()]
[Alias('ComplianceSecurityProfileComplianceStandard')]
[AllowEmptyCollection()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceStandard])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceStandard[]]
# Compliance standards associated with the workspace.
${ComplianceSecurityProfileComplianceStandard},
${ComplianceStandard},

[Parameter()]
[Alias('ComplianceSecurityProfileValue')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceSecurityProfileValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceSecurityProfileValue]
# Status of Compliance Security Profile feature.
${ComplianceSecurityProfileValue},
${EnhancedSecurityCompliance},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
Expand Down Expand Up @@ -433,6 +436,22 @@ function New-AzDatabricksWorkspace {

process {
try {
if ($PSBoundParameters.Remove('EnhancedSecurityMonitoring'))
{
$PSBoundParameters.Add('EnhancedSecurityMonitoringValue', $EnhancedSecurityMonitoring)
}
if ($PSBoundParameters.Remove('AutomaticClusterUpdate'))
{
$PSBoundParameters.Add('AutomaticClusterUpdateValue', $AutomaticClusterUpdate)
}
if ($PSBoundParameters.Remove('ComplianceStandard'))
{
$PSBoundParameters.Add('ComplianceSecurityProfileComplianceStandard', $ComplianceStandard)
}
if ($PSBoundParameters.Remove('EnhancedSecurityCompliance'))
{
$PSBoundParameters.Add('ComplianceSecurityProfileValue', $EnhancedSecurityCompliance)
}
if (-not $PSBoundParameters.ContainsKey('ManagedResourceGroupName')) {
$randomStr = -join ((48..57) + (97..122) | Get-Random -Count 13 | % { [char]$_ })
$manageResourceGroupName = "databricks-rg-{0}-{1}" -f $PSBoundParameters["Name"], $randomStr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,33 +257,36 @@ function Update-AzDatabricksWorkspace {
${EnableNoPublicIP},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.EnhancedSecurityMonitoringValue])]
[Alias('EnhancedSecurityMonitoringValue')] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.EnhancedSecurityMonitoringValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.EnhancedSecurityMonitoringValue]
# Status of Enhanced Security Monitoring feature.
${EnhancedSecurityMonitoringValue},
${EnhancedSecurityMonitoring},

[Parameter()]
[Alias('AutomaticClusterUpdateValue')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.AutomaticClusterUpdateValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.AutomaticClusterUpdateValue]
# Status of automated cluster updates feature.
${AutomaticClusterUpdateValue},
${AutomaticClusterUpdate},

[Parameter()]
[Alias('ComplianceSecurityProfileComplianceStandard')]
[AllowEmptyCollection()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceStandard])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceStandard[]]
# Compliance standards associated with the workspace.
${ComplianceSecurityProfileComplianceStandard},
${ComplianceStandard},

[Parameter()]
[Alias('ComplianceSecurityProfileValue')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceSecurityProfileValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceSecurityProfileValue]
# Status of Compliance Security Profile feature.
${ComplianceSecurityProfileValue},
${EnhancedSecurityCompliance},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
Expand Down Expand Up @@ -406,10 +409,10 @@ function Update-AzDatabricksWorkspace {
$hasAccessConnectorIdentityType = $PSBoundParameters.Remove('AccessConnectorIdentityType')
$hasAccessConnectorUserAssignedIdentityId = $PSBoundParameters.Remove('AccessConnectorUserAssignedIdentityId')
$hasDefaultStorageFirewall = $PSBoundParameters.Remove('DefaultStorageFirewall')
$hasEnhancedSecurityMonitoringValue = $PSBoundParameters.Remove('EnhancedSecurityMonitoringValue')
$hasAutomaticClusterUpdateValue = $PSBoundParameters.Remove('AutomaticClusterUpdateValue')
$hasComplianceSecurityProfileComplianceStandard = $PSBoundParameters.Remove('ComplianceSecurityProfileComplianceStandard')
$hasComplianceSecurityProfileValue = $PSBoundParameters.Remove('ComplianceSecurityProfileValue')
$hasEnhancedSecurityMonitoringValue = $PSBoundParameters.Remove('EnhancedSecurityMonitoring')
$hasAutomaticClusterUpdateValue = $PSBoundParameters.Remove('AutomaticClusterUpdate')
$hasComplianceSecurityProfileComplianceStandard = $PSBoundParameters.Remove('ComplianceStandard')
$hasComplianceSecurityProfileValue = $PSBoundParameters.Remove('EnhancedSecurityCompliance')
$hasAsJob = $PSBoundParameters.Remove('AsJob')
$null = $PSBoundParameters.Remove('WhatIf')
$null = $PSBoundParameters.Remove('Confirm')
Expand Down Expand Up @@ -508,19 +511,19 @@ function Update-AzDatabricksWorkspace {
}
if ($hasEnhancedSecurityMonitoringValue)
{
$workspace.EnhancedSecurityMonitoringValue = $EnhancedSecurityMonitoringValue
$workspace.EnhancedSecurityMonitoringValue = $EnhancedSecurityMonitoring
}
if ($hasAutomaticClusterUpdateValue)
{
$workspace.AutomaticClusterUpdateValue = $AutomaticClusterUpdateValue
$workspace.AutomaticClusterUpdateValue = $AutomaticClusterUpdate
}
if ($hasComplianceSecurityProfileComplianceStandard)
{
$workspace.ComplianceSecurityProfileComplianceStandard = $ComplianceSecurityProfileComplianceStandard
$workspace.ComplianceSecurityProfileComplianceStandard = $ComplianceStandard
}
if ($hasComplianceSecurityProfileValue)
{
$workspace.ComplianceSecurityProfileValue = $ComplianceSecurityProfileValue
$workspace.ComplianceSecurityProfileValue = $EnhancedSecurityCompliance
}
if ($hasDefaultStorageFirewall)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,33 +314,37 @@ param(
${VnetAddressPrefix},

[Parameter()]
[Alias('EnhancedSecurityMonitoringValue')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.EnhancedSecurityMonitoringValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.EnhancedSecurityMonitoringValue]
# Status of Enhanced Security Monitoring feature.
${EnhancedSecurityMonitoringValue},
${EnhancedSecurityMonitoring},

[Parameter()]
[Alias('AutomaticClusterUpdateValue')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.AutomaticClusterUpdateValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.AutomaticClusterUpdateValue]
# Status of automated cluster updates feature.
${AutomaticClusterUpdateValue},
${AutomaticClusterUpdate},

[Parameter()]
[Alias('ComplianceSecurityProfileComplianceStandard')]
[AllowEmptyCollection()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceStandard])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceStandard[]]
# Compliance standards associated with the workspace.
${ComplianceSecurityProfileComplianceStandard},
${ComplianceStandard},

[Parameter()]
[Alias('ComplianceSecurityProfileValue')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceSecurityProfileValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceSecurityProfileValue]
# Status of Compliance Security Profile feature.
${ComplianceSecurityProfileValue},
${EnhancedSecurityCompliance},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2487,33 +2487,37 @@ param(
${VnetAddressPrefix},

[Parameter()]
[Alias('EnhancedSecurityMonitoringValue')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.EnhancedSecurityMonitoringValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.EnhancedSecurityMonitoringValue]
# Status of Enhanced Security Monitoring feature.
${EnhancedSecurityMonitoringValue},
${EnhancedSecurityMonitoring},

[Parameter()]
[Alias('AutomaticClusterUpdateValue')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.AutomaticClusterUpdateValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.AutomaticClusterUpdateValue]
# Status of automated cluster updates feature.
${AutomaticClusterUpdateValue},
${AutomaticClusterUpdate},

[Parameter()]
[Alias('ComplianceSecurityProfileComplianceStandard')]
[AllowEmptyCollection()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceStandard])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceStandard[]]
# Compliance standards associated with the workspace.
${ComplianceSecurityProfileComplianceStandard},
${ComplianceStandard},

[Parameter()]
[Alias('ComplianceSecurityProfileValue')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceSecurityProfileValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceSecurityProfileValue]
# Status of Compliance Security Profile feature.
${ComplianceSecurityProfileValue},
${EnhancedSecurityCompliance},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
Expand Down Expand Up @@ -3324,33 +3328,37 @@ param(
${EnableNoPublicIP},

[Parameter()]
[Alias('EnhancedSecurityMonitoringValue')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.EnhancedSecurityMonitoringValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.EnhancedSecurityMonitoringValue]
# Status of Enhanced Security Monitoring feature.
${EnhancedSecurityMonitoringValue},
${EnhancedSecurityMonitoring},

[Parameter()]
[Alias('AutomaticClusterUpdateValue')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.AutomaticClusterUpdateValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.AutomaticClusterUpdateValue]
# Status of automated cluster updates feature.
${AutomaticClusterUpdateValue},
${AutomaticClusterUpdate},

[Parameter()]
[Alias('ComplianceSecurityProfileComplianceStandard')]
[AllowEmptyCollection()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceStandard])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceStandard[]]
# Compliance standards associated with the workspace.
${ComplianceSecurityProfileComplianceStandard},
${ComplianceStandard},

[Parameter()]
[Alias('ComplianceSecurityProfileValue')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceSecurityProfileValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceSecurityProfileValue]
# Status of Compliance Security Profile feature.
${ComplianceSecurityProfileValue},
${EnhancedSecurityCompliance},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,33 +262,37 @@ param(
${EnableNoPublicIP},

[Parameter()]
[Alias('EnhancedSecurityMonitoringValue')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.EnhancedSecurityMonitoringValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.EnhancedSecurityMonitoringValue]
# Status of Enhanced Security Monitoring feature.
${EnhancedSecurityMonitoringValue},
${EnhancedSecurityMonitoring},

[Parameter()]
[Alias('AutomaticClusterUpdateValue')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.AutomaticClusterUpdateValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.AutomaticClusterUpdateValue]
# Status of automated cluster updates feature.
${AutomaticClusterUpdateValue},
${AutomaticClusterUpdate},

[Parameter()]
[Alias('ComplianceSecurityProfileComplianceStandard')]
[AllowEmptyCollection()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceStandard])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceStandard[]]
# Compliance standards associated with the workspace.
${ComplianceSecurityProfileComplianceStandard},
${ComplianceStandard},

[Parameter()]
[Alias('ComplianceSecurityProfileValue')]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceSecurityProfileValue])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Support.ComplianceSecurityProfileValue]
# Status of Compliance Security Profile feature.
${ComplianceSecurityProfileValue},
${EnhancedSecurityCompliance},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
Expand Down
9 changes: 9 additions & 0 deletions src/Databricks/Databricks.Autorest/generate-portal-ux.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,16 @@ function New-MetadataForParameterSet()
$cmdletName = Get-MappedCmdletFromFunctionName $ParameterSetInfo.Name
$description = (Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "DescriptionAttribute").Description
[object[]]$example = New-ExampleForParameterSet $ParameterSetInfo
if ($Null -eq $example)
{
$example = @()
}

[string[]]$signature = New-ParameterArrayInParameterSet $ParameterSetInfo
if ($Null -eq $signature)
{
$signature = @()
}

return @{
Path = $httpPath
Expand Down
Loading

0 comments on commit 31b4221

Please sign in to comment.