The deployment mode of the plan technical configuration should be honored down according to the capabilities of the deployment type.
manifest.json
Update the specification of the manifest.json file to include attribute that can be set from the Offer Plan's technical configuration when being packaged.
Attribute Name: deploymentMode
Value: the value that comes from the result of the technical configuration [Incremental | Complete]
Terraform
Incremental Deployment (ARM) and Terraform:
This is the default behavior of Terraform.
When you run terraform apply, Terraform will create or update resources in your Azure environment to match your configuration. It won't delete resources that are not defined in your Terraform configuration, mimicking the Incremental deployment mode in ARM.
Terraform uses a state file to keep track of the resources it manages. If a resource exists in the state file but not in the configuration, it won't be automatically deleted.
Complete Deployment (ARM) and Terraform:
Achieving a "complete" deployment behavior in Terraform requires some extra steps.
If you want Terraform to delete resources that are not in your configuration, you can use the -target flag to target specific resources or sets of resources. But this isn't exactly like ARM's complete mode because you have to specify what to target manually.
A more encompassing way is to maintain different state files for different sets of resources or environments. If you delete a resource from your configuration and run terraform apply, Terraform will notice the difference between the state file and your configuration and will delete the resource. This approach requires careful state management.
Another method is to entirely delete the Terraform state file and the associated resources, and then redeploy from scratch. This is a drastic measure and can be destructive.
Note: One key difference is that ARM's Complete mode is a built-in feature that automatically deletes any resources in the resource group that aren't in the template. Terraform doesn't have this behavior by default, and achieving it requires more deliberate management of your configurations and state.
For Terraform deployments with complete mode, the resource group may need to be wiped clean before executing a terraform apply against a new state file
Bicep
The deployment mode must be passed to the execution of the deploy.sh script. Example:
az deployment group create --mode Complete
Implementation
Jenkins input parameters must be introduced since the value of deploymentMode cannot be contained in a parameters file
This value must be passed or a conditional statement be used based on its value at runtime
Requirements
The deployment mode of the plan technical configuration should be honored down according to the capabilities of the deployment type.
manifest.json
deploymentMode
Terraform
Incremental Deployment (ARM) and Terraform:
terraform apply
, Terraform will create or update resources in your Azure environment to match your configuration. It won't delete resources that are not defined in your Terraform configuration, mimicking the Incremental deployment mode in ARM.Complete Deployment (ARM) and Terraform:
-target
flag to target specific resources or sets of resources. But this isn't exactly like ARM's complete mode because you have to specify what to target manually.terraform apply
, Terraform will notice the difference between the state file and your configuration and will delete the resource. This approach requires careful state management.Note: One key difference is that ARM's Complete mode is a built-in feature that automatically deletes any resources in the resource group that aren't in the template. Terraform doesn't have this behavior by default, and achieving it requires more deliberate management of your configurations and state.
For Terraform deployments with complete mode, the resource group may need to be wiped clean before executing a
terraform apply
against a new state fileBicep
The deployment mode must be passed to the execution of the deploy.sh script. Example:
Implementation
deploymentMode
cannot be contained in a parameters fileReferences
Marketplace Portal UI
[docs for deployment mode](Reference: https://learn.microsoft.com/en-us/partner-center/marketplace/plan-azure-app-managed-app#deployment-mode)