AZ-400 ยท Deploying applications
Database deployments
Schema migration approaches (state-based DACPAC vs migration scripts, EF migrations), SqlAzureDacpacDeployment, backward-compatible changes, ordering database and app deployments, rollback of data changes.
Key points
- Two styles: state-based (a DACPAC describes the desired schema and publishing computes the diff) and migration-based (ordered scripts or EF migrations applied once).
- In Azure Pipelines, SqlAzureDacpacDeployment@1 can publish a DACPAC, run a SQL file or inline SQL.
- Keep changes backward compatible (expand, then contract) so the old app version keeps working during rollout and rollback of the app does not need a data rollback.
Practice questions
What makes DACPAC deployment state-based?
- It replays every past script in order each time
- It stores only data rows to be inserted
- It describes the target schema and the publish step computes the differences
- It requires the database to be empty
Show answer
Answer: C. It describes the target schema and the publish step computes the differences
A DACPAC holds the desired end state and the publish step works out the change script. Migration-based tools instead replay an ordered history of scripts.
Which statements about the SqlAzureDacpacDeployment@1 task are correct?
- deployType can be DacpacTask, SqlTask or InlineSqlTask
- It is supported only in a Windows environment
- By default it removes the agent firewall rule after the task ends
- It runs on Linux and macOS agents
- It can only deploy DACPAC files
Show answer
Answer: A. deployType can be DacpacTask, SqlTask or InlineSqlTask, B. It is supported only in a Windows environment, C. By default it removes the agent firewall rule after the task ends
deployType selects DACPAC, SQL script file or inline SQL; the task is supported only in a Windows environment; and by default it opens a firewall rule for the agent and deletes it afterwards. It does not run on Linux agents, and it is not limited to DACPAC files.
Redeploying the previous app version also restores the data in a column that a newer migration dropped.
Show answer
Answer: False
False. Rolling back code does not undo destructive schema or data changes. That is why drops are delayed until no running version needs the column.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
