Skip to content

Unclear error when deploying to improperly-tagged container app in non-revision mode #6342

Description

@JeffreyCA

azd used to return a useful, detailed error when deploying to an ACA resource that was improperly tagged:

ERROR: getting target resource: resource not found: unable to find a resource tagged with 'azd-service-name: CalculatorAgentLG'. Ensure the service resource is correctly tagged in your infrastructure configuration, and rerun provision

Now the error returned in this scenario is:

ERROR: failed deploying service 'CalculatorAgentLG': updating container app service: getting container app: getting container app: parameter containerAppName cannot be empty

I'm suspecting this might be a result of the changes in #5694 to swallow ResourceNotFound errors for Container App resources:

func (rm *resourceManager) resolveServiceResource(
ctx context.Context,
subscriptionId string,
resourceGroupName string,
serviceConfig *ServiceConfig,
rerunCommand string,
) (*azapi.ResourceExtended, error) {
azureResource, err := rm.GetServiceResource(ctx, subscriptionId, resourceGroupName, serviceConfig, rerunCommand)
// If the service target supports delayed provisioning, the resource isn't expected to be found yet.
// Return the empty resource
var resourceNotFoundError *azureutil.ResourceNotFoundError
if err != nil &&
errors.As(err, &resourceNotFoundError) &&
ServiceTargetKind(serviceConfig.Host).SupportsDelayedProvisioning() {
return &azapi.ResourceExtended{}, nil
}
if err != nil {
return nil, err
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/acaAzure Container Apps

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions