question

ThomasKVu-6334 avatar image
0 Votes"
ThomasKVu-6334 asked TimWarnerMSFT answered

Powershell Blueprint Import Error

I am following this document to export/import blueprints:
https://docs.microsoft.com/en-us/azure/governance/blueprints/how-to/import-export-ps

Using Azure Powershell, I was able to export the blueprint from a management group to my local machine. The problem arises when I try importing using the command in the document. I get this error even though I'm logged in and verified the subscription id is correct:
Import-AzBlueprintWithArtifact: The subscription 'mySubscription' could not be found.

I then tried to import it into a Management Group instead of Subscription. I get this error:
Import-AzBlueprintWithArtifact: Object reference not set to an instance of an object.

Has anyone found the solution to this or a workaround? Thank you

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.

1 Answer

TimWarnerMSFT avatar image
0 Votes"
TimWarnerMSFT answered

Hi Thomas,

A few things to try:

  1. Make sure you're using the latest version of the Az.Blueprint PowerShell module:

    Update-Module -Name Az.Blueprint

  2. Make sure your Azure subscription context is accurate:

    Set-AzContext -SubscriptionName "mySubscription"

  3. Verify your role-based access control (RBAC) permissions at the desired scope(s)

Also, please note that Azure Blueprints is gradually being replaced by Azure Resource Manager (ARM) template specs and deployment stacks. Just FYI.

Thanks a lot,
Tim

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.