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

创建应用程序资源

创建或更新应用程序资源。

使用指定的名称和说明创建应用程序资源。 如果已存在同名的应用程序,则其说明将更新为此请求中指示的说明。

使用网络资源提供与应用程序服务的公共连接。

请求

方法 请求 URI
PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationName}?api-version=2018-07-01-preview

参数

名称 类型 必须 位置
subscriptionId string 路径
resourceGroupName 字符串 路径
applicationName 字符串 路径
api-version 字符串 查询
applicationResourceDescription ApplicationResourceDescription “是” Body

subscriptionId

类型:字符串
必需:是

客户订阅标识符


resourceGroupName

类型:字符串
必需:是

Azure 资源组名称


applicationName

类型:字符串
必需:是

应用程序的标识。


api-version

类型:字符串
必需:是
默认

API 的版本。 此参数是必需的,其值必须为 2018-07-01-preview


applicationResourceDescription

类型ApplicationResourceDescription
必需:是

有关创建应用程序资源的说明。

响应

HTTP 状态代码 说明 响应架构
200 (正常) 正常
ApplicationResourceDescription
201 (已创建) 创建
ApplicationResourceDescription
所有其他状态代码 错误
ErrorModel

示例

ApplicationCreateOrUpdate

此示例演示如何创建或更新应用程序资源。

请求

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sbz_demo/providers/Microsoft.ServiceFabricMesh/applications/helloWorldApp?api-version=2018-07-01-preview
正文
{
  "properties": {
    "description": "SeaBreeze HelloWorld Application!",
    "services": [
      {
        "properties": {
          "osType": "linux",
          "codePackages": [
            {
              "name": "helloWorldCode",
              "image": "seabreeze/sbz-helloworld:1.0-alpine",
              "endpoints": [
                {
                  "name": "helloWorldListener",
                  "port": "80"
                }
              ],
              "resources": {
                "requests": {
                  "memoryInGB": "1",
                  "cpu": "1"
                }
              }
            }
          ],
          "description": "SeaBreeze Hello World Service.",
          "replicaCount": "1"
        },
        "name": "helloWorldService"
      }
    ]
  },
  "tags": {},
  "location": "EastUS"
}

200 响应

正文
{
  "type": "Microsoft.ServiceFabricMesh/applications",
  "location": "EastUS",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sbz_demo/providers/Microsoft.ServiceFabricMesh/applications/myHelloWorldApp",
  "name": "myHelloWorldApp",
  "tags": {},
  "properties": {
    "provisioningState": "Succeeded",
    "description": "SeaBreeze HelloWorld Application!",
    "healthState": "Ok",
    "serviceNames": [
      "helloWorldService"
    ],
    "status": "Invalid"
  }
}

201 响应

正文
{
  "type": "Microsoft.ServiceFabricMesh/applications",
  "location": "EastUS",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sbz_demo/providers/Microsoft.ServiceFabricMesh/applications/myHelloWorldApp",
  "name": "myHelloWorldApp",
  "tags": {},
  "properties": {
    "provisioningState": "Updating",
    "description": "SeaBreeze HelloWorld Application!",
    "healthState": "Ok",
    "serviceNames": [
      "helloWorldService"
    ],
    "status": "Invalid"
  }
}