New-AzBlueprintArtifact
Create a new artifact and save it within a blueprint definition.
Syntax
CreateTemplateArtifact (Default)
New-AzBlueprintArtifact
-Name <String>
-Type <PSArtifactKind>
-Blueprint <PSBlueprintBase>
-TemplateParameterFile <String>
-TemplateFile <String>
[-Description <String>]
[-DependsOn <System.Collections.Generic.List`1[System.String]>]
[-ResourceGroupName <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzBlueprintArtifact
-Name <String>
-Blueprint <PSBlueprintBase>
-ArtifactFile <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
CreateRoleAssignmentArtifact
New-AzBlueprintArtifact
-Name <String>
-Type <PSArtifactKind>
-Blueprint <PSBlueprintBase>
-RoleDefinitionId <String>
-RoleDefinitionPrincipalId <String[]>
[-Description <String>]
[-DependsOn <System.Collections.Generic.List`1[System.String]>]
[-ResourceGroupName <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
CreatePolicyArtifact
New-AzBlueprintArtifact
-Name <String>
-Type <PSArtifactKind>
-Blueprint <PSBlueprintBase>
-PolicyDefinitionId <String>
-PolicyDefinitionParameter <Hashtable>
[-Description <String>]
[-DependsOn <System.Collections.Generic.List`1[System.String]>]
[-ResourceGroupName <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Create a new artifact. There are two ways to create an artifact: either through an artifact JSON as an input file or through providing inline parameters for the artifact.
While the JSON method doesn't require type of the artifact to be provided inline parameter method requires user to provide the type of the artifact through -Type parameter.
Examples
Example 1
$bp = Get-AzBlueprint -Name SimpleBlueprint
New-AzBlueprintArtifact -Name PolicyStorage -Blueprint $bp -ArtifactFile C:\PolicyAssignmentStorageTag.json
DisplayName :
Description : Apply storage tag and the parameter also used by the template to resource groups
DependsOn :
PolicyDefinitionId : /providers/Microsoft.Authorization/policyDefinitions/49c88fc8-6fd1-46fd-a676-f12d1d3a4c71
Parameters : {[tagName, Microsoft.Azure.Commands.Blueprint.Models.PSParameterValue], [tagValue, Microsoft.Azure.Commands.Blueprint.Models.PSParameterValue]}
ResourceGroup :
Id : /subscriptions/{subscriptionId}/providers/Microsoft.Blueprint/blueprints/AppNetwork/artifacts/PolicyAssignmentStorageTag
Type : Microsoft.Blueprint/blueprints/artifacts
Name : PolicyAssignmentStorageTag
Create a new artifact through an artifact JSON file.
Example 2
$bp = Get-AzBlueprint -Name SimpleBlueprint
New-AzBlueprintArtifact -Type PolicyAssignmentArtifact -Name "ApplyTag-RG" -Blueprint $bp -PolicyDefinitionId "/providers/Microsoft.Authorization/policyDefinitions/49c88fc8-6fd1-46fd-a676-f12d1d3a4c71" -PolicyDefinitionParameter @{tagName="[parameters('tagName')]"; tagValue="[parameters('tagValue')]"} -ResourceGroupName storageRG
DisplayName : ApplyTag-RG
Description :
DependsOn :
PolicyDefinitionId : /providers/Microsoft.Authorization/policyDefinitions/49c88fc8-6fd1-46fd-a676-f12d1d3a4c71
Parameters : {[tagValue, Microsoft.Azure.Commands.Blueprint.Models.PSParameterValue], [tagName,
Microsoft.Azure.Commands.Blueprint.Models.PSParameterValue]}
ResourceGroup : storageRG
Id : /subscriptions/28cbf98f-381d-4425-9ac4-cf342dab9753/providers/Microsoft.Blueprint/blueprints/AppNetwork/
artifacts/ApplyTag-RG
Type : Microsoft.Blueprint/blueprints/artifacts
Name : ApplyTag-RG
Create a new artifact through inline parameters.
Example 3
$bp = Get-AzBlueprint -Name SimpleBlueprint
New-AzBlueprintArtifact -Type TemplateArtifact -Name storage-account -Blueprint $bp -TemplateFile C:\StorageAccountArmTemplate.json -ResourceGroupName "storageRG" -TemplateParameterFile C:\Workspace\BlueprintTemplates\RestTemplatesSomeInline\StorageAccountParameters.json
DisplayName : storage-account
Description :
DependsOn :
Template : {$schema, contentVersion, parameters, variables...}
Parameters : {}
ResourceGroup : storageRG
Id : /subscriptions/{subscriptionId}/providers/Microsoft.Blueprint/blueprints/AppNetwork/artifacts/storage-account
Type : Microsoft.Blueprint/blueprints/artifacts
Name : storage-account
Create a new artifact through an ARM template file.
Parameters
-ArtifactFile
Location of the artifact file in JSON format on disk.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateArtifactByInputFile
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Blueprint
Blueprint object.
Parameter properties
Type: PSBlueprintBase
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateTemplateArtifact
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
CreateRoleAssignmentArtifact
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
CreatePolicyArtifact
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DependsOn
List of the names of artifacts that needs to be created before current artifact is created.
Parameter properties
Type: List<T> [ String ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateTemplateArtifact
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
CreateRoleAssignmentArtifact
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
CreatePolicyArtifact
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Description
Description of the artifact.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateTemplateArtifact
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
CreateRoleAssignmentArtifact
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
CreatePolicyArtifact
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Name
Name of the artifact
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-PolicyDefinitionId
Definition Id of the policy definition.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreatePolicyArtifact
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-PolicyDefinitionParameter
Hashtable of parameters to pass to the policy definition artifact.
Parameter properties
Type: Hashtable
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreatePolicyArtifact
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ResourceGroupName
Name of the resource group the artifact is going to be under.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateTemplateArtifact
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
CreateRoleAssignmentArtifact
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
CreatePolicyArtifact
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-RoleDefinitionId
List of role definition
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateRoleAssignmentArtifact
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-RoleDefinitionPrincipalId
List of role definition principal ids.
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateRoleAssignmentArtifact
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-TemplateFile
Location of the ARM template file on disk.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateTemplateArtifact
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-TemplateParameterFile
Location of the ARM template parameter file on disk.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateTemplateArtifact
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Type
Type of the artifact.
There are 3 types supported: RoleAssignmentArtifact, PolicyAssignmentArtifact, TemplateArtifact.
Parameter properties
Type: PSArtifactKind
Default value: None
Accepted values: RoleAssignmentArtifact, PolicyAssignmentArtifact, TemplateArtifact
Supports wildcards: False
DontShow: False
Parameter sets
CreateTemplateArtifact
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
CreateRoleAssignmentArtifact
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
CreatePolicyArtifact
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs