---
title: "Creates or updates a Application resource."
method: PUT
path: "/Resources/Applications/{applicationResourceName}"
tags: ["MeshApplications"]
---

# Creates or updates a Application resource.

`PUT /Resources/Applications/{applicationResourceName}`

Creates a Application resource with the specified name, description and properties. If Application resource with the same name exists, then it is updated with the specified description and properties.

## Path parameters

- `applicationResourceName` string, required

## Query parameters

- `api-version` '6.4-preview', required

## Request body

- ApplicationResourceDescription — This type describes a application resource.
  - `name` string, required — Name of the Application resource.
  - `properties` ApplicationProperties, required — Describes properties of a application resource.
    - `description` string — User readable description of the application.
    - `services` ServiceResourceDescription[] — Describes the services in the application. This property is used to create or modify services of the application. On get only the name of the service is returned. The service description can be obtained by querying for the service resource.
      - `name` string, required — Name of the Service resource.
      - `properties` ServiceResourceProperties, required — Describes properties of a service resource.
        - `osType` 'Linux' | 'Windows', required — The operation system required by the code in service.
        - `codePackages` ContainerCodePackageProperties[], required — Describes the set of code packages that forms the service. A code package describes the container and the properties for running it. All the code packages are started together on the same host and share the same context (network, process etc.).
          - `name` string, required — The name of the code package.
          - `image` string, required — The Container image to use.
          - `imageRegistryCredential` ImageRegistryCredential — Image registry credential.
            - `server` string, required — Docker image registry server, without protocol such as `http` and `https`.
            - `username` string, required — The username for the private registry.
            - `password` string — The password for the private registry. The password is required for create or update operations, however it is not returned in the get or list operations.
          - `entrypoint` string — Override for the default entry point in the container.
          - `commands` string[] — Command array to execute within the container in exec form.
          - `environmentVariables` EnvironmentVariable[] — The environment variables to set in this container
            - `name` string — The name of the environment variable.
            - `value` string — The value of the environment variable.
          - `settings` Setting[] — The settings to set in this container. The setting file path can be fetched from environment variable "Fabric_SettingPath". The path for Windows container is "C:\\secrets". The path for Linux container is "/var/secrets".
            - `name` string — The name of the setting.
            - `value` string — The value of the setting.
          - `labels` ContainerLabel[] — The labels to set in this container.
            - `name` string, required — The name of the container label.
            - `value` string, required — The value of the container label.
          - `endpoints` EndpointProperties[] — The endpoints exposed by this container.
            - `name` string, required — The name of the endpoint.
            - `port` integer — Port used by the container.
          - `resources` ResourceRequirements, required — This type describes the resource requirements for a container or a service.
            - `requests` ResourceRequests, required — This type describes the requested resources for a given container. It describes the least amount of resources required for the container. A container can consume more than requested resources up to the specified limits before being restarted. Currently, the requested resources are treated as limits.
              - …
            - `limits` ResourceLimits — This type describes the resource limits for a given container. It describes the most amount of resources a container is allowed to use before being restarted.
              - …
          - `volumeRefs` VolumeReference[] — Volumes to be attached to the container. The lifetime of these volumes is independent of the application's lifetime.
            - `name` string, required — Name of the volume being referenced.
            - `readOnly` boolean — The flag indicating whether the volume is read only. Default is 'false'.
            - `destinationPath` string, required — The path within the container at which the volume should be mounted. Only valid path characters are allowed.
          - `volumes` ApplicationScopedVolume[] — Volumes to be attached to the container. The lifetime of these volumes is scoped to the application's lifetime.
            - `name` string, required — Name of the volume being referenced.
            - `readOnly` boolean — The flag indicating whether the volume is read only. Default is 'false'.
            - `destinationPath` string, required — The path within the container at which the volume should be mounted. Only valid path characters are allowed.
          - `diagnostics` DiagnosticsRef — Reference to sinks in DiagnosticsDescription.
            - `enabled` boolean — Status of whether or not sinks are enabled.
            - `sinkRefs` string[] — List of sinks to be used if enabled. References the list of sinks in DiagnosticsDescription.
          - `reliableCollectionsRefs` ReliableCollectionsRef[] — A list of ReliableCollection resources used by this particular code package. Please refer to ReliableCollectionsRef for more details.
            - `name` string, required — Name of ReliableCollection resource. Right now it's not used and you can use any string.
            - `doNotPersistState` boolean — False (the default) if ReliableCollections state is persisted to disk as usual. True if you do not want to persist state, in which case replication is still enabled and you can use ReliableCollections as distributed cache.
          - `instanceView` ContainerInstanceView — Runtime information of a container instance.
            - `restartCount` integer — The number of times the container has been restarted.
            - `currentState` ContainerState — The container state.
              - …
            - `previousState` ContainerState — The container state.
              - …
            - `events` ContainerEvent[] — The events of this container instance.
              - …
        - `networkRefs` NetworkRef[] — The names of the private networks that this service needs to be part of.
          - `name` string — Name of the network
          - `endpointRefs` EndpointRef[] — A list of endpoints that are exposed on this network.
            - `name` string — Name of the endpoint.
        - `diagnostics` DiagnosticsRef — Reference to sinks in DiagnosticsDescription.
          - `enabled` boolean — Status of whether or not sinks are enabled.
          - `sinkRefs` string[] — List of sinks to be used if enabled. References the list of sinks in DiagnosticsDescription.
        - `description` string — User readable description of the service.
        - `replicaCount` integer — The number of replicas of the service to create. Defaults to 1 if not specified.
        - `autoScalingPolicies` AutoScalingPolicy[] — Auto scaling policies
          - `name` string, required — The name of the auto scaling policy.
          - `trigger` AutoScalingTrigger, required — Describes the trigger for performing auto scaling operation.
            - `kind` 'AverageLoad', required — Enumerates the triggers for auto scaling.
          - `mechanism` AutoScalingMechanism, required — Describes the mechanism for performing auto scaling operation. Derived classes will describe the actual mechanism.
            - `kind` 'AddRemoveReplica', required — Enumerates the mechanisms for auto scaling.
        - `status` 'Unknown' | 'Ready' | 'Upgrading' | 'Creating' | 'Deleting' | 'Failed' — Status of the resource.
        - `statusDetails` string — Gives additional information about the current status of the service.
        - `healthState` 'Invalid' | 'Ok' | 'Warning' | 'Error' | 'Unknown' — The health state of a Service Fabric entity such as Cluster, Node, Application, Service, Partition, Replica etc.
        - `unhealthyEvaluation` string — When the service's health state is not 'Ok', this additional details from service fabric Health Manager for the user to know why the service is marked unhealthy.
        - `identityRefs` ServiceIdentity[] — The service identity list.
          - `name` string — The identity friendly name.
          - `identityRef` string — The application identity name.
    - `diagnostics` DiagnosticsDescription — Describes the diagnostics options available
      - `sinks` DiagnosticsSinkProperties[] — List of supported sinks that can be referenced.
        - `kind` 'Invalid' | 'AzureInternalMonitoringPipeline', required — The kind of DiagnosticsSink.
        - `name` string — Name of the sink. This value is referenced by DiagnosticsReferenceDescription
        - `description` string — A description of the sink.
      - `enabled` boolean — Status of whether or not sinks are enabled.
      - `defaultSinkRefs` string[] — The sinks to be used if diagnostics is enabled. Sink choices can be overridden at the service and code package level.
    - `debugParams` string — Internal - used by Visual Studio to setup the debugging session on the local development environment.
    - `serviceNames` string[] — Names of the services in the application.
    - `status` 'Unknown' | 'Ready' | 'Upgrading' | 'Creating' | 'Deleting' | 'Failed' — Status of the resource.
    - `statusDetails` string — Gives additional information about the current status of the application.
    - `healthState` 'Invalid' | 'Ok' | 'Warning' | 'Error' | 'Unknown' — The health state of a Service Fabric entity such as Cluster, Node, Application, Service, Partition, Replica etc.
    - `unhealthyEvaluation` string — When the application's health state is not 'Ok', this additional details from service fabric Health Manager for the user to know why the application is marked unhealthy.
  - `identity` IdentityDescription — Information describing the identities associated with this application.
    - `tokenServiceEndpoint` string — the endpoint for the token service managing this identity
    - `type` string, required — the types of identities associated with this resource; currently restricted to 'SystemAssigned and UserAssigned'
    - `tenantId` string — the identifier of the tenant containing the application's identity.
    - `principalId` string — the object identifier of the Service Principal of the identity associated with this resource.
    - `userAssignedIdentities` UserAssignedIdentityMap — Defines a map that contains user assigned identities.

## Response `200`

OK

- ApplicationResourceDescription — This type describes a application resource.
  - `name` string, required — Name of the Application resource.
  - `properties` ApplicationProperties, required — Describes properties of a application resource.
    - `description` string — User readable description of the application.
    - `services` ServiceResourceDescription[] — Describes the services in the application. This property is used to create or modify services of the application. On get only the name of the service is returned. The service description can be obtained by querying for the service resource.
      - `name` string, required — Name of the Service resource.
      - `properties` ServiceResourceProperties, required — Describes properties of a service resource.
        - `osType` 'Linux' | 'Windows', required — The operation system required by the code in service.
        - `codePackages` ContainerCodePackageProperties[], required — Describes the set of code packages that forms the service. A code package describes the container and the properties for running it. All the code packages are started together on the same host and share the same context (network, process etc.).
          - `name` string, required — The name of the code package.
          - `image` string, required — The Container image to use.
          - `imageRegistryCredential` ImageRegistryCredential — Image registry credential.
            - `server` string, required — Docker image registry server, without protocol such as `http` and `https`.
            - `username` string, required — The username for the private registry.
            - `password` string — The password for the private registry. The password is required for create or update operations, however it is not returned in the get or list operations.
          - `entrypoint` string — Override for the default entry point in the container.
          - `commands` string[] — Command array to execute within the container in exec form.
          - `environmentVariables` EnvironmentVariable[] — The environment variables to set in this container
            - `name` string — The name of the environment variable.
            - `value` string — The value of the environment variable.
          - `settings` Setting[] — The settings to set in this container. The setting file path can be fetched from environment variable "Fabric_SettingPath". The path for Windows container is "C:\\secrets". The path for Linux container is "/var/secrets".
            - `name` string — The name of the setting.
            - `value` string — The value of the setting.
          - `labels` ContainerLabel[] — The labels to set in this container.
            - `name` string, required — The name of the container label.
            - `value` string, required — The value of the container label.
          - `endpoints` EndpointProperties[] — The endpoints exposed by this container.
            - `name` string, required — The name of the endpoint.
            - `port` integer — Port used by the container.
          - `resources` ResourceRequirements, required — This type describes the resource requirements for a container or a service.
            - `requests` ResourceRequests, required — This type describes the requested resources for a given container. It describes the least amount of resources required for the container. A container can consume more than requested resources up to the specified limits before being restarted. Currently, the requested resources are treated as limits.
              - …
            - `limits` ResourceLimits — This type describes the resource limits for a given container. It describes the most amount of resources a container is allowed to use before being restarted.
              - …
          - `volumeRefs` VolumeReference[] — Volumes to be attached to the container. The lifetime of these volumes is independent of the application's lifetime.
            - `name` string, required — Name of the volume being referenced.
            - `readOnly` boolean — The flag indicating whether the volume is read only. Default is 'false'.
            - `destinationPath` string, required — The path within the container at which the volume should be mounted. Only valid path characters are allowed.
          - `volumes` ApplicationScopedVolume[] — Volumes to be attached to the container. The lifetime of these volumes is scoped to the application's lifetime.
            - `name` string, required — Name of the volume being referenced.
            - `readOnly` boolean — The flag indicating whether the volume is read only. Default is 'false'.
            - `destinationPath` string, required — The path within the container at which the volume should be mounted. Only valid path characters are allowed.
          - `diagnostics` DiagnosticsRef — Reference to sinks in DiagnosticsDescription.
            - `enabled` boolean — Status of whether or not sinks are enabled.
            - `sinkRefs` string[] — List of sinks to be used if enabled. References the list of sinks in DiagnosticsDescription.
          - `reliableCollectionsRefs` ReliableCollectionsRef[] — A list of ReliableCollection resources used by this particular code package. Please refer to ReliableCollectionsRef for more details.
            - `name` string, required — Name of ReliableCollection resource. Right now it's not used and you can use any string.
            - `doNotPersistState` boolean — False (the default) if ReliableCollections state is persisted to disk as usual. True if you do not want to persist state, in which case replication is still enabled and you can use ReliableCollections as distributed cache.
          - `instanceView` ContainerInstanceView — Runtime information of a container instance.
            - `restartCount` integer — The number of times the container has been restarted.
            - `currentState` ContainerState — The container state.
              - …
            - `previousState` ContainerState — The container state.
              - …
            - `events` ContainerEvent[] — The events of this container instance.
              - …
        - `networkRefs` NetworkRef[] — The names of the private networks that this service needs to be part of.
          - `name` string — Name of the network
          - `endpointRefs` EndpointRef[] — A list of endpoints that are exposed on this network.
            - `name` string — Name of the endpoint.
        - `diagnostics` DiagnosticsRef — Reference to sinks in DiagnosticsDescription.
          - `enabled` boolean — Status of whether or not sinks are enabled.
          - `sinkRefs` string[] — List of sinks to be used if enabled. References the list of sinks in DiagnosticsDescription.
        - `description` string — User readable description of the service.
        - `replicaCount` integer — The number of replicas of the service to create. Defaults to 1 if not specified.
        - `autoScalingPolicies` AutoScalingPolicy[] — Auto scaling policies
          - `name` string, required — The name of the auto scaling policy.
          - `trigger` AutoScalingTrigger, required — Describes the trigger for performing auto scaling operation.
            - `kind` 'AverageLoad', required — Enumerates the triggers for auto scaling.
          - `mechanism` AutoScalingMechanism, required — Describes the mechanism for performing auto scaling operation. Derived classes will describe the actual mechanism.
            - `kind` 'AddRemoveReplica', required — Enumerates the mechanisms for auto scaling.
        - `status` 'Unknown' | 'Ready' | 'Upgrading' | 'Creating' | 'Deleting' | 'Failed' — Status of the resource.
        - `statusDetails` string — Gives additional information about the current status of the service.
        - `healthState` 'Invalid' | 'Ok' | 'Warning' | 'Error' | 'Unknown' — The health state of a Service Fabric entity such as Cluster, Node, Application, Service, Partition, Replica etc.
        - `unhealthyEvaluation` string — When the service's health state is not 'Ok', this additional details from service fabric Health Manager for the user to know why the service is marked unhealthy.
        - `identityRefs` ServiceIdentity[] — The service identity list.
          - `name` string — The identity friendly name.
          - `identityRef` string — The application identity name.
    - `diagnostics` DiagnosticsDescription — Describes the diagnostics options available
      - `sinks` DiagnosticsSinkProperties[] — List of supported sinks that can be referenced.
        - `kind` 'Invalid' | 'AzureInternalMonitoringPipeline', required — The kind of DiagnosticsSink.
        - `name` string — Name of the sink. This value is referenced by DiagnosticsReferenceDescription
        - `description` string — A description of the sink.
      - `enabled` boolean — Status of whether or not sinks are enabled.
      - `defaultSinkRefs` string[] — The sinks to be used if diagnostics is enabled. Sink choices can be overridden at the service and code package level.
    - `debugParams` string — Internal - used by Visual Studio to setup the debugging session on the local development environment.
    - `serviceNames` string[] — Names of the services in the application.
    - `status` 'Unknown' | 'Ready' | 'Upgrading' | 'Creating' | 'Deleting' | 'Failed' — Status of the resource.
    - `statusDetails` string — Gives additional information about the current status of the application.
    - `healthState` 'Invalid' | 'Ok' | 'Warning' | 'Error' | 'Unknown' — The health state of a Service Fabric entity such as Cluster, Node, Application, Service, Partition, Replica etc.
    - `unhealthyEvaluation` string — When the application's health state is not 'Ok', this additional details from service fabric Health Manager for the user to know why the application is marked unhealthy.
  - `identity` IdentityDescription — Information describing the identities associated with this application.
    - `tokenServiceEndpoint` string — the endpoint for the token service managing this identity
    - `type` string, required — the types of identities associated with this resource; currently restricted to 'SystemAssigned and UserAssigned'
    - `tenantId` string — the identifier of the tenant containing the application's identity.
    - `principalId` string — the object identifier of the Service Principal of the identity associated with this resource.
    - `userAssignedIdentities` UserAssignedIdentityMap — Defines a map that contains user assigned identities.

## Other responses

- `201` — Created
- `202` — Accepted
- `default` — Error

---

[API](https://skmtc.net/azure/apis/service-fabric-client-apis.md) · [All operations](https://skmtc.net/azure/apis/service-fabric-client-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/service-fabric-client-apis/versions/6df9f2f4d542/schema)
