Share via


New-AzBlueprintArtifact

Skapa en ny artefakt och spara den i en skissdefinition.

Syntax

New-AzBlueprintArtifact
   -Name <String>
   -Type <PSArtifactKind>
   -Blueprint <PSBlueprintBase>
   [-Description <String>]
   [-DependsOn <System.Collections.Generic.List`1[System.String]>]
   -TemplateParameterFile <String>
   -TemplateFile <String>
   [-ResourceGroupName <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzBlueprintArtifact
   -Name <String>
   -Blueprint <PSBlueprintBase>
   -ArtifactFile <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzBlueprintArtifact
   -Name <String>
   -Type <PSArtifactKind>
   -Blueprint <PSBlueprintBase>
   [-Description <String>]
   [-DependsOn <System.Collections.Generic.List`1[System.String]>]
   -RoleDefinitionId <String>
   -RoleDefinitionPrincipalId <String[]>
   [-ResourceGroupName <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzBlueprintArtifact
   -Name <String>
   -Type <PSArtifactKind>
   -Blueprint <PSBlueprintBase>
   [-Description <String>]
   [-DependsOn <System.Collections.Generic.List`1[System.String]>]
   -PolicyDefinitionId <String>
   -PolicyDefinitionParameter <Hashtable>
   [-ResourceGroupName <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Skapa en ny artefakt. Det finns två sätt att skapa en artefakt: antingen via en artefakt-JSON som indatafil eller genom att tillhandahålla infogade parametrar för artefakten. Även om JSON-metoden inte kräver att artefaktens typ anges som infogad parametermetod måste användaren ange artefaktens typ via parametern -Type.

Exempel

Exempel 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

Skapa en ny artefakt via en artefakt-JSON-fil.

Exempel 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

Skapa en ny artefakt via infogade parametrar.

Exempel 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

Skapa en ny artefakt via en ARM-mallfil.

Parametrar

-ArtifactFile

Plats för artefaktfilen i JSON-format på disk.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Blueprint

Skissobjekt.

Type:PSBlueprintBase
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

Uppmanar dig att bekräfta innan du kör cmdleten.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

Autentiseringsuppgifter, konto, klientorganisation och prenumeration som används för kommunikation med Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DependsOn

Lista över namnen på artefakter som måste skapas innan den aktuella artefakten skapas.

Type:List<T>[String]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Description

Beskrivning av artefakten.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Name

Artefaktens namn

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PolicyDefinitionId

Definitions-ID för principdefinitionen.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PolicyDefinitionParameter

Hashtable med parametrar som ska skickas till principdefinitionsartefakten.

Type:Hashtable
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

Namnet på resursgruppen som artefakten kommer att finnas under.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-RoleDefinitionId

Lista över rolldefinition

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-RoleDefinitionPrincipalId

Lista över rolldefinitionens huvudnamns-ID:er.

Type:String[]
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TemplateFile

Plats för ARM-mallfilen på disken.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TemplateParameterFile

Plats för ARM-mallparameterfilen på disken.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Type

Artefaktens typ. Det finns tre typer som stöds: RoleAssignmentArtifact, PolicyAssignmentArtifact, TemplateArtifact.

Type:PSArtifactKind
Accepted values:RoleAssignmentArtifact, PolicyAssignmentArtifact, TemplateArtifact
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Visar vad som skulle hända om cmdleten kördes. Cmdleten körs inte.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Indata

String

PSArtifactKind

PSBlueprintBase

List<T>[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

Hashtable

String[]

Utdata

Artifact