IoT Edge roll hanterings ändringar för din Azure Stack Edge-enhetIoT Edge role management changes for your Azure Stack Edge device

För Azure IoT Edge roll hantering för din Azure Stack Edge-enhet använder du den uppdaterade versionen av API, SDK och Azure PowerShell, som är schemalagd för version januari 2021.For Azure IoT Edge role management for your Azure Stack Edge device, use the updated version of the API, SDK, and Azure PowerShell, which is scheduled for January 2021 release.

Den här artikeln beskriver i detalj vilka ändringar du behöver göra när du använder den senaste versionen.This article describes in detail the changes that you need to make when you use this newest version.

Uppdateringen från januari 2021 är bara tillgänglig för Azure Stack Edge Pro-GPU, Azure Stack Edge Pro R och Azure Stack Edge Mini R-enheter.The January 2021 update will be available only for Azure Stack Edge Pro - GPU, Azure Stack Edge Pro R, and Azure Stack Edge Mini R devices. Informationen i den här artikeln gäller endast för dessa enheter.The information in this article applies only to these devices.

Anteckning

Du behöver inte uppgradera till version januari 2021.You're not required to upgrade to the January 2021 version. Om du väljer att fortsätta använda din nuvarande version påverkas inte IoT Edge roll hantering.If you choose to continue using your current version, there is no impact on IoT Edge role management. Men för att dra nytta av de nya funktionerna och för att minska eventuella säkerhets risker rekommenderar vi att du installerar den nya versionen.However, to take advantage of the new features and to help reduce any security risks, we recommend that you install the newer version.

IoT Edge roll hanterings ändringarIoT Edge role management changes

När du har installerat den valfria uppdateringen för januari 2021 på din Azure Stack Edge-enhet måste du använda den senaste versionen av API, SDK och PowerShell-cmdletar för IoT Edge roll hantering.After you install the optional January 2021 update on your Azure Stack Edge device, you'll need to use the latest version of the API, SDK, and PowerShell cmdlets for IoT Edge role management.

Följande ändringar krävs endast om du använder uppdatering januari 2021:The following changes are required only if you apply the January 2021 update:

  • Om du för närvarande använder roll hanterings-API version   2019-08-01, uppgradera till den API-version som kommer att lanseras i januari 2021.If you're currently using the Role Management API version 2019-08-01, upgrade to the API version that will be released in January 2021.
  • Om du för närvarande använder roll hantering via SDK   -versionen 1.0.0 uppgraderar du till den version som publiceras i januari 2021.If you're currently using role management via SDK version 1.0.0, upgrade to the version that will be released in January 2021.
  • Om du använder roll hantering med Azure PowerShell-cmdlets (för hands version), till exempel,, Get-AzStackEdgeRole New-AzStackEdgeRole Set-AzStackEdgeRole eller Remove-AzStackEdgeRole , väntar du tills de nya cmdletarna lanseras i februari 2021.If you're using role management with the Azure PowerShell cmdlets (Preview), such as Get-AzStackEdgeRole, New-AzStackEdgeRole, Set-AzStackEdgeRole, or Remove-AzStackEdgeRole, wait for the new cmdlets to be released in February 2021.

API-användningAPI usage

Om du för närvarande utför IoT Edge roll hantering via API bör du använda den nya API-versionen 2020-12-01, som kommer att publiceras senare.If you're currently performing IoT Edge role management via API, you should use the new API version 2020-12-01, which will be published later. Om du använder det aktuella roll-API: et, efter att du har installerat den kommande versionen av enhets program, måste du flytta till rollen placera, hämta eller ta bort Kubernetes, följt av API: et placera IoT-tillägg.If you're using the current Role API, after you install the upcoming device software version, you must move to the PUT, GET, or DELETE Kubernetes role, followed by the PUT IoT Add-on API.

För metoden placeringFor the PUT method

Aktuell HTTP-begäranThe current HTTP request

  • API-anropen görs med denna URI: https://management.azure.com/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/IoTRole1?api-version=2019-08-01The API calls are made at this URI: 'https://management.azure.com/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/IoTRole1?api-version=2019-08-01'

  • Begär ande texten ser ut så här:The request body looks like this:

    {
        "kind": "IOT",
        "properties": {
            "hostPlatform": "Linux",
            "ioTDeviceDetails": {
                "deviceId": "iotdevice",
                "ioTHostHub": "iothub.azure-devices.net",
                "ioTHostHubId": "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/Microsoft.Devices/IotHubs/testrxiothub",
                "authentication": {
                    "symmetricKey": {
                        "connectionString": {
                            "value": "Encrypted<<HostName=iothub.azure-devices.net;DeviceId=iotDevice;SharedAccessKey=2C750FscEas3JmQ8Bnui5yQWZPyml0/UiRt1bQwd8=>>",
                            "encryptionCertThumbprint": "348586569999244",
                            "encryptionAlgorithm": "AES256"
                        }
                    }
                }
            },
            "ioTEdgeDeviceDetails": {
                "deviceId": "iotEdge",
                "ioTHostHub": "iothub.azure-devices.net",
                "ioTHostHubId": "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/Microsoft.Devices/IotHubs/testrxiothub",
                "authentication": {
                    "symmetricKey": {
                        "connectionString": {
                            "value": "Encrypted<<HostName=iothub.azure-devices.net;DeviceId=iotEdge;SharedAccessKey=2C750FscEas3JmQ8Bnui5yQWZPyml0/UiRt1bQwd8=>>",
                            "encryptionCertThumbprint": "1245475856069999244",
                            "encryptionAlgorithm": "AES256"
                        }
                    }
                }
            },
            "shareMappings": [],
            "roleStatus": "Enabled"
        }
    }
    

Den kommande HTTP-förfråganThe upcoming HTTP request

  • API-anrop för Kubernetes-rollen görs i följande URI:The API calls for the Kubernetes role are made at the following URI:

    'https://management.azure.com/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/KubernetesRole1?api-version=2020-12-01''https://management.azure.com/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/KubernetesRole1?api-version=2020-12-01'

    Begär ande texten kommer att se ut så här:The request body will look like this:

    {
        "kind": "Kubernetes",
        "properties": {
            "hostPlatform": "Linux",
            "kubernetesClusterInfo": {
                "version": "v1.17.3"
            },
            "kubernetesRoleResources": {
                "storage": {
                    "endpoints": []
                },
                "compute": {
                    "vmProfile": "DS1_v2"
                }
            }
        }
    }
    
  • API-anrop för IoT Edge-tillägget görs vid följande URI:The API calls for the IoT Edge add-on are made at the following URI:

    'https://management.azure.com/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/KubernetesRole1/addons/iotaddon?api-version=2020-12-01''https://management.azure.com/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/KubernetesRole1/addons/iotaddon?api-version=2020-12-01'

    Begär ande texten kommer att se ut så här:The request body will look like this:

    {
        "kind": "IoT",
        "properties": {
            "ioTDeviceDetails": {
                "deviceId": "iotdevice",
                "ioTHostHub": "iothub.azure-devices.net",
                "ioTHostHubId": "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/Microsoft.Devices/IotHubs/testrxiothub",
                "authentication": {
                    "symmetricKey": {
                        "connectionString": {
                            "value": "Encrypted<<HostName=iothub.azure-devices.net;DeviceId=iotDevice;SharedAccessKey=2C750FscEas3JmQ8Bnui5yQWZPyml0/UiRt1bQwd8=>>",
                            "encryptionCertThumbprint": "348586569999244",
                            "encryptionAlgorithm": "AES256"
                        }
                    }
                }
            },
            "ioTEdgeDeviceDetails": {
                "deviceId": "iotEdge",
                "ioTHostHub": "iothub.azure-devices.net",
                "ioTHostHubId": "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/Microsoft.Devices/IotHubs/testrxiothub",
                "authentication": {
                    "symmetricKey": {
                        "connectionString": {
                            "value": "Encrypted<<HostName=iothub.azure-devices.net;DeviceId=iotEdge;SharedAccessKey=2C750FscEas3JmQ8Bnui5yQWZPyml0/UiRt1bQwd8=>>",
                            "encryptionCertThumbprint": "1245475856069999244",
                            "encryptionAlgorithm": "AES256"
                        }
                    }
                }
            }
        }
    }
    

För GET-metodenFor the GET method

Aktuellt HTTP-svarThe current HTTP response

  • API-anropen görs vid följande URI:The API calls are made at the following URI:

    'https://management.azure.com/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/IoTRole1?api-version=2019-08-01''https://management.azure.com/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/IoTRole1?api-version=2019-08-01'

  • Svars texten ser ut så här:The response body looks like this:

        "kind": "IOT",
        "properties": {
            "hostPlatform": "Linux",
            "ioTDeviceDetails": {
                "deviceId": "iotdevice",
                "ioTHostHub": "iothub.azure-devices.net",
                "ioTHostHubId": "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/Microsoft.Devices/IotHubs/testrxiothub",
                "authentication": {
                    "symmetricKey": {}
                }
            },
            "ioTEdgeDeviceDetails": {
                "deviceId": "iotEdge",
                "ioTHostHub": "iothub.azure-devices.net",
                "ioTHostHubId": "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/Microsoft.Devices/IotHubs/testrxiothub",
                "authentication": {
                    "symmetricKey": {}
                }
            },
            "shareMappings": [],
            "roleStatus": "Enabled"
        },
        "id": "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/IoTRole1",
        "name": "IoTRole1",
        "type": "dataBoxEdgeDevices/roles"
    }    
    

Det kommande HTTP-svaretThe upcoming HTTP response

  • API-anropen görs vid följande URI:The API calls are made at the following URI:

    'https://management.azure.com/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/KubernetesRole1/addons/iotaddon?api-version=2020-12-01''https://management.azure.com/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/KubernetesRole1/addons/iotaddon?api-version=2020-12-01'

  • Svars texten ser ut så här:The response body looks like this:

    {
        "kind": "IoT",
        "properties": {
            "provisioningState": "Creating",
            "ioTDeviceDetails": {
                "deviceId": "iotdevice",
                "ioTHostHub": "iothub.azure-devices.net",
                "ioTHostHubId": "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/Microsoft.Devices/IotHubs/testrxiothub",
                "authentication": {
                    "symmetricKey": {}
                }
            },
            "ioTEdgeDeviceDetails": {
                "deviceId": "iotEdge",
                "ioTHostHub": "iothub.azure-devices.net",
                "ioTHostHubId": "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/Microsoft.Devices/IotHubs/testrxiothub",
                "authentication": {
                    "symmetricKey": {}
                }
            },
            "version": "0.1.0-beta10"
        },
        "id": "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/res1/roles/kubernetesRole/addons/iotName",
        "name": " iotName",
        "type": "Microsoft.DataBoxEdge/dataBoxEdgeDevices/roles/addon",
    }
    

För metoden DELETEFor the DELETE method

Aktuella API-anropThe current API calls

API-anropen görs vid följande URI:The API calls are made at the following URI:

'https://management.azure.com/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/IoTRole1?api-version=2019-08-01''https://management.azure.com/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/IoTRole1?api-version=2019-08-01'

Kommande API-anropThe upcoming API calls

API-anropen görs vid följande URI:The API calls are made at the following URI:

'https://management.azure.com/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/KubernetesRole1/addons/iotaddon?api-version=2020-12-01''https://management.azure.com/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/KubernetesRole1/addons/iotaddon?api-version=2020-12-01'

SDK-användningSDK usage

Om du använder SDK: n, efter att du har installerat uppdatering januari 2021, måste du ändra det sätt som du ställer in IoT Edge rollen, som du ser i följande exempel.If you're using the SDK, after you've installed the January 2021 update, you'll need to change the way you set up the IoT Edge role, as shown in the following sample. Sedan hämtar och installerar du det kommande NuGet-paketet för att gå vidare till den nya SDK: n, som du ser här.You'll then download and install the upcoming NuGet package to move to the new SDK, as shown here.

Aktuellt SDK-exempelThe current SDK sample

var iotRoleStatus = "Enabled";
var iotHostPlatform = "Linux";
var id = $@"/subscriptions/546ec571-2d7f-426f-9cd8-0d695fa7edba/resourceGroups/resourceGroup/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/iotrole"; 
var name = "iotrole";
var type = "Microsoft.DataBoxEdge/dataBoxEdgeDevices/role";
var iotRoleName = "iotrole";
var ioTDeviceDetails = new IoTDeviceInfo(...);
var ioTEdgeDeviceDetails = new IoTDeviceInfo(...);
var ioTEdgeAgentInfo = new IoTEdgeAgentInfo(...);
var shareMappings = new List<MountPointMap>(...);

var role = new IoTRole(roleStatus, 
    hostPlatform, 
    shareMappings, 
    ioTDeviceDetails, 
    ioTEdgeDeviceDetails, 
    ioTEdgeAgentInfo, 
    id, 
    name, 
    type);

DataBoxEdgeManagementClient.Roles.CreateOrUpdate(deviceName, iotRoleName, role, resourceGroup);

Det nya SDK-exempletThe new SDK sample

var k8sRoleStatus = "Enabled";
var k8sHostPlatform = "Linux";
var k8sId = $@"/subscriptions/546ec571-2d7f-426f-9cd8-0d695fa7edba/resourceGroups/resourceGroup/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/KubernetesRole"; 
var k8sRoleName = "KubernetesRole";
var k8sClusterVersion = "v1.17.3"; //Final values will be updated here around January 2021
var k8sVmProfile = "DS1_v2"; //Final values will be updated here around January 2021
var type = "Microsoft.DataBoxEdge/dataBoxEdgeDevices/role";
var k8sRole = new KubernetesRole(
    roleStatus,
    hostPlatform,
    shareMappings,
    k8sClusterVersion,
    k8sVmProfile,
    k8sId,
    k8sRoleName,
    type
);
DataBoxEdgeManagementClient.Roles.CreateOrUpdate(deviceName, k8sRoleName, k8sRole, resourceGroup); //Final usage will be updated here around January 2021

var ioTId = $@"/subscriptions/546ec571-2d7f-426f-9cd8-0d695fa7edba/resourceGroups/resourceGroup/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/KubernetesRole/addons/iotaddon";
var ioTAddonName = "iotaddon";
var ioTAddonType = "Microsoft.DataBoxEdge/dataBoxEdgeDevices/roles/addons";
var addon = new IoTAddon(
    ioTDeviceDetails, 
    ioTEdgeDeviceDetails, 
    ioTEdgeAgentInfo, 
    ioTId, 
    ioTAddonName, 
    ioTAddonType);
DataBoxEdgeManagementClient.AddOns.CreateOrUpdate(deviceName, k8sRoleName, addonName, addon, resourceGroup); //Final usage will be updated here around January 2021

Cmdlet-användningCmdlet usage

Om du för närvarande använder Get-AzStackEdgeRole New-AzStackEdgeRole Set-AzStackEdgeRole cmdleten,, eller Remove-AzStackEdgeRole , måste du vänta på den nya version som är planerad för versionen från februari 2021.If you're currently using the Get-AzStackEdgeRole, New-AzStackEdgeRole, Set-AzStackEdgeRole, or Remove-AzStackEdgeRole cmdlet, you'll need to wait for the new version that's planned for the February 2021 release.

Vanliga frågor och svarFrequently asked questions

Jag använder Azure Stack Edge Pro-FPGA. Påverkar uppdateringen i januari 2021 FPGA-modellen?I'm using Azure Stack Edge Pro - FPGA. Does the January 2021 update affect the FPGA model?

Nej.No. Uppdateringen i januari 2021 gäller endast Azure Stack Edge Pro-FPGA, Azure Stack Edge Pro R och Azure Stack Edge Mini R-enheter.The January 2021 update applies only to Azure Stack Edge Pro - FPGA, Azure Stack Edge Pro R, and Azure Stack Edge Mini R devices. Azure Stack Edge Pro-FPGA påverkas inte av den här uppdateringen och kräver inte några ändringar i IoT Edge roll hantering.Azure Stack Edge Pro - FPGA isn't affected by this update and doesn't require any changes to IoT Edge role management.

Kommer någon av de befintliga tjänsterna påverkas när jag uppdaterar Azure Stack Edge Pro-GPU till den nya enhets program varan i januari 2021?After I update Azure Stack Edge Pro - GPU to the new device software in January 2021, are any of the existing services affected?

Nej.No. Dina konfigurerade tjänster påverkas inte när du har installerat enhets uppdateringen januari 2021.Your configured services won't be affected after you install the January 2021 device update.

Vilka är de övergripande ändringarna i IoT Edge hanterings-API, SDK eller cmdlet?What are the high-level changes to the IoT Edge management API, SDK, or cmdlet?

IoT Edge är ett tillägg under Kubernetes-rollen, vilket innebär att du först måste se till att Kubernetes har kon figurer ATS och sedan utföra IoT Edge konfigurationen.IoT Edge is an add-on under the Kubernetes role, which implies that you'll first need to ensure that Kubernetes is configured and then perform the IoT Edge configuration.

Nästa stegNext steps