azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Import-AzBlueprintWithArtifact not finding artifact's folder and not importing artifacts

Open PhelixPhoenix opened this issue 3 years ago • 1 comments

Description

When running the command Import-AzBlueprintWithArtifact and pointing it to the folder containing blueprint.json the blueprint is imported, confirmed by the creation of the RG defined in the blueprint, but none of the artifacts are created, confirmed by looking at the blueprint definition in the portal.

Folder structure /

  • deploy.ps1
  • /-Dev-SoftwareEngineering
    • blueprint.json
    • /artifact #note. got error: import-azblueprintwithartifact: 'artifact' cannot be null, when this folder was named 'artifacts'
      • vnet.json
      • policy-assignment.json
      • etc

Issue script & Debug output

> Import-AzBlueprintWithArtifact -Name <somecompany>-Dev-SoftwareEngineering -ManagementGroupId "<somemgmtgroup>" -InputPath .\<sometext>-Dev-SoftwareEngineering -Force
>

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.5
PSEdition                      Core
GitCommitId                    7.2.5
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.9.1                 Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     0.4.0                 Az.Blueprint                        {Export-AzBlueprintWithArtifact, Get-AzBlueprint, Get-AzBlueprintArtifact, Get-AzBlueprintAssignment…}
Script     6.1.0                 Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…}

Error output

no errors from command run.

PhelixPhoenix avatar Aug 08 '22 21:08 PhelixPhoenix

I worked with a MSFT Support engineer with Azure and got this working, however working from the documentation https://docs.microsoft.com/en-us/azure/governance/blueprints/ there is inadequate information to actually deploy a Blueprint with Artifacts. I was directed here https://docs.microsoft.com/en-us/azure/templates/microsoft.blueprint/blueprints/artifacts?pivots=deployment-language-arm-template#blueprintsartifacts-objects-1, where the only reference to what you needed to add to your ARM templates was the TemplateArtiface and TemplateArtifactProperties sections. A link between the two documents at minimum would be nice. However, there was still no error message from the PowerShell command indicating anything was wrong with the import or returned any useful information that might lead one to investigate the Blueprint Artifacts attempting to be imported.

PhelixPhoenix avatar Aug 09 '22 21:08 PhelixPhoenix

Thank you for your feedback. This has been routed to the support team for assistance.

msftbot[bot] avatar Aug 10 '22 15:08 msftbot[bot]

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @alex-frankel, @filizt.