Skip to content
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
4 changes: 2 additions & 2 deletions src/Databricks/Databricks.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Databricks")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.10.1")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.10.1")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.11.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.11.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
16 changes: 6 additions & 10 deletions src/Databricks/Databricks.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ subject-prefix: $(service-name)

inlining-threshold: 100

resourcegroup-append: true
identity-correction-for-post: true
nested-object-to-string: true

# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
"@autorest/powershell": "3.x"

directive:
- from: swagger-document
where: $.definitions.EncryptionV2
Expand All @@ -70,11 +62,11 @@ directive:

# Remove cmdlet, Private link related resource should be ignored.
- where:
subject: PrivateEndpointConnection|PrivateLinkResource
subject: PrivateEndpointConnection|PrivateLinkResource
remove: true
# Remove the unexpanded parameter set
- where:
variant: ^Create$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
variant: ^Create$|^CreateViaIdentityExpanded$|^CreateViaIdentityWorkspace$|^Update$|^UpdateViaIdentity$
remove: true
# Hide CreateViaIdentity for customization
- where:
Expand Down Expand Up @@ -281,6 +273,10 @@ directive:
- ManagedResourceGroupId
labels:
ManagedResourceGroupId: Managed Resource Group ID

Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new model-cmdlet directive was added without an explanatory comment. In AutoRest README.md files, directives should be commented to explain the rationale/purpose so future maintainers can safely modify regeneration settings.

Suggested change
# Generate a helper cmdlet to construct WorkspaceProviderAuthorization objects
# so users can easily create authorization entries to pass into workspace cmdlets.

Copilot uses AI. Check for mistakes.
- model-cmdlet:
- model-name: WorkspaceProviderAuthorization
cmdlet-name: New-AzDatabricksWorkspaceProviderAuthorizationObject

- where:
verb: Get
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.Databricks.private.dll')
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Databricks.private.dll')

# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '../internal/Az.Databricks.internal.psm1'
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.Databricks.internal.psm1'
Comment on lines +3 to +6
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These Join-Path child paths use Windows-style backslashes (e.g., '..\bin...'). This can break on non-Windows platforms because the backslash may be treated as a literal character. Prefer passing clean relative segments (e.g., '../bin/Az.Databricks.private.dll') or joining multiple segments so path separators are platform-correct.

Copilot uses AI. Check for mistakes.
if(Test-Path $internalModulePath) {
$null = Import-Module -Name $internalModulePath
}
Expand Down
184 changes: 102 additions & 82 deletions src/Databricks/Databricks.Autorest/custom/New-AzDatabricksWorkspace.ps1

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/Databricks/Databricks.Autorest/custom/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Custom
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.
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.

## Info
- Modifiable: yes
Expand All @@ -15,10 +15,10 @@ For C# cmdlets, they are compiled with the rest of the generated low-level cmdle
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.

## Purpose
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.
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.

## Usage
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:
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:
- Break
- DefaultProfile
- HttpPipelineAppend
Expand All @@ -36,6 +36,6 @@ For processing the cmdlets, we've created some additional attributes:
- `Microsoft.Azure.PowerShell.Cmdlets.Databricks.DoNotExportAttribute`
- Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.Databricks`.
- `Microsoft.Azure.PowerShell.Cmdlets.Databricks.InternalExportAttribute`
- 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.
- 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.
- `Microsoft.Azure.PowerShell.Cmdlets.Databricks.ProfileAttribute`
- Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.
Original file line number Diff line number Diff line change
Expand Up @@ -24,106 +24,130 @@ Update-AzDatabricksVNetPeering -Name vnet-peering-t1 -WorkspaceName azps-databri
Get-AzDatabricksVNetPeering -WorkspaceName azps-databricks-workspace-t1 -ResourceGroupName azps_test_gp_db -Name vnet-peering-t1 | Update-AzDatabricksVNetPeering -AllowGatewayTransit $true

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api202601.IVirtualNetworkPeering
Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.IVirtualNetworkPeering
.Link
https://learn.microsoft.com/powershell/module/az.databricks/update-azdatabricksvnetpeering
#>
function Update-AzDatabricksVNetPeering {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api202601.IVirtualNetworkPeering])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Runtime.OutputBreakingChangeAttribute("Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api202601.IVirtualNetworkPeering", "16.0.0", "2.0.0", "May 2026", ReplacementCmdletOutputType = "Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.IVirtualNetworkPeering", DeprecatedOutputProperties = ("DatabrickAddressSpaceAddressPrefix, RemoteAddressSpaceAddressPrefix 'System.String[]'"), NewOutputProperties = ("DatabrickAddressSpaceAddressPrefix, RemoteAddressSpaceAddressPrefix 'System.Collections.Generic.List`1[System.String]'"))]
[CmdletBinding(DefaultParameterSetName = 'UpdateExpanded', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.IVirtualNetworkPeering])]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Runtime.OutputBreakingChangeAttribute("Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.IVirtualNetworkPeering", "16.0.0", "2.0.0", "May 2026", ReplacementCmdletOutputType = "Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.IVirtualNetworkPeering", DeprecatedOutputProperties = ("DatabrickAddressSpaceAddressPrefix, RemoteAddressSpaceAddressPrefix 'System.String[]'"), NewOutputProperties = ("DatabrickAddressSpaceAddressPrefix, RemoteAddressSpaceAddressPrefix 'System.Collections.Generic.List`1[System.String]'"))]
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The breaking-change effective date is set to "May 2026". In this repo, breaking change attributes use a strict "YYYY/MM/DD" date format (e.g., "2025/11/03" in src/CloudService/CloudService.Autorest/custom/New-AzCloudService.ps1:25). Please update this value to the required format.

Suggested change
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Runtime.OutputBreakingChangeAttribute("Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.IVirtualNetworkPeering", "16.0.0", "2.0.0", "May 2026", ReplacementCmdletOutputType = "Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.IVirtualNetworkPeering", DeprecatedOutputProperties = ("DatabrickAddressSpaceAddressPrefix, RemoteAddressSpaceAddressPrefix 'System.String[]'"), NewOutputProperties = ("DatabrickAddressSpaceAddressPrefix, RemoteAddressSpaceAddressPrefix 'System.Collections.Generic.List`1[System.String]'"))]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Runtime.OutputBreakingChangeAttribute("Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.IVirtualNetworkPeering", "16.0.0", "2.0.0", "2026/05/01", ReplacementCmdletOutputType = "Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.IVirtualNetworkPeering", DeprecatedOutputProperties = ("DatabrickAddressSpaceAddressPrefix, RemoteAddressSpaceAddressPrefix 'System.String[]'"), NewOutputProperties = ("DatabrickAddressSpaceAddressPrefix, RemoteAddressSpaceAddressPrefix 'System.Collections.Generic.List`1[System.String]'"))]

Copilot uses AI. Check for mistakes.
[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName = 'UpdateExpanded', Mandatory, HelpMessage = "The name of the VNetPeering.")]
[Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
[Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)]
[Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)]
[Alias('PeeringName')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Path')]
[System.String]
# The name of the workspace vNet peering.
${Name},

[Parameter(ParameterSetName = 'UpdateExpanded', Mandatory, HelpMessage = "The name of the resource group. The name is case insensitive.")]

[Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
[Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)]
[Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Path')]
[System.String]
# The name of the resource group.
# The name is case insensitive.
${ResourceGroupName},

[Parameter(ParameterSetName = 'UpdateExpanded', Mandatory, HelpMessage = "The name of the workspace.")]

[Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
[Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)]
[Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Path')]
[System.String]
# The name of the workspace.
${WorkspaceName},

[Parameter(ParameterSetName = 'UpdateExpanded', HelpMessage = "The ID of the target subscription.")]
[Parameter(ParameterSetName='UpdateExpanded')]
[Parameter(ParameterSetName='UpdateViaJsonFilePath')]
[Parameter(ParameterSetName='UpdateViaJsonString')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Runtime.DefaultInfo(Script = '(Get-AzContext).Subscription.Id')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
[System.String]
# The ID of the target subscription.
# The value must be an UUID.
${SubscriptionId},

[Parameter(ParameterSetName = 'UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline, HelpMessage = "Identity parameter. To construct, see NOTES section for INPUTOBJECT properties and create a hash table.")]
[Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.IDatabricksIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter()]

[Parameter(ParameterSetName='UpdateExpanded')]
[Parameter(ParameterSetName='UpdateViaIdentityExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
# [System.Management.Automation.SwitchParameter]
[System.Boolean]
[System.Management.Automation.SwitchParameter]
# Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network.
${AllowForwardedTraffic},

[Parameter()]

[Parameter(ParameterSetName='UpdateExpanded')]
[Parameter(ParameterSetName='UpdateViaIdentityExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[System.Boolean]
# [System.Management.Automation.SwitchParameter]
[System.Management.Automation.SwitchParameter]
# If gateway links can be used in remote virtual networking to link to this virtual network.
${AllowGatewayTransit},

[Parameter()]
[Parameter(ParameterSetName='UpdateExpanded')]
[Parameter(ParameterSetName='UpdateViaIdentityExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[System.Boolean]
# [System.Management.Automation.SwitchParameter]
[System.Management.Automation.SwitchParameter]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change the type from boolean to switch?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @VeryEarly, this change in parameter type is due to the internals of Update-AzDatabricksVNetPeering. The AllowVirtualNetworkAccess parameter is defined as a SwitchParameter internally, so we're following the internal parameter type definition.

# Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space.
${AllowVirtualNetworkAccess},

[Parameter()]
[Parameter(ParameterSetName='UpdateExpanded')]
[Parameter(ParameterSetName='UpdateViaIdentityExpanded')]
[AllowEmptyCollection()]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[System.String[]]
# A list of address blocks reserved for this virtual network in CIDR notation.
${DatabricksAddressSpacePrefix},

[Parameter()]
[Parameter(ParameterSetName='UpdateExpanded')]
[Parameter(ParameterSetName='UpdateViaIdentityExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[System.String]
# The Id of the databricks virtual network.
${DatabricksVirtualNetworkId},

[Parameter()]
[Parameter(ParameterSetName='UpdateExpanded')]
[Parameter(ParameterSetName='UpdateViaIdentityExpanded')]
[AllowEmptyCollection()]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[System.String[]]
# A list of address blocks reserved for this virtual network in CIDR notation.
${RemoteAddressSpacePrefix},

[Parameter()]
[Parameter(ParameterSetName='UpdateExpanded')]
[Parameter(ParameterSetName='UpdateViaIdentityExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[System.String]
# The Id of the remote virtual network.
${RemoteVirtualNetworkId},

[Parameter()]
[Parameter(ParameterSetName='UpdateExpanded')]
[Parameter(ParameterSetName='UpdateViaIdentityExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[System.Boolean]
# [System.Management.Automation.SwitchParameter]
[System.Management.Automation.SwitchParameter]
# If remote gateways can be used on this virtual network.
# If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit.
# Only one peering can have this flag set to true.
# This flag cannot be set if virtual network already has a gateway.
${UseRemoteGateway},

[Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[System.String]
# Path of Json file supplied to the Update operation
${JsonFilePath},

[Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Databricks.Category('Body')]
[System.String]
# Json string supplied to the Update operation
${JsonString},

[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
Expand Down
Loading
Loading