Static Sites - Update Database Connection
建立或更新靜態網站的資料庫連線的描述
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/databaseConnections/{databaseConnectionName}?api-version=2025-05-01
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
database
|
path | True |
string pattern: ^[a-zA-Z0-9]+$ |
資料庫連線的名稱。 |
|
name
|
path | True |
string |
靜態網站的名稱 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
資源群組的名稱。 名稱不區分大小寫。 |
|
subscription
|
path | True |
string (uuid) |
目標訂用帳戶的標識碼。 此值必須是 UUID。 |
|
api-version
|
query | True |
string minLength: 1 |
用於此作業的 API 版本。 |
要求本文
| 名稱 | 類型 | Description |
|---|---|---|
| properties.connectionIdentity |
string |
如果存在,則身分識別會與連接字串搭配使用,以連線到資料庫。 使用系統指派的受控識別會以字串 『SystemAssigned』 表示,而使用使用者指派的受控識別則以受控識別資源的資源標識符表示。 |
| properties.connectionString |
string |
用來連接到資料庫的連接字串。 |
| properties.region |
string |
資料庫資源的區域。 |
| properties.resourceId |
string |
資料庫的資源識別碼。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
Azure 作業已順利完成。 |
|
| Other Status Codes |
未預期的錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
| 名稱 | Description |
|---|---|
| user_impersonation | 模擬您的用戶帳戶 |
範例
Patch a database connection for a static site
範例要求
範例回覆
{
"name": "default",
"type": "Microsoft.Web/staticSites/databaseConnections",
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.Web/staticSites/testStaticSite0/databaseConnections/default",
"properties": {
"connectionIdentity": "SystemAssigned",
"region": "West US 2",
"resourceId": "/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/databaseRG/providers/Microsoft.DocumentDB/databaseAccounts/exampleDatabaseName"
}
}
定義
| 名稱 | Description |
|---|---|
|
created |
建立資源的身分識別類型。 |
|
Database |
靜態月臺資料庫連線資源。 |
|
Database |
修補時的靜態月臺資料庫連線要求屬性資源 |
|
Default |
App Service 錯誤回應。 |
|
Default |
錯誤模型。 |
|
Default |
詳細的錯誤。 |
|
Static |
資料庫連線組態檔 |
|
system |
與建立和上次修改資源相關的元數據。 |
createdByType
建立資源的身分識別類型。
| 值 | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
DatabaseConnection
靜態月臺資料庫連線資源。
| 名稱 | 類型 | Description |
|---|---|---|
| id |
string (arm-id) |
資源的完整資源標識碼。 例如 “/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}” |
| kind |
string |
資源種類。 |
| name |
string |
資源的名稱 |
| properties.configurationFiles |
與此資料庫連線相關聯的組態檔清單。 |
|
| properties.connectionIdentity |
string |
如果存在,則身分識別會與連接字串搭配使用,以連線到資料庫。 使用系統指派的受控識別會以字串 『SystemAssigned』 表示,而使用使用者指派的受控識別則以受控識別資源的資源標識符表示。 |
| properties.connectionString |
string |
用來連接到資料庫的連接字串。 |
| properties.region |
string |
資料庫資源的區域。 |
| properties.resourceId |
string |
資料庫的資源識別碼。 |
| systemData |
包含 createdBy 和 modifiedBy 資訊的 Azure Resource Manager 中繼資料。 |
|
| type |
string |
資源的類型。 例如「Microsoft.Compute/virtualMachines」或「Microsoft.Storage/storageAccounts」 |
DatabaseConnectionPatchRequest
修補時的靜態月臺資料庫連線要求屬性資源
| 名稱 | 類型 | Description |
|---|---|---|
| properties.connectionIdentity |
string |
如果存在,則身分識別會與連接字串搭配使用,以連線到資料庫。 使用系統指派的受控識別會以字串 『SystemAssigned』 表示,而使用使用者指派的受控識別則以受控識別資源的資源標識符表示。 |
| properties.connectionString |
string |
用來連接到資料庫的連接字串。 |
| properties.region |
string |
資料庫資源的區域。 |
| properties.resourceId |
string |
資料庫的資源識別碼。 |
DefaultErrorResponse
App Service 錯誤回應。
| 名稱 | 類型 | Description |
|---|---|---|
| error |
錯誤模型。 |
DefaultErrorResponseError
錯誤模型。
| 名稱 | 類型 | Description |
|---|---|---|
| code |
string |
標準化字串,以程式設計方式識別錯誤。 |
| details |
詳細的錯誤。 |
|
| innererror |
string |
偵錯錯誤的詳細資訊。 |
| message |
string |
詳細的錯誤描述和偵錯資訊。 |
| target |
string |
詳細的錯誤描述和偵錯資訊。 |
DefaultErrorResponseErrorDetailsItem
詳細的錯誤。
| 名稱 | 類型 | Description |
|---|---|---|
| code |
string |
標準化字串,以程式設計方式識別錯誤。 |
| message |
string |
詳細的錯誤描述和偵錯資訊。 |
| target |
string |
詳細的錯誤描述和偵錯資訊。 |
StaticSiteDatabaseConnectionConfigurationFileOverview
資料庫連線組態檔
| 名稱 | 類型 | Description |
|---|---|---|
| contents |
string |
檔案內容的 Base64 編碼。 |
| fileName |
string |
組態檔的名稱。 |
| type |
string |
組態檔的類型。 |
systemData
與建立和上次修改資源相關的元數據。
| 名稱 | 類型 | Description |
|---|---|---|
| createdAt |
string (date-time) |
資源建立的時間戳(UTC)。 |
| createdBy |
string |
建立資源的身分識別。 |
| createdByType |
建立資源的身分識別類型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的資源時間戳 (UTC) |
| lastModifiedBy |
string |
上次修改資源的身分識別。 |
| lastModifiedByType |
上次修改資源的身分識別類型。 |