question

JBowley avatar image
0 Votes"
JBowley asked DCtheGeek answered

Azure Blueprint - Sequencing - Artifacts with ascending prefixes within a single resource group are not being deployed in the desired order?

Hello,

I have approx. 10 child ARM template artifacts within a single RG.
They are labelled with prefixes such as A01, B02, C03....... up to J10.
My understanding is that the default sequencing is sorted by the child artifact name (hence the ascending alphabet prefixing).

However, the actual deployment appears random (i.e. D04 -> B02 -> E05 -> A01 etc.)
This is causing the deployment to fail as modules have sequential dependencies (i.e. D04 may require C03 which may require B02 which may require A01 and so on etc.)

Please advise what is happening.
This is undesired and causing a real headache with ARM template module sequencing.

azure-blueprints
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DCtheGeek avatar image
1 Vote"
DCtheGeek answered

It does sort by artifact name. A common mistake is that name is different than displayName. If we look at one of the built-in samples source, we can see that while displayName is "[Preview]: Audit NIST SP 800-53 R4 controls and deploy specific VM Extensions to support audit requirements", the name is a GUID, "18e5b847-d4b8-44f6-846a-6698f1af9631". If you didn't explicitly define the name when creating the artifacts, it's likely a GUID and why it appears random from what you'd expect.

You can correct this either by creating the artifacts with a name that matches your expected order or you can customize the sequencing order.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TristanKaufmann-2115 avatar image
0 Votes"
TristanKaufmann-2115 answered TristanKaufmann-2115 edited

What is quite confusing is that while creating Artifacts via the Portal, you are not able to set a name. You can only set the displayName.

You can display the GUID of the Artifact in console like that: az blueprint artifact list --blueprint-name myBlueprintName -s $LAB -o table

If you want to set dependencies you do need the GUID.

You can set dependencies like:
az blueprint artifact template update --artifact-name GUID-OF-ARTIFACT --blueprint-name myBlueprintName --depends-on GUID-OF-DEPENDING-ARTIFACT --s $MySupscriptionId

if you know the ID/or name you can set this also in your Template like so (dependsOn):

"resources": [ { "name": "[parameters('networkInterfaceName')]", "type": "Microsoft.Network/networkInterfaces", "apiVersion": "2018-10-01", "location": "[parameters('location')]", "dependsOn": [ "3dcb40e93016-4768-4768-4768-3dcb40e93016", ...
@DCtheGeek
is it only possible to choose the name while creating a new artifact via cli? It seems not possible to change the name of the artifact after the artifact has been created in portal...

However, documentation is not very obvious here also it should be possible to provide the name for the template in portal.




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DCtheGeek avatar image
0 Votes"
DCtheGeek answered

@TristanKaufmann-2115 That is correct, this is currently only possible via SDK. If you'd like to see this capability in the portal, please submit a UserVoice here: https://feedback.azure.com/forums/915958-azure-governance?category_id=345058

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.