[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["# User-Provided Services\n\nUsers can leverage services that aren't available in the marketplace by creating user-provided service instances.\nOnce created, user-provided service instances behave like service instances created through the [marketplace](../cli/kf-marketplace). Creating, listing, updating, deleting, binding, and unbinding user-provided services are all supported in Kf.\n\nCreate a user-provided service instance\n=======================================\n\nThe alias for `kf create-user-provided-service` is `kf cups`.\n\nThe name given to a user-provided service must be unique across all service instances in a Space, including services created through a service broker.\n\nDeliver service credentials to an App\n-------------------------------------\n\nA user-provided service instance can be used to deliver credentials to an App. For example, a database admin can have a set of credentials for an existing database managed outside of Kf, and these credentials include the URL, port, username, and password used to connect to the database.\n\nThe admin can create a user-provided service with the credentials and the developer can bind the service instance to the App. This allows the credentials to be shared without ever leaving the platform. Binding a service instance to an App has the same effect regardless of whether the service is a user-provided service or a marketplace service.\n\nThe App is configured with the credentials provided by the user, and the App runtime environment variable [`VCAP_SERVICES`](../how-to/app-runtime##vcapservices) is populated with information about all of the bound services to that App.\n\nA user-provided service can be created with credentials and/or a list of tags. \n\n kf cups my-db -p '{\"username\":\"admin\", \"password\":\"test123\", \"some-int-val\": 1, \"some-bool\": true}' -t \"comma, separated, tags\"\n\nThis will create the user-provided service instance `my-db` with the provided credentials and tags. The credentials passed in to the `-p` flag must be valid JSON (either inline or loaded from a file path).\n\nTo deliver the credentials to one or more Apps, the user can run `kf bind-service`.\n\nSuppose we have an App with one bound service, the user-provided service `my-db` defined above. The `VCAP_SERVICES` environment variable for that App will have the following contents: \n\n {\n \"user-provided\": [\n {\n \"name\": \"my-db\",\n \"instance_name\": \"my-db\",\n \"label\": \"user-provided\",\n \"tags\": [\n \"comma\",\n \"separated\",\n \"tags\"\n ],\n \"credentials\": {\n \"username\": \"admin\",\n \"password\": \"test123\",\n \"some-int-val\": 1,\n \"some-bool\": true\n }\n }\n ]\n }\n\nUpdate a user-provided service instance\n=======================================\n\nThe alias for `kf update-user-provided-service` is `kf uups`.\n\nA user-provided service can be updated with the `uups` command. New credentials and/or tags passed in completely overwrite existing ones. For example, if the user created the user-provided service `my-db` above, called `kf bind-service` to bind the service to an App, then ran the command. \n\n kf uups my-db -p '{\"username\":\"admin\", \"password\":\"new-pw\", \"new-key\": \"new-val\"}'\n\nThe updated credentials will only be reflected on the App after the user unbinds and rebinds the service to the App. No restart or restage of the App is required. The updated `VCAP_SERVICES` environment variable will have the following contents: \n\n {\n \"user-provided\": [\n {\n \"name\": \"my-db\",\n \"instance_name\": \"my-db\",\n \"label\": \"user-provided\",\n \"tags\": [\n \"comma\",\n \"separated\",\n \"tags\"\n ],\n \"credentials\": {\n \"username\": \"admin\",\n \"password\": \"new-pw\",\n \"new-key\": \"new-val\"\n }\n }\n ]\n }\n\nThe new credentials overwrite the old credentials, and the tags are unchanged because they were not specified in the update command."]]