[Issue] When customizing container resources, error message is generic
I've updated the Bicep configuration to include memory and CPU requests for Azure Container Apps.
Accidentally (yay YAML) the value inputed was ' 2Gi' (with a whitespace in the beginning of the value).
The command and provision fails with the following error:
$ azd provision
Provisioning Azure resources can take some time.
You can view detailed progress in the Azure Portal:
https://portal.azure.com/#blade/HubsExtension/DeploymentDetailsBlade/overview/id/%2Fsubscriptions%2F<redacted>%2Fproviders%2FMicrosoft.Resources%2Fdeployments%2Ftodo-nodejs-mongo
Created Azure resources
Error: deployment failed: failed deploying: failed running az deployment sub create:
Deployment Error Details:
InvalidTemplateDeployment: The template deployment 'todo-nodejs-mongo' is not valid according to the validation procedure. The tracking id is 'f4288268-3e40-4521-a2f9-69d8385f3a04'. See inner errors for details.
Only after enabling --debug I could identify the real problem:
Inner Errors:
{"code": "ContainerAppInvalidMemoryResource", "message": "Container with name 'main' has an invalid memory resource request: ' 2Gi'. The 'memory' field for each container, if provided, must contain a decimal value to no more than 2 decimal places followed by 'Gi' to denote the unit (Gibibytes). Example: '1.25Gi' or '2Gi'."}
@brunoborges hope you were able to proceed further and did not run into issues.
@jongio @savannahostrowski Moving it to On Deck milestone to improve on error handling and reporting.
Another one for error states/handling exploration task https://github.com/Azure/azure-dev/issues/243
Similar issue #786
@weikanglim closing this one too assuming your fix should also surface up ContainerAppInvalidMemoryResource
- https://github.com/Azure/azure-dev/pull/838