Skip to content

developer-cli deploy registers the wrong resource provider for Container Apps #906

@raix

Description

@raix

Contact Details

No response

Bug description

Problem

PrepareSubscription in developer-cli/Commands/DeployCommand.cs registers Microsoft.ContainerService (Azure Kubernetes Service), which Container
Apps doesn't use. The two providers Container Apps actually requires — Microsoft.App and Microsoft.OperationalInsights — are never registered.

The bicep infra deploy still works because ARM auto-registers providers for resource types in a template. But the application deploy uses az containerapp update, which checks the subscription's provider registration and fails:

ERROR: Subscription <id> is not registered for the Microsoft.App resource provider.
Please run "az provider register -n Microsoft.App --wait" to register your subscription.

Result: infra + placeholder app come up, but the built application never deploys.

There's also a race: az provider register is asynchronous, so even registering the right provider without --wait can lose to the deployment.

Fix

In PrepareSubscription, register the correct providers with --wait:

foreach (var resourceProvider in new[] { "Microsoft.App", "Microsoft.OperationalInsights" })
{
    RunAzureCliCommand($"provider register --namespace {resourceProvider} --wait --subscription {subscriptionId}", ...);
}

Drop Microsoft.ContainerService (AKS is not used).

References


Severity

Low

Is this bug security related?

  • This bug is related to security

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions