你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzDevCenterAdminProjectEnvironmentType
创建或更新项目环境类型。
语法
New-AzDevCenterAdminProjectEnvironmentType
-EnvironmentTypeName <String>
-ProjectName <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
-DeploymentTargetId <String>
-Status <EnvironmentTypeEnableStatus>
[-CreatorRoleAssignmentRole <Hashtable>]
[-DisplayName <String>]
[-IdentityType <ManagedServiceIdentityType>]
[-IdentityUserAssignedIdentity <Hashtable>]
[-Location <String>]
[-Tag <Hashtable>]
[-UserRoleAssignment <Hashtable>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzDevCenterAdminProjectEnvironmentType
-InputObject <IDevCenterIdentity>
-DeploymentTargetId <String>
-Status <EnvironmentTypeEnableStatus>
[-CreatorRoleAssignmentRole <Hashtable>]
[-DisplayName <String>]
[-IdentityType <ManagedServiceIdentityType>]
[-IdentityUserAssignedIdentity <Hashtable>]
[-Location <String>]
[-Tag <Hashtable>]
[-UserRoleAssignment <Hashtable>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
创建或更新项目环境类型。
示例
示例 1:创建项目环境类型
$identity = @{"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1" = @{} }
$deploymentTargetId = '/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff'
$creatorRoleAssignmentRole = @{"8e3af657-a8ff-443c-a75c-2fe8c4bcb635" = @{} }
$userRoleAssignment = @{
"e45e3m7c-176e-416a-b466-0c5ec8298f8a" = @{
"roles" = @{
"4cbf0b6c-e750-441c-98a7-10da8387e4d6" = @{}
}
}
}
New-AzDevCenterAdminProjectEnvironmentType -EnvironmentTypeName DevTest -ProjectName DevProject -ResourceGroupName testRg -CreatorRoleAssignmentRole $creatorRoleAssignmentRole -DeploymentTargetId $deploymentTargetId -IdentityType "SystemAssigned,UserAssigned" -IdentityUserAssignedIdentity $identity -Location "westus3" -Status "Enabled" -UserRoleAssignment $userRoleAssignment
此命令在项目“DevProject”中创建名为“DevTest”的项目环境类型。
示例 2:使用 InputObject 创建项目环境类型
$identity = @{"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/identityGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity1" = @{} }
$deploymentTargetId = '/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff'
$creatorRoleAssignmentRole = @{"8e3af657-a8ff-443c-a75c-2fe8c4bcb635" = @{} }
$userRoleAssignment = @{
"e45e3m7c-176e-416a-b466-0c5ec8298f8a" = @{
"roles" = @{
"4cbf0b6c-e750-441c-98a7-10da8387e4d6" = @{}
}
}
}
$envType = @{"ResourceGroupName" = "testRg"; "ProjectName" = "DevProject"; "EnvironmentTypeName" = "DevTest"; "SubscriptionId" = "0ac520ee-14c0-480f-b6c9-0a90c58ffff"}
New-AzDevCenterAdminProjectEnvironmentType -InputObject $envType -CreatorRoleAssignmentRole $creatorRoleAssignmentRole -DeploymentTargetId $deploymentTargetId -IdentityType "SystemAssigned,UserAssigned" -IdentityUserAssignedIdentity $identity -Location "westus3" -Status "Enabled" -UserRoleAssignment $userRoleAssignment
此命令在项目“DevProject”中创建名为“DevTest”的项目环境类型。
参数
-Confirm
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-CreatorRoleAssignmentRole
要分配给环境创建者的角色映射。
类型: | Hashtable |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
DefaultProfile 参数不起作用。 如果对其他订阅执行 cmdlet,请使用 SubscriptionId 参数。
类型: | PSObject |
别名: | AzureRMContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DeploymentTargetId
环境类型将映射到的订阅的 ID。 环境的资源将部署到此订阅中。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-DisplayName
项目环境类型的显示名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EnvironmentTypeName
环境类型的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-IdentityType
托管服务标识的类型(其中允许 SystemAssigned 和 UserAssigned 类型)。
类型: | ManagedServiceIdentityType |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-IdentityUserAssignedIdentity
与资源关联的用户分配标识集。 userAssignedIdentities 字典密钥将为 ARM 资源 ID,格式为“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 字典值可以是请求中的空对象({})。
类型: | Hashtable |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-InputObject
要构造的标识参数,请参阅 INPUTOBJECT 属性的 NOTES 部分并创建哈希表。
类型: | IDevCenterIdentity |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Location
环境类型的地理位置
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ProjectName
项目的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
资源组的名称。 名称不区分大小写。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Status
定义此环境类型是否可用于此项目。
类型: | EnvironmentTypeEnableStatus |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-SubscriptionId
目标订阅的 ID。
类型: | String |
Position: | Named |
默认值: | (Get-AzContext).Subscription.Id |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Tag
资源标记。
类型: | Hashtable |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-UserRoleAssignment
在环境支持资源上创建的角色分配。 这是从用户对象 ID 到角色定义 ID 对象的映射。
类型: | Hashtable |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |