你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Microsoft.Solutions 应用程序

Bicep 资源定义

可以使用目标操作部署应用程序资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Solutions/applications 资源,请将以下 Bicep 添加到模板。

resource symbolicname 'Microsoft.Solutions/applications@2023-12-01-preview' = {
  scope: resourceSymbolicName or scope
  identity: {
    type: 'string'
    userAssignedIdentities: {
      {customized property}: {}
    }
  }
  kind: 'string'
  location: 'string'
  managedBy: 'string'
  name: 'string'
  plan: {
    name: 'string'
    product: 'string'
    promotionCode: 'string'
    publisher: 'string'
    version: 'string'
  }
  properties: {
    applicationDefinitionId: 'string'
    jitAccessPolicy: {
      jitAccessEnabled: bool
      jitApprovalMode: 'string'
      jitApprovers: [
        {
          displayName: 'string'
          id: 'string'
          type: 'string'
        }
      ]
      maximumJitAccessDuration: 'string'
    }
    managedResourceGroupId: 'string'
    parameters: any(...)
  }
  sku: {
    capacity: int
    family: 'string'
    model: 'string'
    name: 'string'
    size: 'string'
    tier: 'string'
  }
  tags: {
    {customized property}: 'string'
  }
}

属性值

Microsoft.Solutions/applications

名字 描述 价值
标识 资源的标识。 标识
托管应用程序的种类。 允许的值为 MarketPlace 和 ServiceCatalog。 字符串

约束:
模式 = ^[-\w\._,\(\)]+$ (必需)
位置 资源位置 字符串
managedBy 管理此资源的资源的 ID。 字符串
名字 资源名称 字符串

约束:
最小长度 = 3
最大长度 = 64 (必需)
计划 计划信息。 计划
性能 托管应用程序属性。 ApplicationProperties (必需)
作用域 在与部署范围不同的范围内创建资源时使用。 将此属性设置为资源的符号名称以应用 扩展资源
SKU 资源的 SKU。 SKU
标签 资源标记 标记名称和值的字典。 请参阅模板 中的 标记

ApplicationJitAccessPolicy

名字 描述 价值
jitAccess已启用 是否启用 JIT 访问。 bool (必需)
jitApprovalMode JIT 审批模式。 “AutoApprove”
“ManualApprove”
“NotSpecified”
jit审批者 JIT 审批者 JitApproverDefinition[]
maximumJitAccessDuration 授予最大持续时间 JIT 访问权限。 这是ISO8601时间段值。 字符串

应用程序属性

名字 描述 价值
applicationDefinitionId 应用程序定义 ID 托管应用程序定义 ID 的完全限定路径。 字符串
jitAccessPolicy 托管应用程序 Jit 访问策略。 ApplicationJitAccessPolicy
managedResourceGroupId 托管资源组 ID。 字符串
参数 定义托管应用程序参数的名称和值对。 它可以是 JObject 或格式良好的 JSON 字符串。 任何

身份

名字 描述 价值
类型 标识类型。 “None”
“SystemAssigned”
“SystemAssigned,UserAssigned”
“UserAssigned”
用户分配的标识 与资源关联的用户标识列表。 用户标识字典密钥引用的格式将为资源 ID:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 IdentityUserAssignedIdentities

IdentityUserAssignedIdentities

名字 描述 价值

JitApprover定义

名字 描述 价值
displayName (显示名称) 审批者显示名称。 字符串
身份证 审批者服务主体 ID。 string (必需)
类型 审批者类型。 “group”
“user”

计划

名字 描述 价值
名字 计划名称。 string (必需)
产品 产品代码。 string (必需)
促销代码 促销代码。 字符串
发布服务器 发布者 ID。 string (必需)
版本 计划的版本。 string (必需)

资源标签

名字 描述 价值

SKU

名字 描述 价值
产能 SKU 容量。 整数 (int)
家庭 SKU 系列。 字符串
模型 SKU 模型。 字符串
名字 SKU 名称。 string (必需)
大小 SKU 大小。 字符串
分层 SKU 层。 字符串

UserAssignedResourceIdentity

名字 描述 价值

ARM 模板资源定义

可以使用目标操作部署应用程序资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Solutions/applications 资源,请将以下 JSON 添加到模板。

{
  "type": "Microsoft.Solutions/applications",
  "apiVersion": "2023-12-01-preview",
  "name": "string",
  "identity": {
    "type": "string",
    "userAssignedIdentities": {
      "{customized property}": {
      }
    }
  },
  "kind": "string",
  "location": "string",
  "managedBy": "string",
  "plan": {
    "name": "string",
    "product": "string",
    "promotionCode": "string",
    "publisher": "string",
    "version": "string"
  },
  "properties": {
    "applicationDefinitionId": "string",
    "jitAccessPolicy": {
      "jitAccessEnabled": "bool",
      "jitApprovalMode": "string",
      "jitApprovers": [
        {
          "displayName": "string",
          "id": "string",
          "type": "string"
        }
      ],
      "maximumJitAccessDuration": "string"
    },
    "managedResourceGroupId": "string",
    "parameters": {}
  },
  "sku": {
    "capacity": "int",
    "family": "string",
    "model": "string",
    "name": "string",
    "size": "string",
    "tier": "string"
  },
  "tags": {
    "{customized property}": "string"
  }
}

属性值

Microsoft.Solutions/applications

名字 描述 价值
apiVersion API 版本 “2023-12-01-预览”
标识 资源的标识。 标识
托管应用程序的种类。 允许的值为 MarketPlace 和 ServiceCatalog。 字符串

约束:
模式 = ^[-\w\._,\(\)]+$ (必需)
位置 资源位置 字符串
managedBy 管理此资源的资源的 ID。 字符串
名字 资源名称 字符串

约束:
最小长度 = 3
最大长度 = 64 (必需)
计划 计划信息。 计划
性能 托管应用程序属性。 ApplicationProperties (必需)
SKU 资源的 SKU。 SKU
标签 资源标记 标记名称和值的字典。 请参阅模板 中的 标记
类型 资源类型 “Microsoft.Solutions/applications”

ApplicationJitAccessPolicy

名字 描述 价值
jitAccess已启用 是否启用 JIT 访问。 bool (必需)
jitApprovalMode JIT 审批模式。 “AutoApprove”
“ManualApprove”
“NotSpecified”
jit审批者 JIT 审批者 JitApproverDefinition[]
maximumJitAccessDuration 授予最大持续时间 JIT 访问权限。 这是ISO8601时间段值。 字符串

应用程序属性

名字 描述 价值
applicationDefinitionId 应用程序定义 ID 托管应用程序定义 ID 的完全限定路径。 字符串
jitAccessPolicy 托管应用程序 Jit 访问策略。 ApplicationJitAccessPolicy
managedResourceGroupId 托管资源组 ID。 字符串
参数 定义托管应用程序参数的名称和值对。 它可以是 JObject 或格式良好的 JSON 字符串。 任何

身份

名字 描述 价值
类型 标识类型。 “None”
“SystemAssigned”
“SystemAssigned,UserAssigned”
“UserAssigned”
用户分配的标识 与资源关联的用户标识列表。 用户标识字典密钥引用的格式将为资源 ID:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 IdentityUserAssignedIdentities

IdentityUserAssignedIdentities

名字 描述 价值

JitApprover定义

名字 描述 价值
displayName (显示名称) 审批者显示名称。 字符串
身份证 审批者服务主体 ID。 string (必需)
类型 审批者类型。 “group”
“user”

计划

名字 描述 价值
名字 计划名称。 string (必需)
产品 产品代码。 string (必需)
促销代码 促销代码。 字符串
发布服务器 发布者 ID。 string (必需)
版本 计划的版本。 string (必需)

资源标签

名字 描述 价值

SKU

名字 描述 价值
产能 SKU 容量。 整数 (int)
家庭 SKU 系列。 字符串
模型 SKU 模型。 字符串
名字 SKU 名称。 string (必需)
大小 SKU 大小。 字符串
分层 SKU 层。 字符串

UserAssignedResourceIdentity

名字 描述 价值

用法示例

Azure 快速入门模板

以下 Azure 快速入门模板 部署此资源类型。

模板 描述
创建部署链接模板的托管应用程序

部署到 Azure
此模板创建一个用于部署链接模板的托管应用程序。
使用自定义视图创建托管应用程序

部署到 Azure
此模板创建具有自定义默认视图的托管应用程序。
使用指标和警报创建托管应用程序

部署到 Azure
此模板创建具有应用程序指标和警报的托管应用程序。

Terraform (AzAPI 提供程序)资源定义

可以使用目标操作部署应用程序资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Solutions/applications 资源,请将以下 Terraform 添加到模板。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Solutions/applications@2023-12-01-preview"
  name = "string"
  parent_id = "string"
  identity {
    type = "string"
    identity_ids = [
      "string"
    ]
  }
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    kind = "string"
    managedBy = "string"
    plan = {
      name = "string"
      product = "string"
      promotionCode = "string"
      publisher = "string"
      version = "string"
    }
    properties = {
      applicationDefinitionId = "string"
      jitAccessPolicy = {
        jitAccessEnabled = bool
        jitApprovalMode = "string"
        jitApprovers = [
          {
            displayName = "string"
            id = "string"
            type = "string"
          }
        ]
        maximumJitAccessDuration = "string"
      }
      managedResourceGroupId = "string"
      parameters = ?
    }
    sku = {
      capacity = int
      family = "string"
      model = "string"
      name = "string"
      size = "string"
      tier = "string"
    }
  }
}

属性值

Microsoft.Solutions/applications

名字 描述 价值
标识 资源的标识。 标识
托管应用程序的种类。 允许的值为 MarketPlace 和 ServiceCatalog。 字符串

约束:
模式 = ^[-\w\._,\(\)]+$ (必需)
位置 资源位置 字符串
managedBy 管理此资源的资源的 ID。 字符串
名字 资源名称 字符串

约束:
最小长度 = 3
最大长度 = 64 (必需)
parent_id 要向其应用此扩展资源的资源的 ID。 string (必需)
计划 计划信息。 计划
性能 托管应用程序属性。 ApplicationProperties (必需)
SKU 资源的 SKU。 SKU
标签 资源标记 标记名称和值的字典。
类型 资源类型 “Microsoft.Solutions/applications@2023-12-01-preview”

ApplicationJitAccessPolicy

名字 描述 价值
jitAccess已启用 是否启用 JIT 访问。 bool (必需)
jitApprovalMode JIT 审批模式。 “AutoApprove”
“ManualApprove”
“NotSpecified”
jit审批者 JIT 审批者 JitApproverDefinition[]
maximumJitAccessDuration 授予最大持续时间 JIT 访问权限。 这是ISO8601时间段值。 字符串

应用程序属性

名字 描述 价值
applicationDefinitionId 应用程序定义 ID 托管应用程序定义 ID 的完全限定路径。 字符串
jitAccessPolicy 托管应用程序 Jit 访问策略。 ApplicationJitAccessPolicy
managedResourceGroupId 托管资源组 ID。 字符串
参数 定义托管应用程序参数的名称和值对。 它可以是 JObject 或格式良好的 JSON 字符串。 任何

身份

名字 描述 价值
类型 标识类型。 “None”
“SystemAssigned”
“SystemAssigned,UserAssigned”
“UserAssigned”
用户分配的标识 与资源关联的用户标识列表。 用户标识字典密钥引用的格式将为资源 ID:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 IdentityUserAssignedIdentities

IdentityUserAssignedIdentities

名字 描述 价值

JitApprover定义

名字 描述 价值
displayName (显示名称) 审批者显示名称。 字符串
身份证 审批者服务主体 ID。 string (必需)
类型 审批者类型。 “group”
“user”

计划

名字 描述 价值
名字 计划名称。 string (必需)
产品 产品代码。 string (必需)
促销代码 促销代码。 字符串
发布服务器 发布者 ID。 string (必需)
版本 计划的版本。 string (必需)

资源标签

名字 描述 价值

SKU

名字 描述 价值
产能 SKU 容量。 整数 (int)
家庭 SKU 系列。 字符串
模型 SKU 模型。 字符串
名字 SKU 名称。 string (必需)
大小 SKU 大小。 字符串
分层 SKU 层。 字符串

UserAssignedResourceIdentity

名字 描述 价值

用法示例

Terraform 示例

部署托管应用程序的基本示例。

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
  skip_provider_registration = false
}

data "azapi_client_config" "current" {}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westus"
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "applicationDefinition" {
  type      = "Microsoft.Solutions/applicationDefinitions@2021-07-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = "${var.resource_name}-appdef"
  location  = var.location
  body = {
    properties = {
      authorizations = [{
        principalId      = data.azapi_client_config.current.object_id
        roleDefinitionId = "b24988ac-6180-42a0-ab88-20f7382dd24c"
      }]
      createUiDefinition = "    {\n      \"$schema\": \"https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#\",\n      \"handler\": \"Microsoft.Azure.CreateUIDef\",\n      \"version\": \"0.1.2-preview\",\n      \"parameters\": {\n         \"basics\": [],\n         \"steps\": [],\n         \"outputs\": {}\n      }\n    }\n"
      description        = "Test Managed App Definition"
      displayName        = "TestManagedAppDefinition"
      isEnabled          = true
      lockLevel          = "ReadOnly"
      mainTemplate       = "    {\n      \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\n      \"contentVersion\": \"1.0.0.0\",\n      \"parameters\": {\n\n         \"boolParameter\": {\n            \"type\": \"bool\"\n         },\n         \"intParameter\": {\n            \"type\": \"int\"\n         },\n         \"stringParameter\": {\n            \"type\": \"string\"\n         },\n         \"secureStringParameter\": {\n            \"type\": \"secureString\"\n         },\n         \"objectParameter\": {\n            \"type\": \"object\"\n         },\n         \"arrayParameter\": {\n            \"type\": \"array\"\n         }\n\n      },\n      \"variables\": {},\n      \"resources\": [],\n      \"outputs\": {\n        \"boolOutput\": {\n          \"type\": \"bool\",\n          \"value\": true\n        },\n        \"intOutput\": {\n          \"type\": \"int\",\n          \"value\": 100\n        },\n        \"stringOutput\": {\n          \"type\": \"string\",\n          \"value\": \"stringOutputValue\"\n        },\n        \"objectOutput\": {\n          \"type\": \"object\",\n          \"value\": {\n            \"nested_bool\": true,\n            \"nested_array\": [\"value_1\", \"value_2\"],\n            \"nested_object\": {\n              \"key_0\": 0\n            }\n          }\n        },\n        \"arrayOutput\": {\n          \"type\": \"array\",\n          \"value\": [\"value_1\", \"value_2\"]\n        }\n      }\n    }\n"
    }
  }
}

resource "azapi_resource" "application" {
  type      = "Microsoft.Solutions/applications@2021-07-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = "${var.resource_name}-app"
  location  = var.location
  body = {
    kind = "ServiceCatalog"
    properties = {
      applicationDefinitionId = azapi_resource.applicationDefinition.id
      managedResourceGroupId  = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${var.resource_name}-infragroup"
      parameters = {
        arrayParameter = {
          value = ["value_1", "value_2"]
        }
        boolParameter = {
          value = true
        }
        intParameter = {
          value = 100
        }
        objectParameter = {
          value = {
            nested_array = ["value_1", "value_2"]
            nested_bool  = true
            nested_object = {
              key_0 = 0
            }
          }
        }
        secureStringParameter = {
          value = ""
        }
        stringParameter = {
          value = "value_1"
        }
      }
    }
  }
}