AzureIoTEdge@2 - Azure IoT Edge v2 görevi

Azure IoT Edge hızlı ve verimli bir şekilde görüntü oluşturup dağıtmak için bu görevi kullanın.

Bu görev özel değişkenleri destekler. İşlem Hatlarında değişkenlerin nasıl kullanılacağını bilmiyorsanız bkz. Değişkenleri tanımlama.

Syntax

# Azure IoT Edge v2
# Build and deploy an Azure IoT Edge image.
- task: AzureIoTEdge@2
  inputs:
    action: 'Build module images' # 'Build module images' | 'Push module images' | 'Generate deployment manifest' | 'Deploy to IoT Edge devices'. Required. Action. Default: Build module images.
    #deploymentFilePath: '$(System.DefaultWorkingDirectory)/config/deployment.json' # string. Required when action == Deploy to IoT Edge devices. Deployment file. Default: $(System.DefaultWorkingDirectory)/config/deployment.json.
    #azureSubscription: # string. Alias: connectedServiceNameARM. Required when action == Deploy to IoT Edge devices. Azure subscription contains IoT Hub. 
    #iothubname: # string. Required when action == Deploy to IoT Edge devices. IoT Hub name. 
    #deviceOption: # 'Single Device' | 'Multiple Devices'. Required when action == Deploy to IoT Edge devices. Choose single/multiple device. 
    #deviceId: # string. Required when deviceOption == Single Device. IoT Edge device ID. 
    #targetcondition: # string. Required when deviceOption == Multiple Devices. IoT Edge device target condition. 
    #containerregistrytype: 'Azure Container Registry' # 'Azure Container Registry' | 'Generic Container Registry'. Required when action = Push module images. Container registry type. Default: Azure Container Registry.
    #dockerRegistryConnection: # string. Alias: dockerRegistryEndpoint. Required when containerregistrytype = Generic Container Registry. Docker Registry Connection. 
    #azureSubscriptionEndpoint: # string. Optional. Use when containerregistrytype = Azure Container Registry. Azure subscription. 
    #azureContainerRegistry: # string. Required when containerregistrytype = Azure Container Registry. Azure Container Registry. 
    #templateFilePath: 'deployment.template.json' # string. Required when action = Build module images || action = Push module images || action = Generate deployment manifest. .template.json file. Default: deployment.template.json.
    #defaultPlatform: 'amd64' # 'amd64' | 'windows-amd64' | 'arm32v7' | 'arm64v8'. Required when action = Build module images || action = Push module images || action = Generate deployment manifest. Default platform. Default: amd64.
    #fillRegistryCredential: 'true' # 'true' | 'false'. Required when action = Push module images. Add registry credential to deployment manifest. Default: true.
    #deploymentManifestOutputPath: '$(System.DefaultWorkingDirectory)/config/deployment.json' # string. Required when action == Generate deployment manifest. Output path. Default: $(System.DefaultWorkingDirectory)/config/deployment.json.
    #validateGeneratedDeploymentManifest: 'false' # 'true' | 'false'. Required when action = Generate deployment manifest. Validate the schema of generated deployment manifest. Default: false.
  # Advanced
    #deploymentid: '$(System.TeamProject)-devops-deployment' # string. Required when action = Deploy to IoT Edge devices. IoT Edge deployment ID. Default: $(System.TeamProject)-devops-deployment.
    #priority: '0' # string. Required when action = Deploy to IoT Edge devices. IoT Edge deployment priority. Default: 0.
  # Advanced
    #bypassModules: # string. Optional. Use when action = Push module images. Bypass module(s).
# Azure IoT Edge v2
# Build and deploy an Azure IoT Edge image.
- task: AzureIoTEdge@2
  inputs:
    action: 'Build module images' # 'Build module images' | 'Push module images' | 'Generate deployment manifest' | 'Deploy to IoT Edge devices'. Required. Action. Default: Build module images.
    #deploymentFilePath: '$(System.DefaultWorkingDirectory)/config/deployment.json' # string. Required when action == Deploy to IoT Edge devices. Deployment file. Default: $(System.DefaultWorkingDirectory)/config/deployment.json.
    #azureSubscription: # string. Alias: connectedServiceNameARM. Required when action == Deploy to IoT Edge devices. Azure subscription contains IoT Hub. 
    #iothubname: # string. Required when action == Deploy to IoT Edge devices. IoT Hub name. 
    #deviceOption: # 'Single Device' | 'Multiple Devices'. Required when action == Deploy to IoT Edge devices. Choose single/multiple device. 
    #deviceId: # string. Required when deviceOption == Single Device. IoT Edge device ID. 
    #targetcondition: # string. Required when deviceOption == Multiple Devices. IoT Edge device target condition. 
    #containerregistrytype: 'Azure Container Registry' # 'Azure Container Registry' | 'Generic Container Registry'. Required when action = Push module images. Container registry type. Default: Azure Container Registry.
    #dockerRegistryConnection: # string. Alias: dockerRegistryEndpoint. Required when containerregistrytype = Generic Container Registry. Docker Registry Connection. 
    #azureSubscriptionEndpoint: # string. Optional. Use when containerregistrytype = Azure Container Registry. Azure subscription. 
    #azureContainerRegistry: # string. Required when containerregistrytype = Azure Container Registry. Azure Container Registry. 
    #templateFilePath: 'deployment.template.json' # string. Required when action = Build module images || action = Push module images || action = Generate deployment manifest. .template.json file. Default: deployment.template.json.
    #defaultPlatform: 'amd64' # 'amd64' | 'windows-amd64' | 'arm32v7'. Required when action = Build module images || action = Push module images || action = Generate deployment manifest. Default platform. Default: amd64.
    #fillRegistryCredential: 'true' # 'true' | 'false'. Required when action = Push module images. Add registry credential to deployment manifest. Default: true.
    #deploymentManifestOutputPath: '$(System.DefaultWorkingDirectory)/config/deployment.json' # string. Required when action == Generate deployment manifest. Output path. Default: $(System.DefaultWorkingDirectory)/config/deployment.json.
    #validateGeneratedDeploymentManifest: 'false' # 'true' | 'false'. Required when action = Generate deployment manifest. Validate the schema of generated deployment manifest. Default: false.
  # Advanced
    #deploymentid: '$(System.TeamProject)-devops-deployment' # string. Required when action = Deploy to IoT Edge devices. IoT Edge deployment ID. Default: $(System.TeamProject)-devops-deployment.
    #priority: '0' # string. Required when action = Deploy to IoT Edge devices. IoT Edge deployment priority. Default: 0.
  # Advanced
    #bypassModules: # string. Optional. Use when action = Push module images. Bypass module(s).
# Azure IoT Edge v2
# Build and deploy an Azure IoT Edge image.
- task: AzureIoTEdge@2
  inputs:
    action: 'Build module images' # 'Build module images' | 'Push module images' | 'Generate deployment manifest' | 'Deploy to IoT Edge devices'. Required. Action. Default: Build module images.
    #deploymentFilePath: '$(System.DefaultWorkingDirectory)/config/deployment.json' # string. Required when action == Deploy to IoT Edge devices. Deployment file. Default: $(System.DefaultWorkingDirectory)/config/deployment.json.
    #azureSubscription: # string. Alias: connectedServiceNameARM. Required when action == Deploy to IoT Edge devices. Azure subscription contains IoT Hub. 
    #iothubname: # string. Required when action == Deploy to IoT Edge devices. IoT Hub name. 
    #deviceOption: # 'Single Device' | 'Multiple Devices'. Required when action == Deploy to IoT Edge devices. Choose single/multiple device. 
    #deviceId: # string. Required when deviceOption == Single Device. IoT Edge device ID. 
    #targetcondition: # string. Required when deviceOption == Multiple Devices. IoT Edge device target condition. 
    #containerregistrytype: 'Azure Container Registry' # 'Azure Container Registry' | 'Generic Container Registry'. Required when action = Push module images. Container registry type. Default: Azure Container Registry.
    #dockerRegistryConnection: # string. Alias: dockerRegistryEndpoint. Required when containerregistrytype = Generic Container Registry. Docker Registry Connection. 
    #azureSubscriptionEndpoint: # string. Optional. Use when containerregistrytype = Azure Container Registry. Azure subscription. 
    #azureContainerRegistry: # string. Required when containerregistrytype = Azure Container Registry. Azure Container Registry. 
    #templateFilePath: 'deployment.template.json' # string. Required when action = Build module images || action = Push module images || action = Generate deployment manifest. .template.json file. Default: deployment.template.json.
    #defaultPlatform: 'amd64' # 'amd64' | 'windows-amd64' | 'arm32v7'. Required when action = Build module images || action = Push module images || action = Generate deployment manifest. Default platform. Default: amd64.
    #fillRegistryCredential: 'true' # 'true' | 'false'. Required when action = Push module images. Add registry credential to deployment manifest. Default: true.
    #deploymentManifestOutputPath: '$(System.DefaultWorkingDirectory)/config/deployment.json' # string. Required when action == Generate deployment manifest. Output path. Default: $(System.DefaultWorkingDirectory)/config/deployment.json.
  # Advanced
    #deploymentid: '$(System.TeamProject)-devops-deployment' # string. Required when action = Deploy to IoT Edge devices. IoT Edge deployment ID. Default: $(System.TeamProject)-devops-deployment.
    #priority: '0' # string. Required when action = Deploy to IoT Edge devices. IoT Edge deployment priority. Default: 0.
  # Advanced
    #bypassModules: # string. Optional. Use when action = Push module images. Bypass module(s).

Girişler

action - Eylem
string. Gereklidir. İzin verilen değerler: Build module images, Push module images, Generate deployment manifest, Deploy to IoT Edge devices. Varsayılan değer: Build module images.

Bir Azure IoT Edge eylemi seçer.

Build module images yalnızca modülleri oluşturur (derleme hatalarını denetlemek için kullanabilirsiniz).

Push module images modülleri kapsayıcı kayıt defterine gönderir.

Deploy to IoT Edge devicesoluşturulan dağıtım dosyasını IoT Hub dağıtır. (Görevi yayın işlem hattına yerleştirmenizi Deploy öneririz.)


deploymentFilePath - Dağıtım dosyası
string. olduğunda action == Deploy to IoT Edge devicesgereklidir. Varsayılan değer: $(System.DefaultWorkingDirectory)/config/deployment.json.

Dağıtım json dosyasını seçer. Bu görev içindeyse release pipeline, dağıtım dosyasının yapıttaki konumunu ayarlamanız gerekir. (Varsayılan değer çoğu koşul için çalışır.) Bu görev bir derleme işlem hattındaysa, dağıtım bildirimi çıkış yolunu belirtmeniz gerekir.


azureSubscription - Azure aboneliği IoT Hub içerir
Giriş diğer adı: connectedServiceNameARM. string. olduğunda action == Deploy to IoT Edge devicesgereklidir.

IoT Hub içeren bir Azure aboneliği seçer.


iothubname - IoT Hub adı
string. olduğunda action == Deploy to IoT Edge devicesgereklidir.

IoT Hub seçer.


deploymentid - IoT Edge dağıtım kimliği
string. olduğunda action = Deploy to IoT Edge devicesgereklidir. Varsayılan değer: $(System.TeamProject)-devops-deployment.

IoT Edge Dağıtım Kimliğini girin. Kimlik zaten varsa geçersiz kılınır. Bu, en fazla 128 küçük harf ve sayı içerir ve şu karakterlere izin verilir: -:+%_#*?!(),=@;'. Daha fazla bilgi için bkz. Azure IoT Edge dağıtımı.


priority - dağıtım önceliğini IoT Edge
string. olduğunda action = Deploy to IoT Edge devicesgereklidir. Varsayılan değer: 0.

Dağıtım çakışmalarını priority çözmek için öğesini pozitif bir tamsayıya ayarlar. Bu görev birden çok dağıtım tarafından hedeflendiğinde, bir cihaz en yüksek önceliğe sahip olanı veya aynı önceliğe sahip iki dağıtım söz konusu olduğunda en son oluşturma süresini kullanır. Daha fazla bilgi için bkz. Azure IoT Edge dağıtımı.


deviceOption - Tek/birden çok cihaz seçme
string. olduğunda action == Deploy to IoT Edge devicesgereklidir. İzin verilen değerler: Single Device, Multiple Devices.

Etiketlere göre, tek veya birden çok cihaza dağıtmayı seçer.


deviceId - cihaz kimliğini IoT Edge
string. olduğunda deviceOption == Single Devicegereklidir.

IoT Edgedevice ID.


targetcondition - cihaz hedef koşulunu IoT Edge
string. olduğunda deviceOption == Multiple Devicesgereklidir.

target condition Dağıtmak istediğiniz cihazların girişlerini yapar. Çift tırnak kullanmayın. Örnek: tags.building=9 ve tags.environment='test'. Daha fazla bilgi için bkz. Azure IoT Edge dağıtımı.


containerregistrytype - Kapsayıcı kayıt defteri türü
string. olduğunda action = Push module imagesgereklidir. İzin verilen değerler: Azure Container Registry, Generic Container Registry. Varsayılan değer: Azure Container Registry.

bir Container Registry Typeseçer. Azure Container Registry ACR içindir ve Generic Container Registry docker hub dahil olmak üzere genel kayıt defterlerine yöneliktir.


dockerRegistryConnection - Docker Kayıt Defteri Bağlantısı
Giriş diğer adı: dockerRegistryEndpoint. string. olduğunda containerregistrytype = Generic Container Registrygereklidir.

Genel bir Docker kayıt defteri bağlantısı seçer. Bu, derleme ve gönderme için gereklidir.


azureSubscriptionEndpoint - Azure aboneliği
string. İsteğe bağlı. olduğunda containerregistrytype = Azure Container Registrykullanın.

Bir Azure aboneliği seçer.


azureContainerRegistry - Azure Container Registry
string. olduğunda containerregistrytype = Azure Container Registrygereklidir.

Bir Azure Container Registry seçer.


templateFilePath - .template.json dosyası
string. olduğunda action = Build module images || action = Push module images || action = Generate deployment manifestgereklidir. Varsayılan değer: deployment.template.json.

Azure IoT Edge çözümünün .template.jsonyolu. Bu dosya, Azure IoT Edge çözümündeki modülleri ve yolları tanımlar. Dosya adı ile .template.jsonbitmelidir.


defaultPlatform - Varsayılan platform
string. olduğunda action = Build module images || action = Push module images || action = Generate deployment manifestgereklidir. İzin verilen değerler: amd64, windows-amd64, arm32v7, arm64v8. Varsayılan değer: amd64.

içinde .template.jsonmodüller platformunu belirtilmemiş olarak bırakabilirsiniz. Bu modüller için varsayılan platform kullanılır.


defaultPlatform - Varsayılan platform
string. olduğunda action = Build module images || action = Push module images || action = Generate deployment manifestgereklidir. İzin verilen değerler: amd64, windows-amd64, arm32v7. Varsayılan değer: amd64.

içinde .template.jsonmodüller platformunu belirtilmemiş olarak bırakabilirsiniz. Bu modüller için varsayılan platform kullanılır.


fillRegistryCredential - Dağıtım bildirimine kayıt defteri kimlik bilgileri ekleme
string. olduğunda action = Push module imagesgereklidir. İzin verilen değerler: true, false. Varsayılan değer: true.

Docker görüntülerini dağıtım bildirimine göndermek için kayıt defteri kimlik bilgilerini ekler.


deploymentManifestOutputPath - Çıkış yolu
string. olduğunda action == Generate deployment manifestgereklidir. Varsayılan değer: $(System.DefaultWorkingDirectory)/config/deployment.json.

Oluşturulan dağıtım bildiriminin çıkış yolu.


validateGeneratedDeploymentManifest - Oluşturulan dağıtım bildiriminin şemasını doğrulama
string. olduğunda action = Generate deployment manifestgereklidir. İzin verilen değerler: true, false. Varsayılan değer: false.

Oluşturulan dağıtım bildirimi şema doğrulamasını geçmezse bu adım başarısız olur. En son şemayı bulmak için JSON Şema Deposu'nda aramaAzure IoT Edge deployment.


bypassModules - Atlama modülleri
string. İsteğe bağlı. olduğunda action = Push module imageskullanın.

içinde derlemeniz veya göndermeniz .template.jsongerekmeyen modülleri seçer, modül adlarını belirtir ve bunları virgülle ayırır. Örnek: içinde ve SampleModule2.template.json varsa SampleModule1 ve yalnızca derlemek veya göndermek SampleModule1istiyorsanız atlama modüllerini olarak SampleModule2ayarlarsınız. içindeki .template.jsontüm modülleri oluşturmak istiyorsanız bunu boş bırakın.


Görev denetim seçenekleri

Tüm görevlerde görev girişlerine ek olarak denetim seçenekleri vardır. Daha fazla bilgi için bkz . Denetim seçenekleri ve ortak görev özellikleri.

Çıkış değişkenleri

Bu görev aşağı akış adımlarında, işlerde ve aşamalarda kullanabileceğiniz aşağıdaki çıkış değişkenlerini tanımlar.

DEPLOYMENT_FILE_PATH
Bu, oluşturulan dağıtım dosyasının yoludur.

Açıklamalar

Uygulamaları azure IoT Edge hızlı ve verimli bir şekilde derlemek, test etmek ve dağıtmak için bu görevi kullanın.

Bu görev özel değişkenleri destekler. İşlem Hatlarında değişkenlerin nasıl kullanılacağını bilmiyorsanız bkz. Değişkenleri tanımlama.

Örnekler

Modül görüntüleri oluşturma

Aşağıdaki YAML örneği modül görüntülerini oluşturur:

- task: AzureIoTEdge@2
  displayName: AzureIoTEdge - Build module images
  inputs:
    action: Build module images
    templateFilePath: deployment.template.json
    defaultPlatform: amd64  

Modül görüntülerini gönderme

Aşağıdaki YAML örneği modül görüntülerini iter:

variables:
  azureSubscriptionEndpoint: Contoso
  azureContainerRegistry: contoso.azurecr.io

steps:    
- task: AzureIoTEdge@2
  displayName: AzureIoTEdge - Push module images
  inputs:
    action: Push module images
    containerregistrytype: Azure Container Registry
    azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
    azureContainerRegistry: {"loginServer":"$(azureContainerRegistry)"}
    templateFilePath: deployment.template.json
    defaultPlatform: amd64
    fillRegistryCredential: true

Dağıtım bildirimi oluşturma

Aşağıdaki YAML örneği, şablon dosyasını temel alan bir dağıtım bildirimi oluşturur:

steps:    
- task: AzureIoTEdge@2
  displayName: AzureIoTEdge - Generate deployment manifest
  inputs:
    action: Generate deployment manifest
    templateFilePath: deployment.template.json
    defaultPlatform: amd64
    deploymentManifestOutputPath: $(System.DefaultWorkingDirectory)/config/deployment.json
    validateGeneratedDeploymentManifest: false

IoT Edge'e cihazlarına dağıtma

Aşağıdaki YAML örneği modül görüntülerini dağıtır:

steps:
- task: AzureIoTEdge@2
  displayName: 'Azure IoT Edge - Deploy to IoT Edge devices'
  inputs:
    action: 'Deploy to IoT Edge devices'
    deploymentFilePath: $(System.DefaultWorkingDirectory)/config/deployment.json
    azureSubscription: $(azureSubscriptionEndpoint)
    iothubname: iothubname
    deploymentid: '$(System.TeamProject)-devops-deployment'
    priority: '0'
    deviceOption: 'Single Device'
    deviceId: deviceId

Diğer örnekler

Azure Pipelines'da bu eylemlerin nasıl kullanılacağına ilişkin adım adım örnekler için aşağıdaki makalelere bakın:

Gereksinimler

Gereksinim Açıklama
İşlem hattı türleri YAML, Klasik derleme, Klasik sürüm
Üzerinde çalıştırılır Agent, DeploymentGroup
Talep Hiçbiri
Özellikler Bu görev, işteki sonraki görevler için herhangi bir talebi karşılamaz.
Komut kısıtlamaları Herhangi biri
Ayarlanabilir değişkenler Herhangi biri
Aracı sürümü Desteklenen tüm aracı sürümleri.
Görev kategorisi Oluşturma