Skip to content

Azure Automation - Runtime Environment and its Packages - Powershell cmdlets - #29867

Open
kaarthik2103 wants to merge 9 commits into
Azure:mainfrom
kaarthik2103:aa/runtime-env-cmdlets
Open

Azure Automation - Runtime Environment and its Packages - Powershell cmdlets#29867
kaarthik2103 wants to merge 9 commits into
Azure:mainfrom
kaarthik2103:aa/runtime-env-cmdlets

Conversation

@kaarthik2103

@kaarthik2103 kaarthik2103 commented Jul 21, 2026

Copy link
Copy Markdown

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:

  • Specific PowerShell runtime versions
  • Specific Python runtime versions
  • Custom module/package dependencies
  • Consistent and reusable execution configurations across Automation workloads.

Cmdlets functionality:

ARE-pwsh-cmdlets.md

Local testing document:

Testing - ARE cmdlets.docx

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copilot AI review requested due to automatic review settings July 21, 2026 09:43
@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@kaarthik2103

kaarthik2103 commented Jul 21, 2026

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="microsoft"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/IAutomationPSClient and 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.psd1 exports and ChangeLog.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

Comment thread src/Automation/Automation/Common/AutomationPSClient.cs Outdated
Comment thread src/Automation/Automation/Cmdlet/NewAzureAutomationRuntimeEnvironment.cs Outdated
Comment thread src/Automation/Automation/Cmdlet/SetAzureAutomationRuntimeEnvironmentPackage.cs Outdated
@kaarthik2103

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Microsoft"

Copilot AI review requested due to automatic review settings July 21, 2026 10:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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,

Comment thread src/Automation/Automation/Common/AutomationPSClient.cs Outdated
@a0x1ab

a0x1ab commented Jul 22, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings July 24, 2026 10:23
@a0x1ab

a0x1ab commented Jul 24, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread src/Automation/Automation/Cmdlet/NewAzureAutomationRuntimeEnvironment.cs Outdated
Comment thread src/Automation/Automation/Cmdlet/SetAzureAutomationRuntimeEnvironment.cs Outdated
Comment thread src/Automation/Automation/Cmdlet/NewAzureAutomationRuntimeEnvironmentPackage.cs Outdated
Comment thread src/Automation/Automation/Cmdlet/SetAzureAutomationRuntimeEnvironmentPackage.cs Outdated
Comment thread src/Automation/Automation/Common/AutomationPSClient.cs Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 11:27
@a0x1ab

a0x1ab commented Jul 24, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread src/Automation/Automation/help/Set-AzAutomationRuntimeEnvironment.md Outdated
Comment thread src/Automation/Automation/Properties/Resources.resx
Copilot AI review requested due to automatic review settings July 24, 2026 11:53
@a0x1ab

a0x1ab commented Jul 24, 2026

Copy link
Copy Markdown
Member

/azp run

@a0x1ab

a0x1ab commented Jul 27, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@a0x1ab

a0x1ab commented Jul 27, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings July 27, 2026 14:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

@a0x1ab

a0x1ab commented Jul 27, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings July 27, 2026 14:42
@kaarthik2103
kaarthik2103 force-pushed the aa/runtime-env-cmdlets branch from 11de74f to 5f2fa10 Compare July 27, 2026 14:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment on lines +2048 to +2054
var parameters = new AutomationManagement.Models.RuntimeEnvironmentCreateOrUpdateParameters(
location: location,
runtime: new AutomationManagement.Models.RuntimeEnvironmentRuntime(language: language, version: version),
tags: tags,
defaultPackages: defaultPackages,
description: description
);
Copilot AI review requested due to automatic review settings July 27, 2026 15:21
@a0x1ab

a0x1ab commented Jul 27, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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));

Comment on lines 20 to +31
## 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`
Copilot AI review requested due to automatic review settings July 28, 2026 06:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@a0x1ab

a0x1ab commented Jul 28, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings July 28, 2026 07:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

@a0x1ab

a0x1ab commented Jul 28, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants