Skip to content

Commit 50624a0

Browse files
cherry-pick e0a8594 from generation
1 parent 4b7940a commit 50624a0

File tree

54 files changed

+1144
-956
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1144
-956
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
bin
2+
obj
3+
.vs
4+
generated
5+
internal
6+
exports
7+
tools
8+
custom/*.psm1
9+
custom/autogen-model-cmdlets
10+
test/*-TestResults.xml
11+
/*.ps1
12+
/*.ps1xml
13+
/*.psm1
14+
/*.snk
15+
/*.csproj
16+
/*.nuspec
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@{
2+
GUID = '8b0dec02-8816-4888-a99b-9d013881e523'
3+
RootModule = './Az.Databricks.psm1'
4+
ModuleVersion = '1.2.0'
5+
CompatiblePSEditions = 'Core', 'Desktop'
6+
Author = 'Microsoft Corporation'
7+
CompanyName = 'Microsoft Corporation'
8+
Copyright = 'Microsoft Corporation. All rights reserved.'
9+
Description = 'Microsoft Azure PowerShell: Databricks cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.Databricks.private.dll'
13+
FormatsToProcess = './Az.Databricks.format.ps1xml'
14+
FunctionsToExport = 'Get-AzDatabricksAccessConnector', 'Get-AzDatabricksOutboundNetworkDependenciesEndpoint', 'Get-AzDatabricksVNetPeering', 'Get-AzDatabricksWorkspace', 'New-AzDatabricksAccessConnector', 'New-AzDatabricksVNetPeering', 'New-AzDatabricksWorkspace', 'New-AzDatabricksWorkspaceProviderAuthorizationObject', 'Remove-AzDatabricksAccessConnector', 'Remove-AzDatabricksVNetPeering', 'Remove-AzDatabricksWorkspace', 'Update-AzDatabricksAccessConnector', 'Update-AzDatabricksVNetPeering', 'Update-AzDatabricksWorkspace', '*'
15+
AliasesToExport = '*'
16+
PrivateData = @{
17+
PSData = @{
18+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Databricks'
19+
LicenseUri = 'https://aka.ms/azps-license'
20+
ProjectUri = 'https://github.com/Azure/azure-powershell'
21+
ReleaseNotes = ''
22+
}
23+
}
24+
}

src/Databricks/Databricks.Autorest/LiveTests/TestLiveScenarios.ps1

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/Databricks/Databricks.Autorest/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/Databricks/Databricks.Autorest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,4 +273,4 @@ directive:
273273
- ManagedResourceGroupId
274274
labels:
275275
ManagedResourceGroupId: Managed Resource Group ID
276-
```
276+
```

src/Databricks/Databricks.Autorest/build-module.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ if(-not $Debugger) {
8989
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release')
9090
}
9191

92-
$dll = Join-Path $PSScriptRoot 'bin\Az.Databricks.private.dll'
92+
$dll = Join-Path $PSScriptRoot 'bin/Az.Databricks.private.dll'
9393
if(-not (Test-Path $dll)) {
9494
Write-Error "Unable to find output assembly in '$binFolder'."
9595
}
@@ -98,7 +98,7 @@ if(-not (Test-Path $dll)) {
9898
$null = Import-Module -Name $dll
9999

100100
$modulePaths = $dll
101-
$customPsm1 = Join-Path $PSScriptRoot 'custom\Az.Databricks.custom.psm1'
101+
$customPsm1 = Join-Path $PSScriptRoot 'custom/Az.Databricks.custom.psm1'
102102
if(Test-Path $customPsm1) {
103103
$modulePaths = @($dll, $customPsm1)
104104
}
@@ -170,8 +170,8 @@ if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
170170
}
171171

172172
if (-not $DisableAfterBuildTasks){
173-
$afterBuildTasksPath = Join-Path $PSScriptRoot ''
174-
$afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable
173+
$afterBuildTasksPath = Join-Path $PSScriptRoot '../../../tools/BuildScripts/AdaptAutorestModule.ps1'
174+
$afterBuildTasksArgs = ConvertFrom-Json '{"SubModuleName":"Databricks","ModuleRootName":"$(root-module-name)"}' -AsHashtable
175175
if(Test-Path -Path $afterBuildTasksPath -PathType leaf){
176176
Write-Host -ForegroundColor Green 'Running after build tasks...'
177177
. $afterBuildTasksPath @afterBuildTasksArgs

src/Databricks/Databricks.Autorest/create-model-cmdlets.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ function CreateModelCmdlet {
2222
return
2323
}
2424

25-
$ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
26-
$OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
25+
$ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated/api') 'Models'
26+
$OutputDir = Join-Path $PSScriptRoot 'custom/autogen-model-cmdlets'
2727
$null = New-Item -ItemType Directory -Force -Path $OutputDir
2828
if (''.length -gt 0) {
2929
$ModuleName = ''

src/Databricks/Databricks.Autorest/custom/Az.Databricks.custom.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# region Generated
22
# Load the private module dll
3-
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Databricks.private.dll')
3+
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.Databricks.private.dll')
44

55
# Load the internal module
6-
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.Databricks.internal.psm1'
6+
$internalModulePath = Join-Path $PSScriptRoot '../internal/Az.Databricks.internal.psm1'
77
if(Test-Path $internalModulePath) {
88
$null = Import-Module -Name $internalModulePath
99
}

src/Databricks/Databricks.Autorest/custom/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Custom
2-
This directory contains custom implementation for non-generated cmdlets for the `Az.Databricks` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.Databricks.custom.psm1`. This file should not be modified.
2+
This directory contains custom implementation for non-generated cmdlets for the `Az.Databricks` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `../exports` folder. The only generated file into this folder is the `Az.Databricks.custom.psm1`. This file should not be modified.
33

44
## Info
55
- Modifiable: yes
@@ -15,10 +15,10 @@ For C# cmdlets, they are compiled with the rest of the generated low-level cmdle
1515
For script cmdlets, these are loaded via the `Az.Databricks.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.
1616

1717
## Purpose
18-
This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder.
18+
This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `../exports` folder.
1919

2020
## Usage
21-
The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
21+
The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `../exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
2222
- Break
2323
- DefaultProfile
2424
- HttpPipelineAppend
@@ -36,6 +36,6 @@ For processing the cmdlets, we've created some additional attributes:
3636
- `Microsoft.Azure.PowerShell.Cmdlets.Databricks.DoNotExportAttribute`
3737
- Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.Databricks`.
3838
- `Microsoft.Azure.PowerShell.Cmdlets.Databricks.InternalExportAttribute`
39-
- Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.Databricks`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder.
39+
- Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.Databricks`. For more information, see [README.md](../internal/README.md) in the `../internal` folder.
4040
- `Microsoft.Azure.PowerShell.Cmdlets.Databricks.ProfileAttribute`
4141
- Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.

src/Databricks/Databricks.Autorest/custom/Update-AzDatabricksWorkspace.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,18 @@ function Update-AzDatabricksWorkspace {
490490
{
491491
$workspace.DefaultStorageFirewall = $DefaultStorageFirewall
492492
}
493+
if ($hasAccessConnectorId)
494+
{
495+
$workspace.AccessConnectorId = $AccessConnectorId
496+
}
497+
if ($hasAccessConnectorIdentityType)
498+
{
499+
$workspace.AccessConnectorIdentityType = $AccessConnectorIdentityType
500+
}
501+
if ($hasAccessConnectorUserAssignedIdentityId)
502+
{
503+
$workspace.AccessConnectorUserAssignedIdentityId = $AccessConnectorUserAssignedIdentityId
504+
}
493505
if ($hasAsJob) {
494506
$PSBoundParameters.Add('AsJob', $true)
495507
}

src/Databricks/Databricks.Autorest/help/Az.Databricks.md renamed to src/Databricks/Databricks.Autorest/docs/Az.Databricks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.Databricks
3-
Module Guid: b453c0c1-7867-4fa1-9fd0-0cf8f6c6959c
3+
Module Guid: 8b0dec02-8816-4888-a99b-9d013881e523
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.databricks
55
Help Version: 1.0.0.0
66
Locale: en-US
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Docs
2-
This directory contains the documentation of the cmdlets for the `Az.Databricks` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `..\examples` folder.
2+
This directory contains the documentation of the cmdlets for the `Az.Databricks` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `../examples` folder.
33

44
## Info
55
- Modifiable: no
@@ -8,4 +8,4 @@ This directory contains the documentation of the cmdlets for the `Az.Databricks`
88
- Packaged: yes
99

1010
## Details
11-
The process of documentation generation loads `Az.Databricks` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder.
11+
The process of documentation generation loads `Az.Databricks` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `../exports` folder. Additionally, when writing custom cmdlets in the `../custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `../examples` folder.

src/Databricks/Databricks.Autorest/export-surface.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if(-not $Isolated) {
2222
return
2323
}
2424

25-
$dll = Join-Path $PSScriptRoot 'bin\Az.Databricks.private.dll'
25+
$dll = Join-Path $PSScriptRoot 'bin/Az.Databricks.private.dll'
2626
if(-not (Test-Path $dll)) {
2727
Write-Error "Unable to find output assembly in '$binFolder'."
2828
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"generate_Id": "398839ec-04a9-4252-a411-806dd21f8804"
2+
"generate_Id": "6f7c2bf0-9645-4005-9477-66b1bedbec46"
33
}

0 commit comments

Comments
 (0)