Skip to content

Add "Create new Azure Container Registry" option to the Build Image in Azure registry pick#547

Draft
bwateratmsft with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-create-new-azure-container-registry-issue
Draft

Add "Create new Azure Container Registry" option to the Build Image in Azure registry pick#547
bwateratmsft with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-create-new-azure-container-registry-issue

Conversation

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

The "Select registry" step of Azure Container Registry: Build Image in Azure... offered only existing registries, with no way to create a new one — unlike the push-image flow. The step relied on a bare registryExperience call rather than CreatePickAcrPromptStep.

Changes

  • Extracted pickAcr helper (commands/registries/azure/pickAcr.ts): given a subscription node, lists its ACRs plus a + Create new Azure Container Registry... item; on selection it runs createAzureRegistry and returns the created node.
  • scheduleRunRequest: swapped the direct registryExperience registry pick for subscriptionExperiencepickAcr, so "Build Image in Azure..." now surfaces the create-new option.
  • CreatePickAcrPromptStep (push-image flow): refactored to delegate to pickAcr, removing duplicated pick/create logic and keeping both flows consistent.

pickAcr returns UnifiedRegistryItem<AzureRegistry>, which is assignable to CommonRegistry for the push flow and yields an AzureRegistryItem wrappedItem for scheduleRunRequest — no unsafe casts needed.

export async function pickAcr(context: IActionContext, subscriptionNode: UnifiedRegistryItem<AzureSubscriptionRegistryItem>): Promise<UnifiedRegistryItem<AzureRegistry>> {
    const acrs = await ext.registriesRoot.getChildren(subscriptionNode) as UnifiedRegistryItem<AzureRegistry>[];
    const picks = acrs.map(acr => ({ label: acr.wrappedItem.label, data: acr }));
    picks.push({ label: vscode.l10n.t('$(plus) Create new Azure Container Registry...'), data: 'create' });
    // ...create-or-return selected registry
}

This deliberately avoids converting scheduleRunRequest into a full wizard (noted in the issue as conflicting with #112).

Notes for reviewers

Type-check/build could not be run in the sandbox — pnpm install failed with DNS errors (ENOTFOUND packagefeedproxy.microsoft.io), so TypeScript never installed. Please run pnpm build/pnpm lint to confirm.

Copilot AI changed the title [WIP] Fix missing '+ Create new Azure Container Registry...' option Add "Create new Azure Container Registry" option to the Build Image in Azure registry pick Jul 22, 2026
Copilot AI requested a review from bwateratmsft July 22, 2026 19:42
@bwateratmsft
bwateratmsft requested a review from Copilot July 23, 2026 14:35

This comment was marked as resolved.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@bwateratmsft bwateratmsft Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ideally we would convert this whole thing into a wizard...and then just reuse CreatePickAcrPtomptStep

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot see about doing this conversion...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 3d237d2: scheduleRunRequest is now an AzureWizard flow, and ACR selection now reuses CreatePickAcrPromptStep (via a shared wizard context type) instead of calling a separate direct picker path.

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.

There is no "+ Create new Azure Container Registry..." in "Select registry" option when executing "Build Image in Azure..." command

3 participants