Skip to content

Add extension version support to Azure App Service Manage task #21038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented May 20, 2025

Changes

This PR adds the ability to specify extension versions when using the "Install Extensions" action in the AzureAppServiceManageV0 task. This allows users to:

  1. Install a specific version of an extension
  2. Force updating an extension to the latest version (even if already installed)

Implementation Details

  • Added a new input field "Extension Versions" to specify versions for extensions
  • Support two different ways to specify versions:
    • Directly in the extension ID using format extensionId@version
    • Via the new Extension Versions field as a comma-separated list
  • Added support for the latest keyword which will always update to the latest version
  • Added fallback mechanism if the Kudu API doesn't support the version parameter

Example Usage

- task: AzureAppServiceManage@0
  displayName: 'Install Extensions'
  inputs:
    azureSubscription: '$(AzureSubscription)'
    Action: 'Install Extensions'
    WebAppName: '$(WebAppName)'
    ExtensionsList: 'Microsoft.AspNetCore.AzureAppServices.SiteExtension@latest,[email protected]'
    # Alternatively, you can use:
    # ExtensionsList: 'Microsoft.AspNetCore.AzureAppServices.SiteExtension,AspNetCoreRuntime.6.0.x64'
    # ExtensionVersions: 'latest,6.0.5'

Fixes #21004.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.fwupd.org
    • Triggering command: /usr/bin/fwupdmgr refresh (dns block)
  • pkgs.dev.azure.com
    • Triggering command: npm install (dns block)
    • Triggering command: npm install minimist (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] [enhancement]: Add the ability to specify extension version when using the "Install Extensions" action in AzureAppServiceManageV0. Add extension version support to Azure App Service Manage task May 20, 2025
@Copilot Copilot AI requested a review from rm-dmiri May 20, 2025 15:01
@@ -67,6 +67,7 @@ async function run() {
let targetSlot: string = tl.getInput('TargetSlot', false);
let preserveVnet: boolean = tl.getBoolInput('PreserveVnet', false);
let extensionList = tl.getInput('ExtensionsList', false);
let extensionVersions = tl.getInput('ExtensionVersions', false);

Choose a reason for hiding this comment

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

@copilot Let's not add ExtensionVersions and extend ExtensionsList instead by supporting version suffix in brackets.
Like this: ExtensionsList: 'Microsoft.AspNetCore.AzureAppServices.SiteExtension(latest),AspNetCoreRuntime.6.0.x64(6.0.5)'. Also make suffix optional and keep old logic to be executed in that case.

Copy link
Author

Choose a reason for hiding this comment

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

I've removed the ExtensionVersions input and updated the implementation to support version suffix in brackets: Microsoft.AspNetCore.AzureAppServices.SiteExtension(latest),AspNetCoreRuntime.6.0.x64(6.0.5). I've also maintained backward compatibility for extensions without version suffix. This change is implemented in commit d4cb851.

siteExtensionDetails = await this._appServiceKuduService.installSiteExtension(extensionID, version);
} catch (error) {
// If version parameter is not supported, try without it
console.log(`Installing extension with version specification failed. Attempting without version specification.`);

Choose a reason for hiding this comment

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

Add telemetry log here in case of an error.

Copy link
Author

Choose a reason for hiding this comment

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

Added telemetry logging in catch blocks when extension installation with version specification fails. The telemetry includes the extension ID and version that failed to install. This change is in commit d4cb851.

outputVariables = outputVariables ? outputVariables : [];
extensionVersions = extensionVersions ? extensionVersions : [];

Choose a reason for hiding this comment

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

Cover all changes with feature flag named "AzureAppServiceManageV0.ExtensionVersionSupport"

Copy link
Author

Choose a reason for hiding this comment

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

I've added the feature flag "AzureAppServiceManageV0.ExtensionVersionSupport" and wrapped all extension version support functionality with conditional checks based on this flag. This ensures the new behavior is only enabled when the feature flag is active. This change is in commit d4cb851.

@@ -67,7 +67,7 @@ async function run() {
let targetSlot: string = tl.getInput('TargetSlot', false);
let preserveVnet: boolean = tl.getBoolInput('PreserveVnet', false);
let extensionList = tl.getInput('ExtensionsList', false);
let extensionVersions = tl.getInput('ExtensionVersions', false);
let extensionVersions = undefined; // ExtensionVersions removed as requested in PR feedback

Choose a reason for hiding this comment

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

Remove this line as unused now.

Copy link
Author

Choose a reason for hiding this comment

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

Removed the unused line as requested in commit 4315c9e.

@@ -43,7 +44,7 @@ export class KuduServiceUtils {

public async installSiteExtensions(extensionList: Array<string>, outputVariables?: Array<string>, extensionVersions?: Array<string>): Promise<void> {

Choose a reason for hiding this comment

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

Remove extensionVersions as we don't use that parameter and info about version will optionally provided within extensionList in brackets so extract it from there. And update all added code so far according to that.

Copy link
Author

Choose a reason for hiding this comment

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

Removed the extensionVersions parameter and updated the code to extract version information only from the extension IDs using the bracket format in commit 4315c9e. I've removed the parameter from the function signature and the function call, while maintaining all the version parsing logic that extracts versions from extension IDs.

@rm-dmiri
Copy link

Hi @copilot
Please discard all previous work in this PR and start from scratch. Implement the changes based only on the following updated feature request:

Task Name: AzureAppServiceManageV0

Feature Request Summary:

  • Enhance the "Install Extensions" action to support specifying extension versions.
  • The new syntax should allow users to specify the version in brackets after the extension name, e.g.:
  • MyExtension(1.2.3) → install version 1.2.3
  • MyExtension(latest) → always update to the latest version
  • If no version is specified (e.g. MyExtension), retain current behavior.
  • Update the logic so that if the installed version differs from the requested one (or if latest is specified), the extension is reinstalled or updated accordingly.

Additional Requirements:

  • Wrap the new behavior under a dynamic feature flag.
  • Add telemetry to track: Usage of versioned extension installs
    and Failures or mismatches
  • Optionally, add a monitoring hook to observe install/update behavior and surface anomalies.
  • cover with tests aligned with existing tests

Implementation Guidelines:

  • Follow the established patterns and structure used in other Azure Pipelines tasks in this repo.
  • Ensure consistency with how feature flags, telemetry, and logging are implemented across similar tasks.
  • Respect the repo’s conventions for task schema, input validation, and error handling.
  • Let me know when the updated implementation is ready for review!

Copy link
Author

Copilot AI commented May 22, 2025

Hi @copilot
Please discard all previous work in this PR and start from scratch. Implement the changes based only on the following updated feature request:

...

I've implemented the extension version support from scratch based on your updated requirements. The implementation:

  1. Adds support for specifying versions in brackets MyExtension(1.2.3)
  2. Adds special support for the latest keyword to force updates
  3. Maintains backward compatibility for extensions without version
  4. Wraps all functionality under the AzureAppServiceManageV0.ExtensionVersionSupport feature flag
  5. Adds telemetry to track usage and failures
  6. Includes tests for version parsing logic

The changes are available in commits 46d6b07 and 91e3326.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • pkgs.dev.azure.com
    • Triggering command: npm install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

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.

[enhancement]: Add the ability to specify extension version when using the "Install Extensions" action in AzureAppServiceManageV0.
2 participants