A kelp-farm inventory deploy should ensure database kelp-db exists on first run and must not fail when the database is already present on later deploys. Which SDK approach fits?
Select an answer to reveal the explanation.
Short Explanation
First deploy builds the greenhouse; next deploy shouldn’t burn it down. Use create-if-not-exists so kelp-db appears once and later runs smile and move on.
Full Explanation
Deploy scripts for kelp-farm inventory should call the Cosmos SDK’s create-if-not-exists (idempotent) database API for kelp-db. On first run the database is created; on later runs the call succeeds without treating “already exists” as a fatal error. That pattern supports repeatable continuous deployment for database provisioning through the SDK.
Always calling a non-idempotent create and ignoring every failure status is unsafe: you may ignore real permission or quota failures while still not guaranteeing the database exists. Deleting and recreating the database on every deploy destroys data and downtime is unacceptable for inventory. Creating the database only through a one-time portal click refuses automation and breaks the “must not fail on later deploys” pipeline requirement.
Exam caveat: infrastructure-as-code (Bicep/ARM/Terraform) can also create databases idempotently; this item targets the SDK create-if-not-exists pattern when the question frames application/SDK provisioning. Idempotent container create still requires a partition key path. Operational check: run the deploy twice against the same account, assert both runs exit successfully, and verify a single kelp-db database remains with no accidental delete/recreate cycle in activity logs.