Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honor the deployment mode of the offer plan's technical configuration #506

Open
bobjac opened this issue Oct 4, 2023 · 1 comment
Open

Comments

@bobjac
Copy link
Contributor

bobjac commented Oct 4, 2023

Requirements

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

  1. 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.
  2. 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

References

Marketplace Portal UI

[docs for deployment mode](Reference: https://learn.microsoft.com/en-us/partner-center/marketplace/plan-azure-app-managed-app#deployment-mode)

@bobjac bobjac added this to the CY23 Q2 - Cycle 3 (2023-15-12) milestone Oct 5, 2023
@kevinhillinger
Copy link
Member

Pending based on private preview results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants