-
Notifications
You must be signed in to change notification settings - Fork 753
[CI] Add Azure CLI as Helix test dependency for basic tests #13420
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
base: main
Are you sure you want to change the base?
Conversation
tests/helix/send-to-helix-inner.proj
Outdated
|
|
||
| <!-- Azure CLI URL for Helix runs - Windows x64 zip version --> | ||
| <_AzureCliUrl Condition="'$(OS)' == 'Windows_NT'">https://aka.ms/installazurecliwindowszipx64</_AzureCliUrl> | ||
| <!-- Note: Azure CLI for non-Windows is not currently configured as the aka.ms link is Windows-specific --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Drop this comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 60d411a
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13420Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13420" |
|
/azp run aspire-tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run aspire-tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@copilot Add command to the helix targets to:
|
|
/azp run aspire-tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
``` System.InvalidOperationException: Step 'provision-env' failed: Exception of type 'Aspire.Hosting.Azure.AzureCliNotOnPathException' was thrown. | ---> Aspire.Hosting.Azure.AzureCliNotOnPathException: Exception of type 'Aspire.Hosting.Azure.AzureCliNotOnPathException' was thrown. | at Aspire.Hosting.Azure.Provisioning.Internal.BicepCliCompiler.CompileBicepToArmAsync(String bicepFilePath, CancellationToken cancellationToken) in /_/src/Aspire.Hosting.Azure/Provisioning/Internal/BicepCompiler.cs:line 41 | at Aspire.Hosting.Azure.Provisioning.BicepProvisioner.GetOrCreateResourceAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken) in /_/src/Aspire.Hosting.Azure/Provisioning/Provisioners/BicepProvisioner.cs:line 159 | at Aspire.Hosting.Azure.AzureBicepResource.ProvisionAzureBicepResourceAsync(PipelineStepContext context, AzureBicepResource resource) in /_/src/Aspire.Hosting.Azure/AzureBicepResource.cs:line 338 | at Aspire.Hosting.Azure.AzureBicepResource.ProvisionAzureBicepResourceAsync(PipelineStepContext context, AzureBicepResource resource) in /_/src/Aspire.Hosting.Azure/AzureBicepResource.cs:line 361 | at Aspire.Hosting.Azure.AzureBicepResource.ProvisionAzureBicepResourceAsync(PipelineStepContext context, AzureBicepResource resource) in /_/src/Aspire.Hosting.Azure/AzureBicepResource.cs:line 361 | at Aspire.Hosting.Azure.AzureBicepResource.<>c__DisplayClass0_0.<<-ctor>b__2>d.MoveNext() in /_/src/Aspire.Hosting.Azure/AzureBicepResource.cs:line 53 | --- End of stack trace from previous location --- | at Aspire.Hosting.Pipelines.DistributedApplicationPipeline.ExecuteStepAsync(PipelineStep step, PipelineStepContext stepContext) in /_/src/Aspire.Hosting/Pipelines/DistributedApplicationPipeline.cs:line 760 | --- End of inner exception stack trace --- | at Aspire.Hosting.Pipelines.DistributedApplicationPipeline.ExecuteStepAsync(PipelineStep step, PipelineStepContext stepContext) in /_/src/Aspire.Hosting/Pipelines/DistributedApplicationPipeline.cs:line 765 | at Aspire.Hosting.Pipelines.DistributedApplicationPipeline.<>c__DisplayClass18_0.<<ExecuteStepsAsTaskDag>g__ExecuteStepWithDependencies|0>d.MoveNext() in /_/src/Aspire.Hosting/Pipelines/DistributedApplicationPipeline.cs:line 576 ```
3c75681 to
81efe83
Compare
There was a problem hiding this comment.
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 Azure CLI as a dependency for Helix basic test runs, following the established pattern for Azure Functions CLI. The implementation downloads the Azure CLI zip from an aka.ms redirect URL, extracts it to az-cli, and adds its bin directory to the PATH for test execution. Currently configured for Windows only with placeholders for future non-Windows support.
Key Changes
- Introduced
NeedsAzCliproperty to conditionally enable Azure CLI installation - Added download and extraction target that handles the aka.ms redirect URL lacking a file extension
- Configured PATH updates and verification commands for Helix environments
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/helix/send-to-helix-inner.proj | Adds _AzureCliWindowsUrl property, creates DownloadAzureCliForHelix target to download/extract Azure CLI, configures HelixCorrelationPayload and HelixPreCommand items for PATH setup and verification |
| tests/helix/send-to-helix-basictests.targets | Enables Azure CLI for basic tests by setting NeedsAzCli=true |
Co-authored-by: Copilot <[email protected]>
Description
Adds Azure CLI to Helix test runs following the existing pattern for Azure Functions CLI. The CLI is downloaded from the aka.ms redirect, extracted to
az-cli, and added to PATH for test execution.Changes
tests/helix/send-to-helix-inner.proj:_AzureCliUrlproperty pointing tohttps://aka.ms/installazurecliwindowszipx64NeedsAzCliconditional ItemGroup with:HelixCorrelationPayloadfor downloading/extracting toaz-clidestinationHelixPreCommandentries prependingaz-cli/binto PATH (Windows:%HELIX_CORRELATION_PAYLOAD%\az-cli\bin, non-Windows:$HELIX_CORRELATION_PAYLOAD/az-cli/bin)diron Windows,ls -laon Linux) and test tool accessibility (az --version)tests/helix/send-to-helix-basictests.targets:NeedsAzCli=trueto enable for basic test runsNotes
NeedsAzureFunctionsCliimplementationFixes these failures on azdo:
Checklist
Original prompt
This pull request was created as a result of the following prompt from Copilot chat.
💡 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.