共用方式為


New-AzResourceGroupDeployment

將 Azure 部署新增至資源群組。

語法

ByTemplateFileWithNoParameters (預設值)

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateFile <String>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByTemplateObjectAndParameterObject

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateParameterObject <Hashtable>
    -TemplateObject <Hashtable>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByTemplateFileAndParameterObject

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateParameterObject <Hashtable>
    -TemplateFile <String>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByTemplateUriAndParameterObject

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateParameterObject <Hashtable>
    -TemplateUri <String>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByTemplateSpecResourceIdAndParamsObject

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateParameterObject <Hashtable>
    -TemplateSpecId <String>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByTemplateObjectAndParameterFile

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateParameterFile <String>
    -TemplateObject <Hashtable>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByTemplateFileAndParameterFile

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateParameterFile <String>
    -TemplateFile <String>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByTemplateUriAndParameterFile

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateParameterFile <String>
    -TemplateUri <String>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByTemplateSpecResourceIdAndParams

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateParameterFile <String>
    -TemplateSpecId <String>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByParameterFileWithNoTemplate

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateParameterFile <String>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByTemplateObjectAndParameterUri

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateParameterUri <String>
    -TemplateObject <Hashtable>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByTemplateFileAndParameterUri

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateParameterUri <String>
    -TemplateFile <String>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByTemplateUriAndParameterUri

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateParameterUri <String>
    -TemplateUri <String>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByTemplateSpecResourceIdAndParamsUri

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateParameterUri <String>
    -TemplateSpecId <String>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByTemplateObjectWithNoParameters

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateObject <Hashtable>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByTemplateUriWithNoParameters

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateUri <String>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByTemplateSpecResourceId

New-AzResourceGroupDeployment
    -ResourceGroupName <String>
    -TemplateSpecId <String>
    [-Name <String>]
    [-Mode <DeploymentMode>]
    [-DeploymentDebugLogLevel <String>]
    [-RollbackToLastDeployment]
    [-RollBackDeploymentName <String>]
    [-Tag <Hashtable>]
    [-WhatIfResultFormat <WhatIfResultFormat>]
    [-WhatIfExcludeChangeType <String[]>]
    [-Force]
    [-ProceedIfNoChange]
    [-AsJob]
    [-AuxTenant <String[]>]
    [-QueryString <String>]
    [-ValidationLevel <String>]
    [-SkipTemplateParameterPrompt]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

New-AzResourceGroupDeployment Cmdlet 會將部署新增至現有的資源群組。 這包括部署所需的資源。 Azure 資源是使用者管理的 Azure 實體,例如資料庫伺服器、資料庫、網站、虛擬機器或儲存體帳戶。 Azure 資源群組是部署為單位的 Azure 資源集合,例如財務網站所需的網站、資料庫伺服器和資料庫。 資源群組部署會使用範本將資源新增至資源群組,並發佈資源,以便在 Azure 中使用。 若要在不使用範本的情況下將資源新增至資源群組,請使用 New-AzResource Cmdlet。 若要新增資源群組部署,請指定現有資源群組的名稱和資源群組範本。 資源群組範本是 JSON 字串,代表複雜雲端式服務 (例如 Web 入口網站) 的資源群組。 範本包含必要資源的參數預留位置,以及可設定的屬性值,例如名稱和大小。 您可以在 Azure 範本資源庫中找到許多範本,也可以建立自己的範本。 若要使用自訂範本來建立資源群組,請指定 TemplateFile 參數或 TemplateUri 參數。 每個範本都有可設定內容的參數。 若要指定範本參數的值,請指定 TemplateParameterFile 參數或 TemplateParameterObject 參數。 或者,您可以使用指定範本時動態新增至指令的範本參數。 若要使用動態參數,請在指令提示字元中鍵入這些參數,或鍵入減號 (-) 來指示參數,並使用 Tab 鍵循環瀏覽可用參數。 您在指令提示下輸入的範本參數值優先於範本參數物件或檔案中的值。

範例

範例 1:使用自訂範本和參數檔案來建立部署

New-AzResourceGroupDeployment -ResourceGroupName "ContosoEngineering" -TemplateFile "D:\Azure\Templates\EngineeringSite.json" -TemplateParameterFile "D:\Azure\Templates\EngSiteParms.json" -Tag @{"key1"="value1"; "key2"="value2";}

此命令會使用自訂範本和磁碟上的範本檔案,並使用已定義的標籤參數來建立新的部署。 此命令會使用 TemplateFile 參數來指定範本,並使用 TemplateParameterFile 參數來指定包含參數和參數值的檔案。

範例 2:使用自訂範本物件和參數檔案來建立部署

$TemplateFileText = [System.IO.File]::ReadAllText("D:\Azure\Templates\EngineeringSite.json")
$TemplateObject = ConvertFrom-Json $TemplateFileText -AsHashtable
New-AzResourceGroupDeployment -ResourceGroupName "ContosoEngineering" -TemplateObject $TemplateObject -TemplateParameterFile "D:\Azure\Templates\EngSiteParams.json"

此命令會使用磁碟上已轉換成記憶體內雜湊表的自訂和範本檔案來建立新的部署。 前兩個命令會讀取磁碟上範本檔案的文字,並將它轉換成記憶體內雜湊表。 最後一個命令會使用 TemplateObject 參數來指定雜湊表,並使用 TemplateParameterFile 參數來指定包含參數和參數值的檔案。

範例 3

將 Azure 部署新增至資源群組。 (autogenerated)

New-AzResourceGroupDeployment -DeploymentDebugLogLevel RequestContent -Name mynewstorageaccount -ResourceGroupName 'ContosoEngineering' -TemplateFile 'D:\Azure\Templates\EngineeringSite.json' -TemplateParameterObject <Hashtable>

範例 4:使用 URI 和 SAS 權杖部署儲存在非公用儲存體帳戶中的範本

New-AzResourceGroupDeployment -ResourceGroupName "RGName" -TemplateUri "https://example.com/example.json" -QueryString "foo"

此命令會使用 TemplateUri 中的範本建立新的部署,該範本不是公用的,而且需要權杖參數才能存取,該參數將使用 QueryString 參數提供。 執行此命令會使用 url https://example.com/example.json?foo有效地存取範本。 如果您想要在儲存體帳戶中使用範本,方法是提供 SAS 權杖作為 QueryString,可以使用此功能

範例 5:使用 .bicepparam 檔案建立部署

New-AzResourceGroupDeployment -ResourceGroupName "RGName"  -TemplateParameterFile "./parameters.bicepparam"

此命令會使用磁碟上的 .bicepparam 檔案,在資源群組範圍建立新的部署。 此命令會使用 TemplateParameterFile 參數來指定 .bicepparam 檔案。

參數

-AsJob

在背景執行 Cmdlet

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-AuxTenant

跨租用戶部署的輔助租用戶識別碼

參數屬性

類型:

String[]

預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-Confirm

在執行 Cmdlet 之前,提示您進行確認。

參數屬性

類型:SwitchParameter
預設值:False
支援萬用字元:False
不要顯示:False
別名:參見

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-DefaultProfile

用來與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶

參數屬性

類型:IAzureContextContainer
預設值:None
支援萬用字元:False
不要顯示:False
別名:AzContext, AzureRmContext, AzureCredential

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-DeploymentDebugLogLevel

指定除錯記錄層級。 此參數可接受的值為:

  • 請求內容
  • 回應內容
  • 全部
  • None

參數屬性

類型:String
預設值:None
接受的值:RequestContent, ResponseContent, All, None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-Force

強制命令執行,而不要求使用者確認。

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-Mode

指定部署模式。 此參數可接受的值為:

  • 完成:在完整模式中,資源管理員會刪除資源群組中存在但範本中未指定的資源。
  • 累加:在累加模式中,Resource Manager 會保留資源群組中存在但未在範本中指定的未變更資源。

參數屬性

類型:DeploymentMode
預設值:Incremental
接受的值:Incremental, Complete
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-Name

它將要建立的部署名稱。 如果未指定,則預設為提供範本檔案時的範本檔名;預設為提供範本物件的目前時間,例如「20131223140835」。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False
別名:部署名稱

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-Pre

指出此 Cmdlet 在自動決定要使用的版本時,會考慮發行前 API 版本。

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-ProceedIfNoChange

如果 What-If 結果沒有變化,請勿要求確認。 適用於設定 -Confirm 開關時。

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-QueryString

查詢字串 (例如,SAS 權杖) 要與 TemplateUri 參數搭配使用。 將用於鏈接模板的情況

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-ResourceGroupName

指定要部署的資源群組名稱。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-RollBackDeploymentName

如果使用資源群組中指定的名稱,則不應使用復原至成功部署 -RollbackToLastDeployment。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-RollbackToLastDeployment

如果使用資源群組中最後一個成功的部署,則不應存在 -RollBackDeploymentName。

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-SkipTemplateParameterPrompt

略過 PowerShell 動態參數處理,以檢查提供的範本參數是否包含範本所使用的所有必要參數。 此檢查會提示使用者提供遺漏參數的值,但提供 -SkipTemplateParameterPrompt 會忽略此提示,並在發現參數未繫結在範本中時立即出錯。 對於非互動式指令碼,可以提供 -SkipTemplateParameterPrompt,以便在未滿足所有必要參數的情況下提供更好的錯誤訊息。

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-Tag

要放在部署上的標籤。

參數屬性

類型:Hashtable
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-TemplateFile

指定自訂範本檔案的完整路徑。 支援的範本檔案類型:json 和 bicep。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

ByTemplateFileWithNoParameters
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateFileAndParameterObject
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateFileAndParameterFile
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateFileAndParameterUri
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-TemplateObject

代表範本的雜湊表。

參數屬性

類型:Hashtable
預設值:None
支援萬用字元:False
不要顯示:False

參數集

ByTemplateObjectAndParameterObject
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateObjectAndParameterFile
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateObjectAndParameterUri
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateObjectWithNoParameters
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-TemplateParameterFile

指定包含範本參數名稱和值的 JSON 檔案的完整路徑。 如果範本有參數,您必須使用 TemplateParameterFile 參數或 TemplateParameterObject 參數來指定參數值。 當您指定範本時,範本參數會動態新增至指令。 若要使用動態參數,請鍵入減號 (-) 來指示參數名稱,然後使用 Tab 鍵循環瀏覽可用的參數。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

ByTemplateObjectAndParameterFile
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateFileAndParameterFile
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateUriAndParameterFile
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateSpecResourceIdAndParams
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByParameterFileWithNoTemplate
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-TemplateParameterObject

指定範本參數名稱和值的雜湊表。 如需 Windows PowerShell 中雜湊表的說明,請輸入 Get-Help about_Hash_Tables。 如果範本有參數,您必須指定參數值。 當您指定範本時,範本參數會動態新增至指令。

參數屬性

類型:Hashtable
預設值:None
支援萬用字元:False
不要顯示:False

參數集

ByTemplateObjectAndParameterObject
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateFileAndParameterObject
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateUriAndParameterObject
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateSpecResourceIdAndParamsObject
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-TemplateParameterUri

指定範本參數檔案的 URI。 使用 TemplateParameterUri 時,會忽略您使用的任何動態參數。 若要使用動態參數,您必須改用 TemplateParameterFile 參數

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

ByTemplateObjectAndParameterUri
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateFileAndParameterUri
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateUriAndParameterUri
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateSpecResourceIdAndParamsUri
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-TemplateSpecId

要部署之 templateSpec 的資源 ID。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

ByTemplateSpecResourceIdAndParamsObject
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateSpecResourceIdAndParams
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateSpecResourceIdAndParamsUri
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateSpecResourceId
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-TemplateUri

指定自訂範本檔案的 URI。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

ByTemplateUriAndParameterObject
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateUriAndParameterFile
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateUriAndParameterUri
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False
ByTemplateUriWithNoParameters
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-ValidationLevel

設定驗證/假設的驗證層級。 ValidationLevel 可以是 Template(略過提供者驗證)、Provider(執行完整驗證)或 ProviderNoRbac(使用 RBAC 讀取檢查執行完整驗證,而不是提供者驗證的 RBAC 寫入檢查)。

參數屬性

類型:String
預設值:None(Provider)
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 指令未執行。

參數屬性

類型:SwitchParameter
預設值:False
支援萬用字元:False
不要顯示:False
別名:威斯康辛

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-WhatIfExcludeChangeType

要從 What-If 結果中排除的逗號分隔資源變更類型。 適用於設定 -WhatIf 或 -Confirm 開關時。

參數屬性

類型:

String[]

預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-WhatIfResultFormat

What-If 結果格式。

參數屬性

類型:WhatIfResultFormat
預設值:None
接受的值:ResourceIdOnly, FullResourcePayloads
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

CommonParameters

此 cmdlet 支援常見參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters

輸入

String

Microsoft.Azure.Management.ResourceManager.Models.DeploymentMode

Hashtable

輸出

PSResourceGroupDeployment