From 522be2a0d804f358715a1822623a9f0ac12d5c08 Mon Sep 17 00:00:00 2001 From: Shubham Chaudhari Date: Wed, 20 Aug 2025 15:48:38 +0530 Subject: [PATCH] Servicebus 2025-05-preview feature added --- .../Properties/AssemblyInfo.cs | 6 ++--- src/ServiceBus/ServiceBus.Autorest/README.md | 24 +++++++++---------- .../custom/Az.ServiceBus.custom.psm1 | 4 ++-- .../ServiceBus.Autorest/custom/README.md | 8 +++---- .../ServiceBus.Autorest/docs/README.md | 4 ++-- .../ServiceBus.Autorest/examples/README.md | 11 +++++++++ .../ServiceBus.Autorest/generate-info.json | 3 --- .../ServiceBus.Autorest/resources/README.md | 2 +- .../ServiceBus.Autorest/test/README.md | 2 +- 9 files changed, 36 insertions(+), 28 deletions(-) create mode 100644 src/ServiceBus/ServiceBus.Autorest/examples/README.md delete mode 100644 src/ServiceBus/ServiceBus.Autorest/generate-info.json diff --git a/src/ServiceBus/ServiceBus.Autorest/Properties/AssemblyInfo.cs b/src/ServiceBus/ServiceBus.Autorest/Properties/AssemblyInfo.cs index 632ad9ccebbe..41b713dbc42e 100644 --- a/src/ServiceBus/ServiceBus.Autorest/Properties/AssemblyInfo.cs +++ b/src/ServiceBus/ServiceBus.Autorest/Properties/AssemblyInfo.cs @@ -20,7 +20,7 @@ [assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] [assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] [assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - ServiceBus")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("4.1.1")] -[assembly: System.Reflection.AssemblyVersionAttribute("4.1.1")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0.0")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] -[assembly: System.CLSCompliantAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] \ No newline at end of file diff --git a/src/ServiceBus/ServiceBus.Autorest/README.md b/src/ServiceBus/ServiceBus.Autorest/README.md index a776e306126b..ce55d1a2d9d9 100644 --- a/src/ServiceBus/ServiceBus.Autorest/README.md +++ b/src/ServiceBus/ServiceBus.Autorest/README.md @@ -28,23 +28,23 @@ For information on how to develop for `Az.ServiceBus`, see [how-to.md](how-to.md ``` yaml # Please specify the commit id that includes your features to make sure generated codes stable. -commit: 1e790cfc5ee4e7ff98f99dd19a3174c4dd58432b +commit: c62eaed6d87c68cd4ab3c09c898b4e896873e791 require: # readme.azure.noprofile.md is the common configuration file - $(this-folder)/../../readme.azure.noprofile.md input-file: # You need to specify your swagger files here. - - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/Queue.json - - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/topics.json - - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/namespace-preview.json - - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/AuthorizationRules.json - - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/CheckNameAvailability.json - - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/DisasterRecoveryConfig.json - - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/migrationconfigs.json - - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/networksets.json - - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/operations.json - - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/Rules.json - - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/subscriptions.json + - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2025-05-01-preview/Queue.json + - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2025-05-01-preview/topics.json + - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2025-05-01-preview/namespace-preview.json + - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2025-05-01-preview/AuthorizationRules.json + - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2025-05-01-preview/CheckNameAvailability.json + - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2025-05-01-preview/DisasterRecoveryConfig.json + - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2025-05-01-preview/migrationconfigs.json + - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2025-05-01-preview/networksets.json + - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2025-05-01-preview/operations.json + - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2025-05-01-preview/Rules.json + - $(repo)/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2025-05-01-preview/subscriptions.json # If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally # - (this-folder)/relative-path-to-your-swagger diff --git a/src/ServiceBus/ServiceBus.Autorest/custom/Az.ServiceBus.custom.psm1 b/src/ServiceBus/ServiceBus.Autorest/custom/Az.ServiceBus.custom.psm1 index c9ba328759f0..db2bd2f87138 100644 --- a/src/ServiceBus/ServiceBus.Autorest/custom/Az.ServiceBus.custom.psm1 +++ b/src/ServiceBus/ServiceBus.Autorest/custom/Az.ServiceBus.custom.psm1 @@ -1,9 +1,9 @@ # region Generated # Load the private module dll - $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ServiceBus.private.dll') + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.ServiceBus.private.dll') # Load the internal module - $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.ServiceBus.internal.psm1' + $internalModulePath = Join-Path $PSScriptRoot '../internal/Az.ServiceBus.internal.psm1' if(Test-Path $internalModulePath) { $null = Import-Module -Name $internalModulePath } diff --git a/src/ServiceBus/ServiceBus.Autorest/custom/README.md b/src/ServiceBus/ServiceBus.Autorest/custom/README.md index 6d90531d9894..d916a6785546 100644 --- a/src/ServiceBus/ServiceBus.Autorest/custom/README.md +++ b/src/ServiceBus/ServiceBus.Autorest/custom/README.md @@ -1,5 +1,5 @@ # Custom -This directory contains custom implementation for non-generated cmdlets for the `Az.ServiceBus` 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.ServiceBus.custom.psm1`. This file should not be modified. +This directory contains custom implementation for non-generated cmdlets for the `Az.ServiceBus` 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.ServiceBus.custom.psm1`. This file should not be modified. ## Info - Modifiable: yes @@ -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.ServiceBus.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 @@ -36,6 +36,6 @@ For processing the cmdlets, we've created some additional attributes: - `Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.DoNotExportAttribute` - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.ServiceBus`. - `Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.InternalExportAttribute` - - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.ServiceBus`. 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.ServiceBus`. For more information, see [README.md](../internal/README.md) in the `../internal` folder. - `Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.ProfileAttribute` - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules. \ No newline at end of file diff --git a/src/ServiceBus/ServiceBus.Autorest/docs/README.md b/src/ServiceBus/ServiceBus.Autorest/docs/README.md index fe1f624128ce..c2584954b353 100644 --- a/src/ServiceBus/ServiceBus.Autorest/docs/README.md +++ b/src/ServiceBus/ServiceBus.Autorest/docs/README.md @@ -1,5 +1,5 @@ # Docs -This directory contains the documentation of the cmdlets for the `Az.ServiceBus` 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. +This directory contains the documentation of the cmdlets for the `Az.ServiceBus` 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. ## Info - Modifiable: no @@ -8,4 +8,4 @@ This directory contains the documentation of the cmdlets for the `Az.ServiceBus` - Packaged: yes ## Details -The process of documentation generation loads `Az.ServiceBus` 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. \ No newline at end of file +The process of documentation generation loads `Az.ServiceBus` 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. \ No newline at end of file diff --git a/src/ServiceBus/ServiceBus.Autorest/examples/README.md b/src/ServiceBus/ServiceBus.Autorest/examples/README.md new file mode 100644 index 000000000000..a4c7754cdc40 --- /dev/null +++ b/src/ServiceBus/ServiceBus.Autorest/examples/README.md @@ -0,0 +1,11 @@ +# Examples +This directory contains examples from the exported cmdlets of the module. When `build-module.ps1` is ran, example stub files will be generated here. If your module support Azure Profiles, the example stubs will be in individual profile folders. These example stubs should be updated to show how the cmdlet is used. The examples are imported into the documentation when `generate-help.ps1` is ran. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: no + +## Purpose +This separates the example documentation details from the generated documentation information provided directly from the generated cmdlets. Since the cmdlets don't have examples from the REST spec, this provides a means to add examples easily. The example stubs provide the markdown format that is required. The 3 core elements are: the name of the example, the code information of the example, and the description of the example. That information, if the markdown format is followed, will be available to documentation generation and be part of the documents in the `../docs` folder. \ No newline at end of file diff --git a/src/ServiceBus/ServiceBus.Autorest/generate-info.json b/src/ServiceBus/ServiceBus.Autorest/generate-info.json deleted file mode 100644 index df00dc7231ba..000000000000 --- a/src/ServiceBus/ServiceBus.Autorest/generate-info.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "generate_Id": "e4633269-1b4b-48fe-ab3b-42a4844e0072" -} diff --git a/src/ServiceBus/ServiceBus.Autorest/resources/README.md b/src/ServiceBus/ServiceBus.Autorest/resources/README.md index 937f07f8fec2..736492341e3d 100644 --- a/src/ServiceBus/ServiceBus.Autorest/resources/README.md +++ b/src/ServiceBus/ServiceBus.Autorest/resources/README.md @@ -1,5 +1,5 @@ # Resources -This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `../custom` folder. ## Info - Modifiable: yes diff --git a/src/ServiceBus/ServiceBus.Autorest/test/README.md b/src/ServiceBus/ServiceBus.Autorest/test/README.md index 7c752b4c8c43..1969200c6a09 100644 --- a/src/ServiceBus/ServiceBus.Autorest/test/README.md +++ b/src/ServiceBus/ServiceBus.Autorest/test/README.md @@ -1,5 +1,5 @@ # Test -This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `..\custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. +This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `../custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. ## Info - Modifiable: yes