Powershell Blueprint Import Error

Thomas K Vu 41 Reputation points
2022-04-18T14:45:10.677+00:00

I am following this document to export/import blueprints:
https://learn.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
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

Accepted answer
  1. Tim Warner [MSFT] 76 Reputation points
    2022-04-18T17:35:25.237+00:00

    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

    1. Make sure your Azure subscription context is accurate:

    Set-AzContext -SubscriptionName "mySubscription"

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

    0 comments No comments

0 additional answers

Sort by: Most helpful