Azure Automation - Runtime Environment and its Packages - Powershell cmdlets - #29867
Azure Automation - Runtime Environment and its Packages - Powershell cmdlets#29867kaarthik2103 wants to merge 9 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
@microsoft-github-policy-service agree company="microsoft" |
There was a problem hiding this comment.
Pull request overview
This PR adds new Az.Automation PowerShell cmdlets for managing Azure Automation Runtime Environments and Runtime Environment Packages, including client-side plumbing (AutomationPSClient + management SDK operations/models), help docs, module exports, and initial unit test coverage.
Changes:
- Added cmdlets to Get/New/Set/Remove Runtime Environments and Runtime Environment Packages.
- Extended
AutomationPSClient/IAutomationPSClientand the Automation management SDK surface area to call the new Runtime Environment + Package REST operations. - Added markdown help for the new cmdlets, updated
Az.Automation.psd1exports andChangeLog.md, and added unit tests for Runtime Environment cmdlets.
Reviewed changes
Copilot reviewed 27 out of 43 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Automation/Automation/Properties/Resources.resx | Adds localized strings for Runtime Environment / Package not-found & already-exists cases. |
| src/Automation/Automation/Properties/Resources.Designer.cs | Exposes the new resource strings via strongly-typed accessors. |
| src/Automation/Automation/Model/RuntimeEnvironmentPackage.cs | Introduces the client-side model returned by Runtime Environment Package cmdlets. |
| src/Automation/Automation/Model/RuntimeEnvironment.cs | Introduces the client-side model returned by Runtime Environment cmdlets. |
| src/Automation/Automation/help/Set-AzAutomationRuntimeEnvironmentPackage.md | Adds reference help for Set-AzAutomationRuntimeEnvironmentPackage. |
| src/Automation/Automation/help/Set-AzAutomationRuntimeEnvironment.md | Adds reference help for Set-AzAutomationRuntimeEnvironment. |
| src/Automation/Automation/help/Remove-AzAutomationRuntimeEnvironmentPackage.md | Adds reference help for Remove-AzAutomationRuntimeEnvironmentPackage. |
| src/Automation/Automation/help/Remove-AzAutomationRuntimeEnvironment.md | Adds reference help for Remove-AzAutomationRuntimeEnvironment. |
| src/Automation/Automation/help/New-AzAutomationRuntimeEnvironmentPackage.md | Adds reference help for New-AzAutomationRuntimeEnvironmentPackage. |
| src/Automation/Automation/help/New-AzAutomationRuntimeEnvironment.md | Adds reference help for New-AzAutomationRuntimeEnvironment. |
| src/Automation/Automation/help/Get-AzAutomationRuntimeEnvironmentPackage.md | Adds reference help for Get-AzAutomationRuntimeEnvironmentPackage. |
| src/Automation/Automation/help/Get-AzAutomationRuntimeEnvironment.md | Adds reference help for Get-AzAutomationRuntimeEnvironment. |
| src/Automation/Automation/Common/IAutomationPSClient.cs | Adds new client interface methods for Runtime Environments and Packages. |
| src/Automation/Automation/Common/AutomationPSClient.cs | Implements Runtime Environment and Package operations and error mapping. |
| src/Automation/Automation/Cmdlet/SetAzureAutomationRuntimeEnvironmentPackage.cs | Adds Set-AzAutomationRuntimeEnvironmentPackage cmdlet implementation. |
| src/Automation/Automation/Cmdlet/SetAzureAutomationRuntimeEnvironment.cs | Adds Set-AzAutomationRuntimeEnvironment cmdlet implementation. |
| src/Automation/Automation/Cmdlet/RemoveAzureAutomationRuntimeEnvironmentPackage.cs | Adds Remove-AzAutomationRuntimeEnvironmentPackage cmdlet implementation. |
| src/Automation/Automation/Cmdlet/RemoveAzureAutomationRuntimeEnvironment.cs | Adds Remove-AzAutomationRuntimeEnvironment cmdlet implementation. |
| src/Automation/Automation/Cmdlet/NewAzureAutomationRuntimeEnvironmentPackage.cs | Adds New-AzAutomationRuntimeEnvironmentPackage cmdlet implementation. |
| src/Automation/Automation/Cmdlet/NewAzureAutomationRuntimeEnvironment.cs | Adds New-AzAutomationRuntimeEnvironment cmdlet implementation. |
| src/Automation/Automation/Cmdlet/GetAzureAutomationRuntimeEnvironmentPackage.cs | Adds Get-AzAutomationRuntimeEnvironmentPackage cmdlet implementation. |
| src/Automation/Automation/Cmdlet/GetAzureAutomationRuntimeEnvironment.cs | Adds Get-AzAutomationRuntimeEnvironment cmdlet implementation. |
| src/Automation/Automation/ChangeLog.md | Documents the new cmdlets under Upcoming Release. |
| src/Automation/Automation/Az.Automation.psd1 | Exports the newly added cmdlets from the module manifest. |
| src/Automation/Automation.Test/UnitTests/SetAzureAutomationRuntimeEnvironmentTest.cs | Adds unit tests for Set-AzAutomationRuntimeEnvironment. |
| src/Automation/Automation.Test/UnitTests/RemoveAzureAutomationRuntimeEnvironmentTest.cs | Adds unit tests for Remove-AzAutomationRuntimeEnvironment. |
| src/Automation/Automation.Test/UnitTests/NewAzureAutomationRuntimeEnvironmentTest.cs | Adds unit tests for New-AzAutomationRuntimeEnvironment. |
| src/Automation/Automation.Test/UnitTests/GetAzureAutomationRuntimeEnvironmentTest.cs | Adds unit tests for Get-AzAutomationRuntimeEnvironment. |
| src/Automation/Automation.Management.Sdk/Generated/RuntimeEnvironmentOperationsExtensions.cs | Adds generated extension methods for RuntimeEnvironment operations. |
| src/Automation/Automation.Management.Sdk/Generated/RuntimeEnvironmentOperations.cs | Adds generated RuntimeEnvironment operations implementation. |
| src/Automation/Automation.Management.Sdk/Generated/PackageOperationsExtensions.cs | Adds generated extension methods for Package operations. |
| src/Automation/Automation.Management.Sdk/Generated/Models/RuntimeEnvironmentUpdateParameters.cs | Adds generated model for Runtime Environment update parameters. |
| src/Automation/Automation.Management.Sdk/Generated/Models/RuntimeEnvironmentRuntime.cs | Adds generated model describing Runtime properties (language/version). |
| src/Automation/Automation.Management.Sdk/Generated/Models/RuntimeEnvironmentCreateOrUpdateParameters.cs | Adds generated model for Runtime Environment create/update parameters. |
| src/Automation/Automation.Management.Sdk/Generated/Models/RuntimeEnvironment.cs | Adds generated model for Runtime Environment resource shape. |
| src/Automation/Automation.Management.Sdk/Generated/Models/PackageUpdateParameters.cs | Adds generated model for Package update parameters. |
| src/Automation/Automation.Management.Sdk/Generated/Models/PackageCreateOrUpdateParameters.cs | Adds generated model for Package create/update parameters. |
| src/Automation/Automation.Management.Sdk/Generated/Models/Package.cs | Adds generated model for Runtime Environment Package resource shape. |
| src/Automation/Automation.Management.Sdk/Generated/IRuntimeEnvironmentOperations.cs | Adds generated interface for RuntimeEnvironment operations. |
| src/Automation/Automation.Management.Sdk/Generated/IPackageOperations.cs | Adds generated interface for Package operations. |
| src/Automation/Automation.Management.Sdk/Generated/IAutomationClient.cs | Extends client interface to expose RuntimeEnvironment/Package operations. |
| src/Automation/Automation.Management.Sdk/Generated/AutomationClient.cs | Wires RuntimeEnvironment/Package operations into the generated client. |
Files not reviewed (1)
- src/Automation/Automation/Properties/Resources.Designer.cs: Generated file
|
@microsoft-github-policy-service agree company="Microsoft" |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 47 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- src/Automation/Automation/Properties/Resources.Designer.cs: Generated file
Comments suppressed due to low confidence (1)
src/Automation/Automation/Cmdlet/NewAzureAutomationRuntimeEnvironment.cs:95
- -Location is declared optional (and help says it defaults to the Automation Account location), but the cmdlet forwards Location directly into CreateRuntimeEnvironment. The underlying RuntimeEnvironmentCreateOrUpdateParameters.Validate() requires Location to be non-null, so omitting -Location will throw before the request is sent.
this.Name,
this.Location,
this.Language,
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 47 changed files in this pull request and generated 5 comments.
Files not reviewed (1)
- src/Automation/Automation/Properties/Resources.Designer.cs: Generated file
Comments suppressed due to low confidence (3)
src/Automation/Automation/Cmdlet/NewAzureAutomationRuntimeEnvironment.cs:125
- -Location is documented as optional (and the help states it is inherited from the Automation Account), but the cmdlet passes Location through as-is. The SDK create parameters validate Location as non-null, so omitting -Location will throw before the request is sent. Resolve an effective location (for example, by reading the parent Automation Account location) when Location is not provided.
if (ShouldProcess(this.Name, "Create Runtime Environment"))
{
var createdRuntimeEnvironment = this.AutomationClient.CreateRuntimeEnvironment(
this.ResourceGroupName,
this.AutomationAccountName,
this.Name,
this.Location,
this.Language,
this.Version,
defaultPackagesDict,
this.Description,
tagsDict);
src/Automation/Automation/help/New-AzAutomationRuntimeEnvironment.md:111
- The cmdlet supports a -Tag parameter, but there is no parameter documentation section for it. Add a "### -Tag" section (including type/Required/Position metadata) so users can discover and correctly use tagging support.
src/Automation/Automation/help/Set-AzAutomationRuntimeEnvironment.md:112 - The cmdlet supports a -Tag parameter, but there is no parameter documentation section for it. Add a "### -Tag" section (including type/Required/Position metadata) so users can discover and correctly use tagging support.
|
/azp run |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
11de74f to
5f2fa10
Compare
| var parameters = new AutomationManagement.Models.RuntimeEnvironmentCreateOrUpdateParameters( | ||
| location: location, | ||
| runtime: new AutomationManagement.Models.RuntimeEnvironmentRuntime(language: language, version: version), | ||
| tags: tags, | ||
| defaultPackages: defaultPackages, | ||
| description: description | ||
| ); |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 32 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- src/Automation/Automation/Properties/Resources.Designer.cs: Generated file
Comments suppressed due to low confidence (1)
src/Automation/Automation/Cmdlet/NewAzureAutomationRuntimeEnvironmentPackage.cs:71
- The package name validation rejects dots ('.'), but the newly added help uses a package name like "Az.Accounts". Either the validation is too strict (preventing common PowerShell module names) or the documentation is incorrect. If dots are intended to be supported, expand the regex and error text accordingly so users can create packages like 'Az.Accounts'.
// Validate name format
if (!Regex.IsMatch(this.Name, "^[a-zA-Z][a-zA-Z0-9_-]{0,62}$"))
{
throw new PSArgumentException(
"The name can contain only letters, numbers, underscores and dashes. The name must begin with a letter. The name must be less than 64 characters.",
nameof(Name));
| ## Upcoming Release | ||
| * Updated Automation account identity handling to explicitly use the Automation SDK `Identity` model in create/update flows. | ||
| * Added cmdlets for Runtime Environment management | ||
| * `Get-AzAutomationRuntimeEnvironment` | ||
| * `New-AzAutomationRuntimeEnvironment` | ||
| * `Set-AzAutomationRuntimeEnvironment` | ||
| * `Remove-AzAutomationRuntimeEnvironment` | ||
| * Added cmdlets for Runtime Environment Package management | ||
| * `Get-AzAutomationRuntimeEnvironmentPackage` | ||
| * `New-AzAutomationRuntimeEnvironmentPackage` | ||
| * `Set-AzAutomationRuntimeEnvironmentPackage` | ||
| * `Remove-AzAutomationRuntimeEnvironmentPackage` |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Description
This PR implements functionality for PowerShell cmdlets for managing Runtime Environments and Packages in Azure Automation. These cmdlets support the Azure Automation Runtime Environment experience, allowing customers to define custom execution environments for runbooks with:
Cmdlets functionality:
ARE-pwsh-cmdlets.md
Local testing document:
Testing - ARE cmdlets.docx
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.