azure-dev icon indicating copy to clipboard operation
azure-dev copied to clipboard

[Issue] When customizing container resources, error message is generic

Open brunoborges opened this issue 3 years ago • 2 comments

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 avatar Jul 15 '22 04:07 brunoborges

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

rajeshkamal5050 avatar Aug 04 '22 07:08 rajeshkamal5050

Another one for error states/handling exploration task https://github.com/Azure/azure-dev/issues/243

rajeshkamal5050 avatar Aug 16 '22 06:08 rajeshkamal5050

Similar issue #786

rajeshkamal5050 avatar Oct 04 '22 06:10 rajeshkamal5050

@weikanglim closing this one too assuming your fix should also surface up ContainerAppInvalidMemoryResource

  • https://github.com/Azure/azure-dev/pull/838

rajeshkamal5050 avatar Oct 14 '22 04:10 rajeshkamal5050