Azure / bicep

Bicep is a declarative language for describing and deploying Azure resources
MIT License
3.2k stars 742 forks source link

Bicep Incremental Deployment - Different behavior than ARM template #5991

Closed SomilGanguly closed 1 year ago

SomilGanguly commented 2 years ago

Bicep version 0.4.1272

Describe the bug

For incremental deployments (updates) of storage account "sku" and "kind" are supposed to be optional (that is the behavior in ARM templates). But in bicep, for incremental deployments it scopes "sku" and "kind" as mandatory. This creates a gap in the existing behavior of ARM and Bicep.

To Reproduce

For an existing Storage account try doing an incremental deployment without "sku" and "kind" properties. It would fail with bicep where as it would successfully deploy with an ARM template.

Additional context

image
alex-frankel commented 2 years ago

The validation on create and update should be the same. Can you share ARM Template code for the initial create and a template with the removed properties that deploys successfully on update?

SomilGanguly commented 2 years ago

Sure Alex, I have attached the ARM template and Bicep Template (below for your reference) which I am using for the incremental deployment for updating the storage account. If you see in the ARM template I have no properties for "sku" and "kind" and it updates successfully as per expectation (mentioned in MS docs as well - https://docs.microsoft.com/en-us/azure/templates/microsoft.storage/storageaccounts?tabs=bicep#sku). But while doing the same with Bicep it fails and it is expecting "sku" and "kind" as mandatory properties for incremental deployments.

StorageAccount_ARMTemplate.json.txt StorageAccount_Bicep.bicep.txt

alex-frankel commented 2 years ago

I see. Can you share some more details about the scenario? What is the workflow that requires a partial update like this? Why not include sku and kind to have a complete definition for either create or update?

Related: https://github.com/Azure/bicep/issues/5960

ghost commented 1 year ago

Hi SomilGanguly, this issue has been marked as stale because it was labeled as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thanks for contributing to bicep! :smile: :mechanical_arm: