- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 ARM 部署脚本 AzCli。我们可以在 ARM 部署脚本中使用 az rest
吗?我收到 Forbidden({"error":{"code":"Authorization_RequestDenied","message":"没有足够的权限来完成操作。"
最佳答案
我可以在我这边重现您的问题,这意味着您的用户分配身份 (MSI) 没有足够的权限通过租户中的 Microsoft Graph 创建 AD 应用程序。
要解决此问题,只需授予 AAD 管理员角色,例如应用程序管理员
到您的 MSI 的服务主体,请按照以下步骤操作。
1.导航到门户中的 Azure Active Directory
-> 角色和管理员
-> 单击应用程序管理员
。
2.点击添加分配
-> 选择成员
-> 搜索您的 MSI 名称 -> 添加它。
注意:您还可以将 Microsoft Graph 应用程序权限 Application.ReadWrite.All
授予 MSI,而不是应用程序管理员
,不会的这里就不多说了,如果你有兴趣,请告诉我,我可以发布。
此外,如果您只想使用Azure CLI创建AD应用程序,实际上不需要手动使用azrest
,您可以使用内置命令az ad app create
直接。
测试示例:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"identity": {
"type": "string"
},
"utcValue": {
"type": "string",
"defaultValue": "[utcNow()]"
}
},
"resources": [
{
"type": "Microsoft.Resources/deploymentScripts",
"apiVersion": "2020-10-01",
"name": "runAzureCLI",
"location": "[resourceGroup().location]",
"kind": "AzureCLI",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"[parameters('identity')]": {
}
}
},
"properties": {
"forceUpdateTag": "[parameters('utcValue')]",
"AzCliVersion": "2.15.0",
"timeout": "PT30M",
"scriptContent": "landingPageApp=$(az rest --method POST --headers \"Content-Type=application/json\" --uri https://graph.microsoft.com/v1.0/applications --body '{\"displayName\": \"LandingpageAppARM\"}')",
"cleanupPreference": "OnSuccess",
"retentionInterval": "P1D"
}
}
]
}
关于azure - 我们可以在 ARM 部署脚本中使用 az rest 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67594030/
我正在尝试使用 Azure cli 从以下命令中仅获取 IP 地址。但它总是带有额外的“”。 az network nic ip-config list --resource-group "RG_TE
我在 Windows 10 计算机上运行 powershell 运行 AZ REST 方法时出现问题。该脚本可以工作,甚至可以与用户帐户一起使用,但现在失败了,我不知道为什么。这是进行 AZ REST
我设计了一个 PowerShell 脚本,它能够正确配置函数应用的各种设置(包括 CORS)。Function App 可以运行并且可以从 Api 管理服务调用。 当需要配置Azure AD时,我使用
我在 Windows 10 计算机上运行 powershell 运行 AZ REST 方法时出现问题。该脚本可以工作,甚至可以与用户帐户一起使用,但现在失败了,我不知道为什么。这是进行 AZ REST
我设计了一个 PowerShell 脚本,它能够正确配置函数应用的各种设置(包括 CORS)。Function App 可以运行并且可以从 Api 管理服务调用。 当需要配置Azure AD时,我使用
我已开始使用 Azure Pipelines 和 GitHub 支持的帐户并创建了我的第一个组织。我在该组织中没有任何项目。我在 portal.azure.com 上也没有任何订阅。我想使用 Azur
我在 Windows 10 的 Powershell 中安装 Az 模块时遇到错误消息。有什么想法吗? 使用的命令: Install-Module Az -AllowClobber 错误消息: Pac
如果我运行命令 Get-AzPolicyState -PolicyAssignmentName "xxxxxxxxxxxxxxxxxxxxx" -Filter "ResourceType eq 'Mi
我想使用 CLI 启用版本控制、更改 Azure 存储帐户中的源。我从 Microsoft 文档 https://learn.microsoft.com/en-us/cli/azure/storage
powershell 中的 az 命令等价于什么 az ad sp create-for-rbac --query "{ client_id: appId, client_secret: passwo
powershell 中的 az 命令等价于什么 az ad sp create-for-rbac --query "{ client_id: appId, client_secret: passwo
我正在执行以下教程说明。我使用集成在 azure 门户中的 CLI 2.0。不是我笔记本电脑上的版本。 https://learn.microsoft.com/en-us/azure/app-serv
我必须检查某些计算机上是否安装了 Az 或 AzureRM 模块。 但是我遇到了一个问题,所有 Az 命令都可以从 PowerShell 运行,但是当我执行 Get-InstalledModule -
我正在寻找一种 'az' --query 语法,它只列出 json 字段而不是它们的值。 这将打印一个表格: az account list --query [*] -o --table Name
我正在尝试将 az cmdlet 安装到 Kudu 上以用于我的 Azure Function。我目前正在遵循本指南: How to install a PowerShell module in an
我正在寻找一种 'az' --query 语法,它只列出 json 字段而不是它们的值。 这将打印一个表格: az account list --query [*] -o --table Name
我正在尝试使用 Kubernetes,并且正在使用 AKS 和 Docker Hub。我通过 Docker Compose 设置了一个 REST 应用程序,该应用程序由九个相互通信的不同微服务组成。现
概括 Amazon RDS 有两种主要不同类型的副本,多可用区副本和只读副本,很容易找到它们的区别。 但是,只读副本已于 2018 年 1 月支持多可用区部署。 “多可用区部署”和“只读副本版本多可用
每当我运行 az acr login -n 时,我都会收到以下消息: 来自守护程序的错误响应:获取“https://acrau*****.azurecr.io/v2/”:net/http:WAITIN
请求 Cloud Shell。已成功。连接终端... Import-Module: /opt/microsoft/powershell/7/profile.ps1:13 Line | 13 |
我是一名优秀的程序员,十分优秀!