這很重要
本頁包含使用 Kubernetes 部署清單管理 Azure IoT Operations 元件的說明,該清單已在預覽中。 這項功能隨附 數個限制,不應用於生產工作負載。
請參閱 Microsoft Azure 預覽版增補使用規定,以了解適用於 Azure 功能 (搶鮮版 (Beta)、預覽版,或尚未正式發行的版本) 的法律條款。
數據流圖形會使用登錄端點,從容器登錄提取 WebAssembly (WASM) 模組和圖形定義。 您可以設定端點設定、驗證和其他設定,以連線到 Azure Container Registry (ACR) 或其他與 OCI 相容的登錄。
先決條件
- Azure IoT 作業的實例,版本 1.2 預覽版或更新版本
- 存取容器登錄,例如 Azure Container Registry
登錄端點概觀
登錄端點會定義存取容器登錄的連線詳細數據和驗證方法。 登錄端點的用途如下:
- 數據流圖形:提取 WASM 模組和圖形定義
- Akri 連接器:用於獲取自定義連接器範本
登入端點可透過下列方式支援驗證:
- 系統指派的管理身份識別
- 使用者指派的受管理的身分識別
- 成品提取密碼 (使用者名稱和密碼)
- 匿名存取(適用於公用登錄)
建立登錄端點
您可以使用 Bicep 或 Kubernetes 建立登錄端點。
這很重要
目前,使用 Akri 連接器的登錄端點資源時,已知存在一個問題。 更多資訊請參見 Akri 連接器無法與登錄終端資源合作。
使用下列內容建立 Bicep .bicep 檔案:
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
param registryEndpointName string = '<REGISTRY_ENDPOINT_NAME>'
param registryHost string = '<REGISTRY_HOST>' // For example, myregistry.azurecr.io
resource aioInstance 'Microsoft.IoTOperations/instances@2024-11-01' existing = {
name: aioInstanceName
}
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
name: customLocationName
}
resource registryEndpoint 'Microsoft.IoTOperations/instances/registryEndpoints@2025-07-01-preview' = {
parent: aioInstance
name: registryEndpointName
extendedLocation: {
name: customLocation.id
type: 'CustomLocation'
}
properties: {
host: registryHost
authentication: {
method: 'SystemAssignedManagedIdentity'
systemAssignedManagedIdentitySettings: {
audience: 'https://management.azure.com/'
}
}
}
}
使用 Azure CLI 部署 Bicep 檔案:
az deployment group create --resource-group <RESOURCE_GROUP> --template-file <FILE>.bicep
設定選項
本節說明登錄端點可用的組態選項。
主辦人
屬性 host 會指定容器登錄主機名。 針對 Azure Container Registry,請使用 格式 <registry-name>.azurecr.io。 主機屬性支援 HTTPS URL 或只支援主機名。
範例:
myregistry.azurecr.iohttps://myregistry.azurecr.io
模式:必須符合 Azure Container Registry 的模式 ^(https:\/\/)?[a-zA-Z0-9\-]+\.azurecr\.io$ 。
身份驗證方法
登錄端點支持數個驗證方法,以安全地存取容器登錄。
系統指派的管理身份識別
系統指派的受控識別會使用 Azure IoT Operations 實例的內建身分識別向登錄進行驗證。 這是 Azure Container Registry 的建議方法,因為它不需要管理認證。
設定登錄端點之前,請確定 Azure IoT 作業系統指派的受控識別具有必要的許可權:
- 在 Azure 入口網站中,移至您的 Azure IoT 作業實例,然後選取 [ 概觀]。
- 複製 Azure IoT Operations Arc 擴充功能之後所列的擴充功能名稱。 例如,azure-iot-operations-xxxx7。
- 移至您的容器登錄 >訪問控制 (IAM)>新增角色指派。
- 在 [ 角色] 索引標籤上,選取
AcrPull[角色]。 - 在 [ 成員] 索引標籤上,針對 [ 指派存取權],選取 [ 使用者、群組或服務主體],然後選取 [+ 選取成員 ],然後搜尋 Azure IoT Operations Arc 擴充功能名稱。 選擇延伸模組,然後選取 [選取]。
- 選取 [檢閱 + 指派],以完成角色指派。
authentication: {
method: 'SystemAssignedManagedIdentity'
systemAssignedManagedIdentitySettings: {
audience: 'https://management.azure.com/'
extensionName: null // Optional: specific extension name
tenantId: null // Optional: specific tenant ID
}
}
系統指派的受控識別設定:
| 房產 | 說明 | 為必填項目 | 類型 |
|---|---|---|---|
audience |
要針對的服務對象進行驗證。 | 否 | 繩子 |
extensionName |
要使用的特定延伸模組名稱。 | 否 | 繩子 |
tenantId |
用於驗證的租用戶標識碼。 | 否 | 繩子 |
如果未提供,運算符會嘗試從端點推斷物件。 針對 Azure Container Registry,物件通常是 https://management.azure.com/。
使用者指派的受管理的身分識別
使用者指派的受控識別可讓您使用您已建立並設定必要許可權的特定受控識別。
設定登錄端點之前,請確定使用者指派的受控識別具有 AcrPull 容器登錄上的角色。
authentication: {
method: 'UserAssignedManagedIdentity'
userAssignedManagedIdentitySettings: {
clientId: '<CLIENT_ID>'
tenantId: '<TENANT_ID>'
scope: null // Optional: specific scope
}
}
使用者指派的受控識別設定:
| 房產 | 說明 | 為必填項目 | 類型 |
|---|---|---|---|
clientId |
使用者指派受控識別的用戶端標識碼。 | 是的 | 繩子 |
tenantId |
受控識別所在的租用戶標識碼。 | 是的 | 繩子 |
scope |
具有 .default 後綴的資源範圍。 |
否 | 繩子 |
如果未提供,運算符會嘗試從端點推斷範圍。
成品提取秘密
成品提取密碼可讓您針對不支援受控識別驗證的登錄使用使用者名稱和密碼驗證。
首先,建立包含登錄認證的 Kubernetes 秘密:
kubectl create secret docker-registry my-registry-secret \
--docker-server=myregistry.azurecr.io \
--docker-username=<USERNAME> \
--docker-password=<PASSWORD> \
-n azure-iot-operations
authentication: {
method: 'ArtifactPullSecret'
artifactPullSecretSettings: {
secretRef: 'my-registry-secret'
}
}
匿名驗證
匿名驗證用於不需要驗證的公用登錄。
authentication: {
method: 'Anonymous'
anonymousSettings: {}
}
Azure Container Registry 整合
Azure Container Registry (ACR) 是適用於 Azure IoT 作業的建議容器登錄。 ACR 透過 Microsoft Entra 識別符,提供具有整合式驗證的安全私人 Docker 容器登錄。
ACR 的必要條件
- 建立 ACR 實例:如果您沒有 ACR 實例,請在您的訂用帳戶中建立 Azure Container Registry 實例。
-
設定許可權:確定 Azure IoT Operations 受控識別具有
AcrPull登錄的許可權。 - 推送成品:使用 ORAS CLI 之類的工具,將您的 WASM 模組和圖形定義上傳至登錄。
ACR 組態範例
以下是設定 ACR 登錄端點的完整範例:
param aioInstanceName string = 'my-aio-instance'
param customLocationName string = 'my-custom-location'
param acrName string = 'myregistry'
resource aioInstance 'Microsoft.IoTOperations/instances@2024-11-01' existing = {
name: aioInstanceName
}
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
name: customLocationName
}
resource acrRegistryEndpoint 'Microsoft.IoTOperations/instances/registryEndpoints@2025-07-01-preview' = {
parent: aioInstance
name: 'acr-endpoint'
extendedLocation: {
name: customLocation.id
type: 'CustomLocation'
}
properties: {
host: '${acrName}.azurecr.io'
authentication: {
method: 'SystemAssignedManagedIdentity'
systemAssignedManagedIdentitySettings: {
audience: 'https://management.azure.com/'
}
}
}
}
其他容器登錄
登錄端點也支援其他與 OCI 相容的容器登錄,例如:
- Docker Hub
- 港
- AWS Elastic Container Registry (ECR)
- Google Container Registry (GCR)
針對這些登錄,您通常會使用成品提取秘密進行驗證,除非它們支援 Azure 受控識別。