Linker - Create Or Update
创建或更新链接器资源。
PUT https://management.azure.com/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}?api-version=2022-11-01-preview
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
linker
|
path | True |
string |
名称链接器资源。 |
|
resource
|
path | True |
string |
要连接的资源的完全限定的 Azure 资源管理器标识符。 |
|
api-version
|
query | True |
string minLength: 1 |
用于此操作的 API 版本。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| properties.authInfo | AuthInfoBase: |
身份验证类型。 |
| properties.clientType |
应用程序客户端类型 |
|
| properties.configurationInfo |
应用程序使用的连接信息,包括机密、连接字符串。 |
|
| properties.publicNetworkSolution |
网络解决方案。 |
|
| properties.scope |
string |
源服务中的连接范围。 |
| properties.secretStore |
用于将机密值存储在安全位置的选项 |
|
| properties.targetService | TargetServiceBase: |
目标服务属性 |
| properties.vNetSolution |
VNet 解决方案。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
成功的。 |
|
| 201 Created |
长时间运行的操作。 |
|
| Other Status Codes |
描述作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
PutLinker
示例请求
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app/providers/Microsoft.ServiceLinker/linkers/linkName?api-version=2022-11-01-preview
{
"properties": {
"targetService": {
"type": "AzureResource",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DBforPostgreSQL/servers/test-pg/databases/test-db"
},
"vNetSolution": {
"type": "serviceEndpoint"
},
"authInfo": {
"authType": "secret",
"name": "name",
"secretInfo": {
"secretType": "rawValue",
"value": "secret"
}
}
}
}
示例响应
{
"type": "Microsoft.ServiceLinker/links",
"name": "linkName",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app/providers/Microsoft.ServiceLinker/links/linkName",
"properties": {
"authInfo": {
"authType": "secret",
"name": "name"
},
"vNetSolution": {
"type": "serviceEndpoint"
},
"targetService": {
"type": "AzureResource",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DBforPostgreSQL/servers/test-pg/databases/test-db"
}
}
}
{
"type": "Microsoft.ServiceLinker/links",
"name": "linkName",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app/providers/Microsoft.ServiceLinker/links/linkName",
"properties": {
"authInfo": {
"authType": "secret",
"name": "name"
},
"vNetSolution": {
"type": "serviceEndpoint"
},
"targetService": {
"type": "AzureResource",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DBforPostgreSQL/servers/test-pg/databases/test-db"
}
}
}
定义
| 名称 | 说明 |
|---|---|
|
Access |
直接从目标资源属性(目标服务为 Azure 资源)(例如 Microsoft.Storage)访问密钥 |
|
access |
accessKey 的权限。
|
|
action |
可选。 指示公用网络解决方案。 如果启用,请尽量启用目标服务的公用网络访问。 默认值为 enable。 如果 optOut,则选择退出公用网络访问配置。 |
|
allow |
允许 Azure 服务访问目标服务(如果为 true)。 |
|
Auth |
身份验证类型。 |
|
Azure |
类型为 Azure Key Vault 时的资源属性 |
|
Azure |
目标服务类型为 AzureResource 时的 Azure 资源信息 |
|
client |
应用程序客户端类型 |
|
Configuration |
用于生成配置或保存到应用程序的配置信息 |
|
Confluent |
目标服务类型为 ConfluentBootstrapServer 时的服务属性 |
|
Confluent |
目标服务类型为 ConfluentSchemaRegistry 时的服务属性 |
|
created |
创建资源的标识的类型。 |
|
Dapr |
dapr 组件元数据。 |
|
Dapr |
指示 dapr 客户端类型的一些附加属性 |
|
Delete |
清理行为,用于指示删除或更新资源时是否清理作 |
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详细信息。 |
|
Error |
错误响应 |
|
Firewall |
目标服务的防火墙规则。 以允许来自源服务的连接。 |
|
Key |
类型为 keyVaultSecretReference 时的机密信息。 适用于用户提供存储在用户的 keyvault 和源中为 Azure Kubernetes 的机密的方案。 Key Vault 的资源 ID 链接到 secretStore.keyVaultId。 |
|
Key |
类型为 keyVaultSecretUri 时的机密信息。 适用于以下情况:用户提供存储在用户的 keyvault 中的机密,源为 Web 应用、Spring Cloud 或容器应用。 |
|
Linker |
源和目标资源的链接器 |
|
Public |
指示公用网络解决方案,包括防火墙规则 |
|
Secret |
authType 为机密时的身份验证信息 |
|
Secret |
用于将机密值存储在安全位置的选项 |
|
Secret |
机密类型。 |
|
Self |
目标服务类型为 SelfHostedServer 时的服务属性 |
|
Service |
authType 为 servicePrincipal 证书时的身份验证信息 |
|
Service |
authType 为 servicePrincipal 机密时的身份验证信息 |
|
System |
authType 为 systemAssignedIdentity 时的身份验证信息 |
|
system |
与创建和上次修改资源相关的元数据。 |
|
User |
authType 为用户帐户时的身份验证信息 |
|
User |
authType 为 userAssignedIdentity 时的身份验证信息 |
|
Value |
类型为 rawValue 时的机密信息。 适用于用户输入机密的方案。 |
|
VNet |
链接器 VNet 解决方案 |
|
v |
VNet 解决方案的类型。 |
AccessKeyInfoBase
直接从目标资源属性(目标服务为 Azure 资源)(例如 Microsoft.Storage)访问密钥
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
access |
身份验证类型。 |
| permissions |
accessKey 的权限。
|
accessKeyPermissions
accessKey 的权限。
Read 和 Write 适用于 Azure Cosmos DB 和 Azure 应用配置、Listen、Send 和 Manage 适用于 Azure 事件中心和 Azure 服务总线。
| 值 | 说明 |
|---|---|
| Read | |
| Write | |
| Listen | |
| Send | |
| Manage |
actionType
可选。 指示公用网络解决方案。 如果启用,请尽量启用目标服务的公用网络访问。 默认值为 enable。 如果 optOut,则选择退出公用网络访问配置。
| 值 | 说明 |
|---|---|
| enable | |
| optOut |
allowType
允许 Azure 服务访问目标服务(如果为 true)。
| 值 | 说明 |
|---|---|
| true | |
| false |
AuthType
身份验证类型。
| 值 | 说明 |
|---|---|
| systemAssignedIdentity | |
| userAssignedIdentity | |
| servicePrincipalSecret | |
| servicePrincipalCertificate | |
| secret | |
| accessKey | |
| userAccount |
AzureKeyVaultProperties
类型为 Azure Key Vault 时的资源属性
| 名称 | 类型 | 说明 |
|---|---|---|
| connectAsKubernetesCsiDriver |
boolean |
如此 如果通过 Kubernetes CSI 驱动程序进行连接。 |
| type |
string:
Key |
Azure 资源类型。 |
AzureResource
目标服务类型为 AzureResource 时的 Azure 资源信息
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
Azure 资源的 ID。 |
| resourceProperties | AzureResourcePropertiesBase: |
Azure 资源连接相关属性。 |
| type | string: |
目标服务类型。 |
clientType
应用程序客户端类型
| 值 | 说明 |
|---|---|
| none | |
| dotnet | |
| java | |
| python | |
| go | |
| php | |
| ruby | |
| django | |
| nodejs | |
| springBoot | |
| kafka-springBoot | |
| dapr |
ConfigurationInfo
用于生成配置或保存到应用程序的配置信息
| 名称 | 类型 | 说明 |
|---|---|---|
| action |
可选,指示是否在源应用程序上应用配置。 如果启用,请生成配置并应用于源应用程序。 默认值为 enable。 如果 optOut,则不会对源进行配置更改。 |
|
| additionalConfigurations |
object |
要添加的其他配置的字典。 服务将自动生成一组基本配置,此属性将完全填充更多自定义配置 |
| customizedKeys |
object |
可选。 默认密钥名称和自定义密钥名称映射的字典。 如果未指定,则默认密钥名称将用于生成配置 |
| daprProperties |
指示 dapr 客户端类型的一些附加属性 |
|
| deleteOrUpdateBehavior |
指示在链接器更新或删除时是否清理以前的操作 |
ConfluentBootstrapServer
目标服务类型为 ConfluentBootstrapServer 时的服务属性
| 名称 | 类型 | 说明 |
|---|---|---|
| endpoint |
string |
服务的终结点。 |
| type | string: |
目标服务类型。 |
ConfluentSchemaRegistry
目标服务类型为 ConfluentSchemaRegistry 时的服务属性
| 名称 | 类型 | 说明 |
|---|---|---|
| endpoint |
string |
服务的终结点。 |
| type | string: |
目标服务类型。 |
createdByType
创建资源的标识的类型。
| 值 | 说明 |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
DaprMetadata
dapr 组件元数据。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
元数据属性名称。 |
| secretRef |
string |
dapr 可以获取值的机密名称 |
| value |
string |
元数据属性值。 |
DaprProperties
指示 dapr 客户端类型的一些附加属性
| 名称 | 类型 | 说明 |
|---|---|---|
| componentType |
string |
dapr 组件类型 |
| metadata |
其他 dapr 元数据 |
|
| scopes |
string[] |
dapr 组件范围 |
| secretStoreComponent |
string |
要检索机密的机密存储 dapr 的名称 |
| version |
string |
dapr 组件版本 |
DeleteOrUpdateBehavior
清理行为,用于指示删除或更新资源时是否清理作
| 值 | 说明 |
|---|---|
| Default | |
| ForcedCleanup |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
其他信息。 |
| type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
FirewallRules
目标服务的防火墙规则。 以允许来自源服务的连接。
| 名称 | 类型 | 说明 |
|---|---|---|
| azureServices |
允许 Azure 服务访问目标服务(如果为 true)。 |
|
| callerClientIP |
允许调用方客户端 IP 访问目标服务(如果为 true)。 将本地应用程序连接到目标服务时,将使用此属性。 |
|
| ipRanges |
string[] |
此值以 CIDR 形式指定要作为给定数据库帐户的客户端 IP 允许列表包含的 IP 地址或 IP 地址范围集。 |
KeyVaultSecretReferenceSecretInfo
类型为 keyVaultSecretReference 时的机密信息。 适用于用户提供存储在用户的 keyvault 和源中为 Azure Kubernetes 的机密的方案。 Key Vault 的资源 ID 链接到 secretStore.keyVaultId。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
Key Vault 机密的名称。 |
| secretType |
string:
key |
机密类型。 |
| version |
string |
Key Vault 机密的版本。 |
KeyVaultSecretUriSecretInfo
类型为 keyVaultSecretUri 时的机密信息。 适用于以下情况:用户提供存储在用户的 keyvault 中的机密,源为 Web 应用、Spring Cloud 或容器应用。
| 名称 | 类型 | 说明 |
|---|---|---|
| secretType |
string:
key |
机密类型。 |
| value |
string |
keyvault 机密的 URI |
LinkerResource
源和目标资源的链接器
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源的完全限定资源 ID。 示例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
| name |
string |
资源的名称 |
| properties.authInfo | AuthInfoBase: |
身份验证类型。 |
| properties.clientType |
应用程序客户端类型 |
|
| properties.configurationInfo |
应用程序使用的连接信息,包括机密、连接字符串。 |
|
| properties.provisioningState |
string |
预配状态。 |
| properties.publicNetworkSolution |
网络解决方案。 |
|
| properties.scope |
string |
源服务中的连接范围。 |
| properties.secretStore |
用于将机密值存储在安全位置的选项 |
|
| properties.targetService | TargetServiceBase: |
目标服务属性 |
| properties.vNetSolution |
VNet 解决方案。 |
|
| systemData |
系统数据。 |
|
| type |
string |
资源的类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” |
PublicNetworkSolution
指示公用网络解决方案,包括防火墙规则
| 名称 | 类型 | 说明 |
|---|---|---|
| action |
可选。 指示公用网络解决方案。 如果启用,请尽量启用目标服务的公用网络访问。 默认值为 enable。 如果 optOut,则选择退出公用网络访问配置。 |
|
| deleteOrUpdateBehavior |
指示在链接器更新或删除时是否清理以前的操作(如防火墙规则) |
|
| firewallRules |
描述目标服务的防火墙规则,以确保源应用程序可以连接到目标。 |
SecretAuthInfo
authType 为机密时的身份验证信息
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
secret |
身份验证类型。 |
| name |
string |
机密身份验证的用户名或帐户名称。 |
| secretInfo | SecretInfoBase: |
密码或密钥保管库机密用于机密身份验证。 |
SecretStore
用于将机密值存储在安全位置的选项
| 名称 | 类型 | 说明 |
|---|---|---|
| keyVaultId |
string |
用于存储机密的密钥保管库 ID |
| keyVaultSecretName |
string |
用于存储机密的密钥保管库机密名称,仅在存储一个机密时有效 |
SecretType
机密类型。
| 值 | 说明 |
|---|---|
| rawValue | |
| keyVaultSecretUri | |
| keyVaultSecretReference |
SelfHostedServer
目标服务类型为 SelfHostedServer 时的服务属性
| 名称 | 类型 | 说明 |
|---|---|---|
| endpoint |
string |
服务的终结点。 |
| type | string: |
目标服务类型。 |
ServicePrincipalCertificateAuthInfo
authType 为 servicePrincipal 证书时的身份验证信息
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
service |
身份验证类型。 |
| certificate |
string |
servicePrincipal 身份验证的 ServicePrincipal 证书。 |
| clientId |
string |
servicePrincipal 身份验证的应用程序 clientId。 |
| deleteOrUpdateBehavior |
指示在链接器更新或删除时是否清理以前的操作 |
|
| principalId |
string |
servicePrincipal 身份验证的主体 ID。 |
| roles |
string[] |
可选,此值指定要分配的 Azure 角色。 自然而然 |
ServicePrincipalSecretAuthInfo
authType 为 servicePrincipal 机密时的身份验证信息
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
service |
身份验证类型。 |
| clientId |
string |
servicePrincipal 应用程序 clientId 用于 servicePrincipal 身份验证。 |
| deleteOrUpdateBehavior |
指示在链接器更新或删除时是否清理以前的操作 |
|
| principalId |
string |
servicePrincipal 身份验证的主体 ID。 |
| roles |
string[] |
可选,此值指定要分配的 Azure 角色。 自然而然 |
| secret |
string |
servicePrincipal 身份验证的机密。 |
| userName |
string |
在映射到 AAD 用户的数据库中创建的用户名。 |
SystemAssignedIdentityAuthInfo
authType 为 systemAssignedIdentity 时的身份验证信息
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
system |
身份验证类型。 |
| deleteOrUpdateBehavior |
指示在链接器更新或删除时是否清理以前的操作 |
|
| roles |
string[] |
可选,此值指定要分配的 Azure 角色 |
| userName |
string |
在映射到 AAD 用户的数据库中创建的用户名。 |
systemData
与创建和上次修改资源相关的元数据。
| 名称 | 类型 | 说明 |
|---|---|---|
| createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
| createdBy |
string |
创建资源的标识。 |
| createdByType |
创建资源的标识的类型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的资源时间戳(UTC) |
| lastModifiedBy |
string |
上次修改资源的标识。 |
| lastModifiedByType |
上次修改资源的标识的类型。 |
UserAccountAuthInfo
authType 为用户帐户时的身份验证信息
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
user |
身份验证类型。 |
| deleteOrUpdateBehavior |
指示在链接器更新或删除时是否清理以前的操作 |
|
| principalId |
string |
用户帐户的主体 ID。 |
| roles |
string[] |
可选,此值指定要分配的 Azure 角色。 自然而然 |
| userName |
string |
在映射到 AAD 用户的数据库中创建的用户名。 |
UserAssignedIdentityAuthInfo
authType 为 userAssignedIdentity 时的身份验证信息
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
user |
身份验证类型。 |
| clientId |
string |
userAssignedIdentity 的客户端 ID。 |
| deleteOrUpdateBehavior |
指示在链接器更新或删除时是否清理以前的操作 |
|
| roles |
string[] |
可选,此值指定要分配的 Azure 角色 |
| subscriptionId |
string |
userAssignedIdentity 的订阅 ID。 |
| userName |
string |
在映射到 AAD 用户的数据库中创建的用户名。 |
ValueSecretInfo
类型为 rawValue 时的机密信息。 适用于用户输入机密的方案。
| 名称 | 类型 | 说明 |
|---|---|---|
| secretType |
string:
raw |
机密类型。 |
| value |
string |
机密的实际值。 |
VNetSolution
链接器 VNet 解决方案
| 名称 | 类型 | 说明 |
|---|---|---|
| deleteOrUpdateBehavior |
指示在链接器更新或删除时是否清理以前的操作 |
|
| type |
VNet 解决方案的类型。 |
vNetSolutionType
VNet 解决方案的类型。
| 值 | 说明 |
|---|---|
| serviceEndpoint | |
| privateLink |