【发布时间】:2021-12-13 11:53:26
【问题描述】:
按照教程https://docs.microsoft.com/en-us/azure/application-gateway/create-ssl-portal(使用免费试用作为订阅)我总是因为错误而失败
ErrorCode: AuthorizationFailed
ErrorMessage: The client '<mai e-mail address>' with object id'xxx' does not have authorization to perform action 'Microsoft.Compute/virtualMachines/extensions/write' over scope '/subscriptions/yyy/resourceGroups/myResourceGroupAG/providers/Microsoft.Compute/virtualMachines/myVM/extensions/IIS' or the scope is invalid. If access was recently granted, please refresh your credentials.
ErrorTarget:
StatusCode: 403
ReasonPhrase: Forbidden
OperationID : zzz
运行命令时
Set-AzVMExtension `>> -ResourceGroupName myResourceGroupAG `
>> -ExtensionName IIS `
>> -VMName myVM `
>> -Publisher Microsoft.Compute `
>> -ExtensionType CustomScriptExtension `
>> -TypeHandlerVersion 1.4 `
>> -SettingString '{"commandToExecute":"powershell Add-WindowsFeature Web-Server; powershell Add-Content -Path \"C:\\inetpub\\wwwroot\\Default.htm\" -Value $($env:computername)"}' `
>> -Location 'West US 2'
根据门户访问控制我(图中的JM)应该有角色Virtual machine Contributor,但是没有帮助。
【问题讨论】:
-
RDP 到 VM 并启用 IIS 使用 windows 功能
-
@Aatif Akhter “RDP 到 VM”是什么意思?
-
@RahulKumarShaw-MT 明白了你的意思,但我现在无法测试它,因为我的免费试用版已经过时,正在使用 log4j 修复程序......
-
您好@Jaana,因为这对我有用。您可以投票并接受它作为答案(单击答案旁边的复选标记,将其从灰色切换为填充。) .这对其他社区成员可能是有益的。谢谢