New-AzTenantDeployment
Membuat penyebaran di cakupan penyewa
Sintaks
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateFile <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateParameterObject <Hashtable>
-TemplateObject <Hashtable>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateParameterObject <Hashtable>
-TemplateFile <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateParameterObject <Hashtable>
-TemplateUri <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateParameterObject <Hashtable>
-TemplateSpecId <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateParameterFile <String>
-TemplateObject <Hashtable>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateParameterFile <String>
-TemplateFile <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateParameterFile <String>
-TemplateUri <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateParameterFile <String>
-TemplateSpecId <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateParameterFile <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateParameterUri <String>
-TemplateObject <Hashtable>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateParameterUri <String>
-TemplateFile <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateParameterUri <String>
-TemplateUri <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateParameterUri <String>
-TemplateSpecId <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateObject <Hashtable>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateUri <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzTenantDeployment
[-Name <String>]
-Location <String>
[-DeploymentDebugLogLevel <String>]
[-Tag <Hashtable>]
[-WhatIfResultFormat <WhatIfResultFormat>]
[-WhatIfExcludeChangeType <String[]>]
[-ProceedIfNoChange]
[-AsJob]
[-QueryString <String>]
-TemplateSpecId <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Deskripsi
Cmdlet New-AzTenantDeployment menambahkan penyebaran di cakupan penyewa saat ini.
Untuk menambahkan penyebaran di cakupan penyewa, tentukan lokasi dan templat. Lokasi memberi tahu Azure Resource Manager tempat menyimpan data penyebaran. Templat adalah string JSON yang berisi sumber daya individual yang akan disebarkan. Templat mencakup tempat penampung parameter untuk sumber daya yang diperlukan dan nilai properti yang dapat dikonfigurasi, seperti nama dan ukuran.
Untuk menggunakan templat kustom untuk penyebaran, tentukan parameter TemplateFile atau parameter TemplateUri . Setiap templat memiliki parameter untuk properti yang dapat dikonfigurasi. Untuk menentukan nilai untuk parameter templat, tentukan parameter TemplateParameterFile atau parameter TemplateParameterObject . Atau, Anda dapat menggunakan parameter templat yang ditambahkan secara dinamis ke perintah saat Anda menentukan templat. Untuk menggunakan parameter dinamis, ketik parameter tersebut pada prompt perintah, atau ketik tanda minus (-) untuk menunjukkan parameter dan menggunakan tombol Tab untuk menelusuri parameter yang tersedia. Nilai parameter templat yang Anda masukkan di prompt perintah lebih diutamakan daripada nilai dalam objek atau file parameter templat.
Untuk menambahkan sumber daya ke grup sumber daya, gunakan New-AzResourceGroupDeployment yang membuat penyebaran di grup sumber daya. Untuk menambahkan sumber daya ke langganan, gunakan New-AzSubscriptionDeployment yang membuat penyebaran pada cakupan langganan, yang menyebarkan sumber daya tingkat langganan. Untuk menambahkan sumber daya di grup manajemen, gunakan New-AzManagementGroupDeployment yang membuat penyebaran di grup manajemen.
Contoh
Contoh 1: Gunakan templat kustom dan file parameter untuk membuat penyebaran
New-AzTenantDeployment -Location "West US" -TemplateFile "D:\Azure\Templates\OrgSetup.json" -TemplateParameterFile "D:\Azure\Templates\OrgParms.json" -Tag @{"key1"="value1"; "key2"="value2";}
Perintah ini membuat penyebaran baru di cakupan penyewa saat ini dengan menggunakan templat kustom dan file templat pada disk, dengan parameter tag yang ditentukan. Perintah ini menggunakan parameter TemplateFile untuk menentukan templat dan parameter TemplateParameterFile untuk menentukan file yang berisi parameter dan nilai parameter.
Contoh 2: Gunakan objek templat kustom dan file parameter untuk membuat penyebaran
$TemplateFileText = [System.IO.File]::ReadAllText("D:\Azure\Templates\OrgSetup.json")
$TemplateObject = ConvertFrom-Json $TemplateFileText -AsHashtable
New-AzTenantDeployment -Location "West US" -TemplateObject $TemplateObject -TemplateParameterFile "D:\Azure\Templates\OrgParams.json"
Perintah ini membuat penyebaran baru di penyewa saat ini dengan menggunakan templat kustom dan file templat pada disk yang telah dikonversi ke hashtable dalam memori. Dua perintah pertama membaca teks untuk file templat pada disk dan mengonversinya ke hashtable dalam memori. Perintah terakhir menggunakan parameter TemplateObject untuk menentukan hashtable ini dan parameter TemplateParameterFile untuk menentukan file yang berisi parameter dan nilai parameter.
Contoh 3: Gunakan file .bicepparam untuk membuat penyebaran
New-AzTenantDeployment -Location "West US" -TemplateParameterFile "./parameters.bicepparam"
Perintah ini membuat penyebaran baru di cakupan penyewa saat ini dengan menggunakan file .bicepparam pada disk. Perintah menggunakan parameter TemplateParameterFile untuk menentukan file .bicepparam.
Parameter
-AsJob
Jalankan cmdlet di latar belakang
Jenis: | SwitchParameter |
Position: | Named |
nilai default: | None |
Diperlukan: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Confirm
Meminta Anda mengonfirmasi sebelum menjalankan cmdlet.
Jenis: | SwitchParameter |
Aliases: | cf |
Position: | Named |
nilai default: | None |
Diperlukan: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
Kredensial, akun, penyewa, dan langganan yang digunakan untuk komunikasi dengan Azure.
Jenis: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
nilai default: | None |
Diperlukan: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DeploymentDebugLogLevel
Tingkat log debug penyebaran.
Jenis: | String |
Position: | Named |
nilai default: | None |
Diperlukan: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Location
Lokasi untuk menyimpan data penyebaran.
Jenis: | String |
Position: | Named |
nilai default: | None |
Diperlukan: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Nama penyebaran yang akan dibuatnya. Jika tidak ditentukan, default ke nama file templat saat file templat disediakan; default ke waktu saat ini ketika objek templat disediakan, misalnya "20131223140835".
Jenis: | String |
Aliases: | DeploymentName |
Position: | Named |
nilai default: | None |
Diperlukan: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Pre
Saat diatur, menunjukkan bahwa cmdlet harus menggunakan versi API pra-rilis saat secara otomatis menentukan versi mana yang akan digunakan.
Jenis: | SwitchParameter |
Position: | Named |
nilai default: | None |
Diperlukan: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ProceedIfNoChange
Jangan meminta konfirmasi jika tidak ada perubahan dalam hasil What-If. Berlaku saat sakelar -Konfirmasi diatur.
Jenis: | SwitchParameter |
Position: | Named |
nilai default: | None |
Diperlukan: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-QueryString
String kueri (misalnya, token SAS) yang akan digunakan dengan parameter TemplateUri. Akan digunakan dalam kasus templat tertaut
Jenis: | String |
Position: | Named |
nilai default: | None |
Diperlukan: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SkipTemplateParameterPrompt
Lewati pemrosesan parameter dinamis PowerShell yang memeriksa apakah parameter templat yang disediakan berisi semua parameter yang diperlukan yang digunakan oleh templat. Pemeriksaan ini akan meminta pengguna untuk memberikan nilai untuk parameter yang hilang, tetapi menyediakan -SkipTemplateParameterPrompt akan segera mengabaikan perintah dan kesalahan ini jika parameter ditemukan tidak terikat dalam templat. Untuk skrip non-interaktif, -SkipTemplateParameterPrompt dapat disediakan untuk memberikan pesan kesalahan yang lebih baik jika tidak semua parameter yang diperlukan terpenuhi.
Jenis: | SwitchParameter |
Position: | Named |
nilai default: | None |
Diperlukan: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Tag
Tag yang akan diletakkan pada penyebaran.
Jenis: | Hashtable |
Position: | Named |
nilai default: | None |
Diperlukan: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TemplateFile
Jalur lokal ke file templat. Jenis file templat yang didukung: json dan bicep.
Jenis: | String |
Position: | Named |
nilai default: | None |
Diperlukan: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TemplateObject
Tabel hash yang mewakili templat.
Jenis: | Hashtable |
Position: | Named |
nilai default: | None |
Diperlukan: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TemplateParameterFile
File parameter yang akan digunakan untuk templat.
Jenis: | String |
Position: | Named |
nilai default: | None |
Diperlukan: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TemplateParameterObject
Tabel hash yang mewakili parameter.
Jenis: | Hashtable |
Position: | Named |
nilai default: | None |
Diperlukan: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TemplateParameterUri
Uri ke file parameter templat.
Jenis: | String |
Position: | Named |
nilai default: | None |
Diperlukan: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TemplateSpecId
ID sumber daya templatSpec yang akan disebarkan.
Jenis: | String |
Position: | Named |
nilai default: | None |
Diperlukan: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TemplateUri
Uri ke file templat.
Jenis: | String |
Position: | Named |
nilai default: | None |
Diperlukan: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Menunjukkan apa yang akan terjadi jika cmdlet berjalan. Cmdlet tidak dijalankan.
Jenis: | SwitchParameter |
Aliases: | wi |
Position: | Named |
nilai default: | None |
Diperlukan: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIfExcludeChangeType
Jenis perubahan sumber daya yang dipisahkan koma yang akan dikecualikan dari hasil What-If. Berlaku ketika tombol -WhatIf atau -Confirm diatur.
Jenis: | String[] |
Position: | Named |
nilai default: | None |
Diperlukan: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIfResultFormat
Format hasil What-If. Berlaku ketika tombol -WhatIf atau -Confirm diatur.
Jenis: | WhatIfResultFormat |
nilai yang diterima: | ResourceIdOnly, FullResourcePayloads |
Position: | Named |
nilai default: | None |
Diperlukan: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |