Skip to content

Commit

Permalink
Fail when switching to free and having extensions
Browse files Browse the repository at this point in the history
Signed-off-by: Ihab Zhaika <ihabzhaika@microsoft.com>
  • Loading branch information
Ihab-Zhaika committed Sep 12, 2023
1 parent 8c8b3b5 commit 6b68e42
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ func resourceSecurityCenterSubscriptionPricingUpdate(d *pluginsdk.ResourceData,
},
}

if _, isThereExtensions := d.GetOk("extension"); isThereExtensions && pricing.Properties.PricingTier == "Free" {
return fmt.Errorf("Can not have enabled extensions when switching to free tier, please remove the extensions")
}

apiResponse, err := client.Get(ctx, id)
if d.IsNewResource() {
if err != nil {
Expand Down

0 comments on commit 6b68e42

Please sign in to comment.