When you deploy a Cloud Assembly template, one resource might need another resource to be available first.
Arrows only indicate a dependency, not a connection. To connect resources so that they communicate, see Getting started with Cloud Assembly designs.
Sometimes, a resource needs another to be deployed first. For example, a database server might need to exist first, before an application server can be created and configured to access it.
An explicit dependency sets the build order at deployment time, or for scale in or scale out actions. You can add an explicit dependency using the graphical design canvas or the code editor.
- Design canvas option—draw a connection starting at the dependent resource and ending at the resource to be deployed first.
- Code editor option—add a
dependsOnproperty to the dependent resource, and identify the resource to be deployed first.
An explicit dependency creates a solid arrow in the canvas.
Sometimes, a resource property needs a value found in a property of another resource. For example, a backup server might need the operating system image of the database server that is being backed up, so the database server must exist first.
Also called an implicit dependency, a property binding controls build order by waiting until the needed property is available before deploying the dependent resource. You add a property binding using the code editor.
- Edit the dependent resource, adding a property that identifies the resource and property that must exist first.
A property binding creates a dashed arrow in the canvas.