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

John Bowley 1 Reputation point
2020-07-24T10:29:29.39+00:00

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
Azure Blueprints
An Azure service that provides templates for quick, repeatable creation of fully governed cloud subscriptions.
70 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. DCtheGeek-MSFT 451 Reputation points Microsoft Employee
    2020-07-25T21:02:02.687+00:00

    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.

    1 person found this answer helpful.
    0 comments No comments

  2. Simon Tristan Kaufmann 1 Reputation point
    2020-12-26T12:31:34.857+00:00

    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-MSFT
    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.

    0 comments No comments

  3. DCtheGeek-MSFT 451 Reputation points Microsoft Employee
    2021-01-04T16:14:11.093+00:00

    @Simon Tristan Kaufmann 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

    0 comments No comments