Skip to content

Fix preview check to match Azure Marketplace conventions#796

Merged
psah434 merged 4 commits intomasterfrom
copilot/fix-vm-preview-check
Feb 13, 2026
Merged

Fix preview check to match Azure Marketplace conventions#796
psah434 merged 4 commits intomasterfrom
copilot/fix-vm-preview-check

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

  • Understand the issue: offer names can contain 'preview' but only those ending with 'preview' are actual preview offerings
  • Fix the test logic to check if offer ends with 'preview' instead of contains 'preview' anywhere
  • Create test case to validate offers with 'preview' in name but not ending with it (should pass)
  • Update existing fail test case to end with '-preview'
  • Verify all test cases work correctly
  • Address feedback: Changed offer pattern from '*-preview' to '*preview' (no hyphen required)
  • Update test examples to use generic offer names instead of vendor-specific names
  • Run code review (no issues found)
  • Run security scan (no vulnerabilities detected)
  • Complete task
Original prompt

This section details on the original issue you should resolve

<issue_title>False Failure for "Virtual Machines Should Not Be Preview"</issue_title>
<issue_description>The check for "Virtual Machines Should Not Be Preview" checks if the word preview is anywhere in the offer name which isn't how previews work. Preview offers only end with -preview but are allowed to have preview in the offer name itself. For example: https://marketplace.microsoft.com/en-us/product/trendmicro.zero-trust-secure-access-preview-st is not a preview offering.

Commit 1b69a9b added this breaking change.

This breaking change is causing us certification issues when attempting to update our marketplace offering.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 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.

Co-authored-by: psah434 <114955590+psah434@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix false failure for virtual machines preview check Fix preview check to match Azure Marketplace conventions Feb 13, 2026
Copilot AI requested a review from psah434 February 13, 2026 21:59
@psah434 psah434 marked this pull request as ready for review February 13, 2026 22:09
@psah434
Copy link
Member

psah434 commented Feb 13, 2026

@copilot change the check for offer from -preview to just preview.

@psah434
Copy link
Member

psah434 commented Feb 13, 2026

@copilot in the examples please remove the offer value to be something more random.

Co-authored-by: psah434 <114955590+psah434@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 13, 2026

@copilot change the check for offer from -preview to just preview.

Changed the offer check from *-preview to *preview as requested. The pattern now matches offers ending with "preview" (with or without a hyphen). All test cases still pass correctly. Commit: 9be57ca

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

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

  • aka.ms
    • Triggering command: /usr/bin/pwsh pwsh -Command Import-Module ./arm-ttk/arm-ttk.psd1 -Force Write-Host &#39;Testing offer with preview in middle: zero-trust-secure-access-preview-st&#39; $result = Test-AzTemplate -TemplatePath ./unit-tests/Virtual-Machines-Should-Not-Be-Preview/Pass/offer-with-preview-in-name (dns block)
    • Triggering command: /usr/bin/pwsh pwsh -Command Import-Module ./arm-ttk/arm-ttk.psd1 -Force Write-Host &#39;Testing Pass cases...&#39; Get-ChildItem ./unit-tests/Virtual-Machines-Should-Not-Be-Preview/Pass/*.json | ForEach-Object { Write-Host &#34;Testing $($_.Name)...&#34; $result = Test-AzTemplate -Template (dns block)

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

…ames

Co-authored-by: psah434 <114955590+psah434@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 13, 2026

@copilot in the examples please remove the offer value to be something more random.

Updated test examples to use generic offer names:

  • Pass case: product-preview-edition (has "preview" in middle, not a preview offering)
  • Fail case: test-offer-preview (ends with "preview", is a preview offering)

Both use generic TestPublisher instead of vendor-specific names. Commit: 45da707

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

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

  • aka.ms
    • Triggering command: /usr/bin/pwsh pwsh -Command Import-Module ./arm-ttk/arm-ttk.psd1 -Force Write-Host &#39;Testing Pass case: product-preview-edition (preview in middle)&#39; $result = Test-AzTemplate -TemplatePath ./unit-tests/Virtual-Machines-Should-Not-Be-Preview/Pass/offer-with-preview-in-name.json -Test (dns block)
    • Triggering command: /usr/bin/pwsh pwsh -Command Import-Module ./arm-ttk/arm-ttk.psd1 -Force Write-Host &#39;Running all Virtual Machines Should Not Be Preview tests...&#39; Write-Host &#39;&#39; Write-Host &#39;Pass cases:&#39; Get-ChildItem ./unit-tests/Virtual-Machines-Should-Not-Be-Preview/Pass/*.json | ForEach-Object { (dns block)

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

@psah434 psah434 merged commit 2d56a32 into master Feb 13, 2026
3 checks passed
@psah434 psah434 deleted the copilot/fix-vm-preview-check branch February 13, 2026 22:30
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.

False Failure for "Virtual Machines Should Not Be Preview"

2 participants