rAJ*_*rAJ 5 powershell azure-devops
我正在尝试使用 VSTS 在 Web 应用程序上分配角色,但显示以下错误。
电源外壳 :
$webappname = "devt002"
$resourcegroup = "devt002RG"
#Get webapp object id
$webapp = Get-AzureRmWebApp -ResourceGroupName "$resourcegroup" -Name "$webappname"
$objectid = [System.Guid]::Parse($webapp.Identity.PrincipalId)
write-host "Object ID datatype :" $objectid.GetType().FullName
write-host "Object ID :" $objectid
#Get Assign role if already exist
$roles = Get-AzureRmRoleAssignment -ObjectId $objectid
write-host "Already Assigned Roles :" $roles.RoleDefinitionName
Run Code Online (Sandbox Code Playgroud)
错误 :
2019-04-05T11:20:23.7408185Z ##[debug]Caught exception from task script.
2019-04-05T11:20:23.7408790Z ##[debug]Error record:
2019-04-05T11:20:23.7408993Z ##[debug]Get-AzureRmRoleAssignment : Exception of type 'Microsoft.Rest.Azure.CloudException' was thrown.
Run Code Online (Sandbox Code Playgroud)
注意:它在本地 powershell 客户端中工作正常。仅 VSTS 存在问题。
| 归档时间: |
|
| 查看次数: |
3496 次 |
| 最近记录: |