Code Monkey home page Code Monkey logo

vscode-azure-iot-tools's Introduction

Azure IoT Tools for Visual Studio Code

End of Life / Support Notice

The 'Azure IoT Tools' collection is being retired after November 2022, and contains three extension packages that can still be downloaded individually:

The repository has been archived and is read-only. Currently installed extensions will not be affected, but no new versions will be made available in the marketplace.

Furthermore, after November 2022 users will no longer be able to install this extension collection from the marketplace.

Microsoft Azure IoT support for Visual Studio Code is provided through a rich set of extensions that make it easy to discover and interact with Azure IoT Hub that power your IoT Edge and device applications.

If you do not have an Azure subscription, sign up today for a free account. You'll get 12 months of popular free services, $200 in Azure Credits to try out any combination of Azure services, and access to free services such as Azure IoT Hub, Azure IoT Edge, etc.

What's New (v0.3.0)

Azure IoT Hub Toolkit

Added

  • Update infrastructure to support localization (Thanks @matsujirushi!)
  • Localization for Japanese language (Thanks @matsujirushi!)
  • Expose API to read IoT Hub connection string

Changed

  • Use OS credential store to store IoT Hub connection string (To be more secure, we will no longer use azure-iot-toolkit.iotHubConnectionString in settings.json to store IoT Hub connection string)

Azure IoT Edge

Changed

  • ASA error message improvement
  • Rename 'tempSensor' to 'SimulatedTemperatureSensor'
  • Read connection string from API of Azure IoT Hub Toolkit

Azure IoT Device Workbench

Added

  • We are excited to announce the preview of a new feature enabled in Azure IoT Device Workbench extension in VS Code to simplify the device cross-compiling toolchain acquisition effort for device developers working on embedded Linux devices (e.g. Debian, Ubuntu, Yocto Linux…) with Azure IoT by encapsulating the compilers, device SDK and essential libraries in Containers. All you need is to install or upgrade the IoT Device Workbench and get started developing within the container, just like today you are using a local environment.

Fixed

  • Fix the issue of "MXCHIP AZ3166 serial port button not work" #661 which started after update to VS Code 1.36.0.

Special thanks to br1pro and Remco Ploeg, thanks for your feedbacks.

Azure IoT Services

Installation

By installing this extension you will install all of the extensions listed above. Some of these extensions will have a dependency on the Azure Account extension to provide a single Azure login and subscription filtering experience.

You can easily uninstall individual extensions if you are not interested in using them, without affecting other extensions provided by this pack. You can uninstall all of the extensions by uninstalling the Azure Tools extension.

Setup Azure IoT Hub for Extension

After successfully installing this extension, you can follow the steps below to setup your IoT Hub. you can use IoT Hub connection string or sign in to Azure to select IoT Hub:

Setup Azure IoT Hub through Connection String

You can use IoT Hub connection string to setup your IoT Hub

  1. In Explorer of VS Code, click "Azure IoT Hub Devices" in the bottom left corner.

  2. Click "Set IoT Hub Connection String" in context menu.

  3. An input box will pop up, then enter your IoT Hub Connection String (It is one-time configuration, and please make sure it is IoT Hub Connection String and not Device Connection String. The format is HostName=<my-hub>.azure-devices.net;SharedAccessKeyName=<my-policy>;SharedAccessKey=<my-policy-key>).

  4. The device list will be shown.

  5. Then you can manage your devices and interact with Azure IoT Hub through context menu.

NOTE: You can also go to File > Preferences > Settings (Code > Preferences > Settings), and update the configuration of azure-iot-toolkit.iotHubConnectionString to change your IoT Hub Connection String.

Setup IoT Hub Connection String

Setup Azure IoT Hub through Sign in to Azure

Instead of copying and pasting to set IoT Hub Connection String, you can sign in to Azure and select IoT Hub from your Azure Subscription.

  1. In Explorer of VS Code, click "Azure IoT Hub Devices" in the bottom left corner.

  2. Click "Select IoT Hub" in context menu.

  3. If you have not signed in to Azure, a pop-up will show to let you sign in to Azure.

  4. After signing in, your Azure Subscription list will be shown, then select an Azure Subscription.

  5. Your IoT Hub list will be shown, then select an IoT Hub.

  6. The device list will be shown.

Select IoT Hub

Command Palette

You can access almost all Azure IoT Services provided by these extensions through the Command Palette. Simply press F1, then type in IoT to find available commands.

Select IoT Hub

Contributing

Got a suggestion for the Azure IoT Tools extension? Submit a new issue and a PR with an updated package.json and README.md and we'll take a look!

Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

License

MIT

vscode-azure-iot-tools's People

Contributors

c-ryan-k avatar dependabot[bot] avatar formulahendry avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar montgomp avatar msftgits avatar oxygen-dioxide avatar sldragon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-azure-iot-tools's Issues

3 welcome pages can automatically show when first install

Step:

  1. Create new windows VM and login in it
  2. Install VS Code and Azure IoT Tools extension 0.0.3
  3. Check 3 welcome pages can automatically show
    and an error message will pop up first then tips "install the extension vsciot-vscode.azure-iot-tools is completed"

image

'New IOT Edge Solution' cannot build/run in simulator

Hello.

I can across a problem that I am unable to explain. When I try and "Build and Run IoT Solution in Simulator", it fails.

It's fairly repeatible:

  • Command: Azure IoT Edge: New IoT Edge Solution
  • select directory
  • Solution name: EdgeSolution
  • select 'C Module'
  • Module Name: 'CModule'

Wait for everything to get built.

  • Command: Azure IoT Edge: Set Default Target Platform for Edge Solution
  • select 'arm32v7'.
  • right click: 'deployment.debug.template.json' -> Build and Run IoT Edge Solution in Simulator

I get the following error:

PS C:\Users<user>\Documents\VSCode\EdgeSolution> & "C:\Users<user>.vscode\extensions\vsciot-vscode.azure-iot-edge-1.21.0\iotedgehubdev\0.13.0\iotedgehubdev" start -d "c:\Users<user>\Documents\VSCode\EdgeSolution\config\deployment.debug.arm32v7.json" -v
Network azure-iot-edge-dev is external, skipping
Pulling edgeHubDev ... done
ERROR: no such image: ${MODULES.SampleModule.debug}: invalid reference format: repository name must be lowercase
ERROR: Error while executing command: docker-compose -f C:\ProgramData\iotedgehubdev\data\data\docker-compose.yml up. Command '['docker-compose', '-f', 'C:\ProgramData\iotedgehubdev\data\data\docker-compose.yml', 'up']' returned non-zero exit status 1.
PS C:\Users\wirunc\Documents\VSCode\EdgeSolution>

If the complication is that it's not possible to use the arm32v7 as a target platform, there should be a better error indication.

Missing devices on VS code

Hello,
I'm using the extension on VS code and I'm missing some IOT devices.

  • They do exist on Azure portal, but not in the extension list.
  • I'm referring to the IOT devices pane under "Explorer" tab.
  • Most of my devices appear correctly.
  • When querying the list of devices using the toolkit, I am getting the same list that exist on Explorer pane, but it is showing only a 1000 devices, and we have more than that. Could that be the issue?
  • I've reinstalled the extension and even tried downgrading.

Name: Azure IoT Hub Toolkit
Id: vsciot-vscode.azure-iot-toolkit
Description: Interact with Azure IoT Hub, IoT Device Management, IoT Edge Management, IoT Hub Device Simulation, IoT Hub Code Generation and IoT Hub Device Provisioning Service (DPS)
Version: 2.14.0
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-toolkit

C2D Monitoring is blocking for MQTT devices

Using the tool "Start Receiving C2D Messages" now takes over the active session for that DeviceID and forces an error 400027-connectionforcefullyclosedonnewconnection on the device with an existing MQTT session. This means that I can no longer monitor bidirectional messaging in real time.

I have been able to replicate on multiple devices and on freshly created DeviceIDs.

Logs on the IoT Hub indicate a second IP (aside from my remote device) attempting to establish a session repeatedly. It is from the IP block 173.230.231.0/24.

Cannot Monitor Builtin Endpoints due to missing eventHubName

OS: Windows 10

[IoTHubMonitor] TypeError: Either provide "eventHubName" or the "connectionString": , must contain "EntityPath=".

I have this problem on my laptop, not my desktop. I have tried uninstalling VSCode and Deleting the corresponding folders in USERPROFILE and APPDATA. Everytime I resintall VSCode with all of this cleared (and have tried removing all extensions before uninstall) it comes back with my azure credentials already set from some other system environment variable I think I'm missing. As far as I knew eventHubNames were never required for IoTHubs, and considering I have several other systems working I am guessing there is something that is being left behind breaking it.

"Azure Account" was not uninstalled together with Azure IoT Tools

OS: windows10
Azure IoT tools :0.0.3-rc
repro on
1.install Azure IoT tools
2. After installing successfully, there are 5 extensions installed.
"Azure Account"
“Azure IoT Tools”,
“Azure IoT Toolkit”,
“Azure IoT Device Workbench”
“Azure IoT Edge”

  1. Uninstall Azure IoT Tools
  2. After uninstalling successfully, only 4 extensions uninstalled, "Azure Account" was not uninstalled together. is it expect.
    image

Azure IoT device catalog - how to get devices?

Hello,
Pardon me for posting this here, but it is a real barrier for me getting started. I'm unable to purchase any Azure certified IoT devices from the Azure device catalog, some of which are shown in the Build Session Here. It seems that for each product, when you click 'Get Device' you're directed to the manufacturer site, which is either in a different language, or to a general contact page with no specifics on how to get the device. For example, how do you purchase the Askey Dashcam? I really want to get started prototyping a fleet tracking solution. Thanks

IoT Edge template: deployment manifest file has invalid schema version 1.2

When creating a new IoT Edge Solution using the C# template (but also peers using the Python one), the generated deployment.template.json file has an invalid schema for the edge agent.

As described in this document, the new version as of IoT Edge 1.0.10 is 1.1, but the template uses 1.2: https://docs.microsoft.com/en-us/azure/iot-edge/module-composition?view=iotedge-2020-11#configure-modules
Deployment seems to work fine, but as soon as you sign into the Azure Portal, the IoT Edge device page shows an error message.

When I change the schema version to 1.1 as below, the validation pattern shows squiggly line which seems incorrect:

image

it is not possible to follow the instruction, there is no "Azure IOT Hub Devices" but only "Azure: IOT HUB Device Provisioning service"

Issue Type: Bug

In installed "Azure IoT Tools"
I clicked the Azure icon, logged in into Azure and I am connected.
But what I see is not what you show in the animated video.
I have no "Azure IoT Hub Devices" in the list but:
"Azure: IOT HUB Device Provisioning service"
And below my "Nutzungsbasierte Bezahlung" and nothing below this.
When I click on the "+" I am asked to enter something which looks like SQL Server, but not like IOT.

How I can the "Azure IOT Hub Devices" in the explorer as in the documentation?

Extension version: 0.3.0
VS Code version: Code 1.39.2 (6ab598523be7a800d7f3eb4d92d7ab9a66069390, 2019-10-15T15:35:18.241Z)
OS version: Windows_NT x64 10.0.17763

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz (4 x 2904)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.87GB (11.34GB free)
Process Argv
Screen Reader no
VM 0%

Support virtual workspaces

👋 Hi there, Martin here, from the VS Code team.

Recently we've announced the Remote Repository feature that lets you browse and edit files and folders directly on GitHub.

Open Remote Repository... opens VSCode on a folder or workspace located on a virtual file system. We call this a virtual workspace. We observed that not all extension support this well, either because they can not, or they haven't thought about it.

It would be fantastic if you could test whether your extension can handle virtual workspaces:

Check out the Virtual Workspaces Extension Author Guide on how to do that.

When done, set the new virtualWorkspaces capability in your 'package.json'.

{
  "capabilities": {
    "virtualWorkspaces": true | false
  }
}
  • Use "virtualWorkspaces": true if your extension is prepared for virtual workspaces
  • Use "virtualWorkspaces": false if your extension should be disabled when a virtual workspace is opened

For questions and comments please use the Virtual Workspaces Tracking Issue.

Thanks for the support and the great work! ❤️

Adopt VS Code's 'asWebviewUri' API

Hi, I maintain VS Code's Webview API

Issue

Our telemetry suggests that your extension uses webviews and may be loading resources in these webviews using hardcoded vscode-resource: URIs. These URIs have some important limitations and don't work properly when VS Code is run in a browser. We are also making changes in the desktop version of VS Code that may cause these URIs to not work properly in future versions of VS Code.

While we are making our best effort to continue support existing webview extensions that use vscode-resource: URIs on desktop versions of VS Code, we will not able to fully support all uses cases.

Fix

To ensure that your extension continues to work in as many environments as possible—including on web and remotely—please:

These APIs shipped around 2 years ago so they should be available in all modern versions of VS Code. You can find additional information about the issue here: microsoft/vscode#97962

Let me know if you have any questions about this change

“Azure IoT Tools” extension not display in VSCode menu after install.

OS: windows10
Azure IoT tools :0.0.3-rc

step:
1.open VS Code , here only Azure Account has already installed
1.install Azure IoT tools from VSIX
2.After installing successfully, check “Azure IoT Tools”, “Azure IoT Toolkit”, “Azure IoT Device Workbench” and “Azure IoT Edge” are not display in VS Code
and there is no message to reminder user to reload VS Code

image

D2C simulator - option to set content type and encoding

For customers who are testing IoT Hub routing in the cloud, either routing on message body, or routing to blob storage, it's required that they set the content type and the content encoding on the message (to 'application/json' and 'utf-8' respectively). In the VS Code IoT extension, under the "Send D2C message to IoT Hub" command, it would be nice to provide a way to set those values.

Azure IoT Hub Extension 2.16.3 Errors on Start Monitoring Built-in Endpoint

I upgraded to the latest version of the the Azure IoT Tools extension including IoT Hub Extension 2.16.3 and when I try to start monitoring the event stream, I get the message:

[IoTHubMonitor] TypeError: Either provide "eventHubName" or the "connectionString": "HostName=.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=", must contain "EntityPath=".

I added the EntityPath= to the connection string and then I get:

[IoTHubMonitor] TypeError: Missing Endpoint in Connection String.

Rolling back to 2.16.2 fixes the issue.

This has been reproed on two different machines / iot hubs

Error: An error occurred setting up the container.

Testing the New IoT Edge Solution, really, I just want the base code for an edge module.

Standard and updated versions.
image

[2022-06-26T15:57:11.342Z] Stop (321 ms): Run in container: /bin/sh
[2022-06-26T15:57:11.343Z] Shell server terminated (code: 1, signal: null)
[2022-06-26T15:57:11.343Z] Error response from daemon: Container 13829cc1782be765c99a20645a1952ce10dab6bcdf243996d3cf56fdd5992358 is not running
[2022-06-26T15:57:11.343Z] Start: Run in container: cat /etc/passwd
[2022-06-26T15:57:11.343Z] Stdin closed!
[2022-06-26T15:57:11.344Z] Error: An error occurred setting up the container.
[2022-06-26T15:57:11.344Z]     at NR (c:\Users\william.harding\.vscode\extensions\ms-vscode-remote.remote-containers-0.238.2\dist\spec-node\devContainersSpecCLI.js:239:1572)
[2022-06-26T15:57:11.344Z]     at Jy (c:\Users\william.harding\.vscode\extensions\ms-vscode-remote.remote-containers-0.238.2\dist\spec-node\devContainersSpecCLI.js:239:1510)
[2022-06-26T15:57:11.344Z]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-06-26T15:57:11.344Z]     at async zR (c:\Users\william.harding\.vscode\extensions\ms-vscode-remote.remote-containers-0.238.2\dist\spec-node\devContainersSpecCLI.js:245:2006)
[2022-06-26T15:57:11.344Z]     at async nb (c:\Users\william.harding\.vscode\extensions\ms-vscode-remote.remote-containers-0.238.2\dist\spec-node\devContainersSpecCLI.js:245:3110)
[2022-06-26T15:57:11.344Z]     at async JR (c:\Users\william.harding\.vscode\extensions\ms-vscode-remote.remote-containers-0.238.2\dist\spec-node\devContainersSpecCLI.js:245:13046)
[2022-06-26T15:57:11.344Z]     at async KR (c:\Users\william.harding\.vscode\extensions\ms-vscode-remote.remote-containers-0.238.2\dist\spec-node\devContainersSpecCLI.js:245:12802)
[2022-06-26T15:57:11.351Z] Stop (4236 ms): Run: C:\Users\william.harding\AppData\Local\Programs\Microsoft VS Code\Code.exe c:\Users\william.harding\.vscode\extensions\ms-vscode-remote.remote-containers-0.238.2\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\william.harding\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --workspace-folder c:\Users\william.harding\Documents\repos\personalstack\New folder\modules --workspace-mount-consistency cached --id-label devcontainer.local_folder=c:\Users\william.harding\Documents\repos\personalstack\New folder\modules --log-level debug --log-format json --config c:\Users\william.harding\Documents\repos\personalstack\New folder\modules\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-06-26T15:57:11.351Z] Exit code 1
[2022-06-26T15:57:11.354Z] Command failed: C:\Users\william.harding\AppData\Local\Programs\Microsoft VS Code\Code.exe c:\Users\william.harding\.vscode\extensions\ms-vscode-remote.remote-containers-0.238.2\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\william.harding\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --workspace-folder c:\Users\william.harding\Documents\repos\personalstack\New folder\modules --workspace-mount-consistency cached --id-label devcontainer.local_folder=c:\Users\william.harding\Documents\repos\personalstack\New folder\modules --log-level debug --log-format json --config c:\Users\william.harding\Documents\repos\personalstack\New folder\modules\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-06-26T15:57:11.354Z] Exit code 1

I think there might be an issue with docker file sharing local directories. That's just a hunch because the error is pretty ambiguous.

Any thoughts here as to what I could try?

Support for layered deployment manifests

It would be great to see support for layered deployments.

As per this issue, the generator says that systemModules are missing when trying to generate a manifest using a layered deployment template.

Our current layered deployment structure is as follows and is working great in our CD pipeline, but is unusable with any tooling locally. As a result, we also have a catch all deployment.template.json file that we're using to deploy and test modules locally. If there is guidance on a better approach, it would be appreciated!

Screen Shot 2021-01-08 at 10 14 12 AM

Azure IoT Hub tab not working behind proxy

Hi all,

When I am working on my windows 10 laptop with VS Code and have installed the Extention Azure IoT Tools V0.3.0
When I am working from home (no proxy), the " Azure IoT Hub" window in the Explorer tab shows my IoT Hub and attached devices. However when i am in my corporate network with proxy server it shows the following:

iothub tab not working

Is this a problem of the extension not taking the proxy settings of VS Code? Or do i need to open an extra port? What is wrong here? Otherwise do you have any suggestions how i can fix this?

Kind Regards,

Extension won't generate deployment manifests if the template contains a comment

When I right click a deployment template that contains comments and select "Generate IoT Edge Deployment Manifest", I see an error message like the one below.

image

There are two problems here:

  1. The error message only contains a position, and not a line/column number making the source of the problem difficult to track down.
  2. The command does not accept templates which contain comments. This makes it difficult to document my deployments.
Reproducing file (deployment.template.json)
{
    "modulesContent": {
      "$edgeAgent": {
        // This is a comment
        "properties.desired": {
          "modules": {},
          "runtime": {
            "settings": {
              "minDockerVersion": "v1.25"
            },
            "type": "docker"
          },
          "schemaVersion": "1.0",
          "systemModules": {
            "edgeAgent": {
              "settings": {
                "image": "mcr.microsoft.com/azureiotedge-agent:1.0"
              },
              "type": "docker"
            },
            "edgeHub": {
              "settings": {
                "image": "mcr.microsoft.com/azureiotedge-hub:1.0"
                }
              },
              "type": "docker",
              "status": "running",
              "restartPolicy": "always"
            }
          }
        }
      },
      "$edgeHub": {
        "properties.desired": {
          "routes": {
            "route": "FROM /messages/* INTO $upstream"
          },
          "schemaVersion": "1.0",
          "storeAndForwardConfiguration": {
            "timeToLiveSecs": 7200
          }
        }
      }
    }
  }

Tokenizer error

Issue Type: Bug

I finally got the IoT-DevKit (AZ3166) to work with the Getting Started (DPS) sample, but I am seeing these 2 errors on the serial monitor, I am especially concerned about the path identified ... it's not on my machine.:
2019-03-16 18:33:17 ERROR: File:C:\Users\v-zuhu\AppData\Local\Arduino15\packages\AZ3166\hardware\stm32f4\1.6.0\cores\arduino\azure-iot-sdk-c\iothub_client\src\iothub_client_core_ll.c Func:IoTHubClientCore_LL_CreateFromConnectionString Line:1380, Tokenizer error
2019-03-16 18:33:17 ERROR: File:C:\Users\v-zuhu\AppData\Local\Arduino15\packages\AZ3166\hardware\stm32f4\1.6.0\cores\arduino\azure-iot-sdk-c\iothub_client\src\iothub_client_core_ll.c Func:IoTHubClientCore_LL_CreateFromConnectionString Line:1491, iotHubSuf

Any recommendations for a work-around?

Extension version: 0.0.2
VS Code version: Code 1.32.3 (a3db5be9b5c6ba46bb7555ec5d60178ecc2eaae4, 2019-03-14T23:43:35.476Z)
OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz (4 x 2808)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 15.93GB (3.34GB free)
Process Argv
Screen Reader no
VM 0%
I see no activity on the IOT-Hub at the Azure portal.

Support Workspace Trust

Hello 👋 I'm from the VS Code team.

Recently, we have been exploring a security feature we refer to as Workspace Trust. This feature is intended to centralize and unify a security conscious decision required by a variety of VS Code features. With workspace trust, the user will be able to declare whether or not they trust the folder that is opened in VS Code before these features are executed.

Why you should care

Your extension is incredibly popular with VS Code users! We want to make sure that those users have a delightful experience with workspace trust and that includes extension authors deciding how much of their extension is supported in an untrusted workspace.

Workspace Trust experience

You can enable the feature with the following setting security.workspace.trust.enabled. Once enabled, you will see the following dialog when opening folders in VS Code.

Workspace Trust Startup Dialog

This dialog is important for allowing the user to make a decision early and understand the impact of their decision. Once you understand the feature, you may want to customize when to display the dialog using the setting security.workspace.trust.startupPrompt.

You can follow the development of Workspace Trust and provide feedback in issue #106488.

Workspace trust API

First off, all of what I am about to say can be found in issue #120251. That issue will include discussion of the feature and any updates to the feature.

The Workspace Trust extension API is now in stable. This allowed us to release the first cut of our guide for onboarding your extension to Workspace Trust. The API is small, so here is a quick look.

You can declare your extension to provide complete, partial or no support in untrusted workspaces using the untrustedWorkspaces capability in package.json.

The following example declares that the extension is supported completely in untrusted workspaces. In this case, the extension is enabled in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": true
  }
}

The next example declares that the extension is not supported in untrusted workspaces. In this case, the extension is disabled in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": false
  }
}

The third option is to declared limited support. There are three tools provided to you when you select the limited option.

First, if you have a setting that can be configured in the workspace but requires the workspace to be trusted in order to apply the workspace value, then you can include the setting using restrictedConfigurations array property in untrustedWorkspaces object. Doing so, VS Code will ignore the workspace value of these restricted settings when your extension reads these settings values using the VS Code Workspace Configuration API.

The following example declares the settings that are restricted in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": "limited",
    "restrictedConfigurations": [
      "markdown.styles"
    ]
  }
}

Next, you can also check and listen if the current workspace is trusted or not programmatically using the following API:

export namespace workspace {
  /**
   * When true, the user has explicitly trusted the contents of the workspace.
   */
  export const isTrusted: boolean;
  /**
   * Event that fires when the current workspace has been trusted.
   */
  export const onDidGrantWorkspaceTrust: Event<void>;
}

Lastly, you can hide commands or views declaratively with the isWorkspaceTrusted context key in your when clauses.

A far more detailed guide on how to onboard which will be updated as we receive feedback can be found in issue #120251.

Rollout plan

Workspace Trust will remain disabled for the month of May, but we are planning on enabling this by default in the future. To prepare for that day, we would love for you to try it out and provide feedback.

We'd love your feedback

Since this issue was created in an automated fashion, we won't be monitoring the responses in this issue (our notifications would explode!). Instead we ask you to drop questions, and feedback in issue #120251 as we've mentioned above.

We're excited to see what you do with workspace trust!

Customizing build for private nuget packages

Is it possible to customize the IoT edge tooling's build modules command? Ideally I'd like to be able to pass additional flags such as --secret id=pat,src=../../../IotEdge/.pat so that my Dockerfile can use RUN --mount=type=secret,id=pat,dst=/pat and I can restore a private nuget feed package, similar to https://medium.com/@cwoolum/using-nuget-restore-securely-inside-of-docker-containers-with-caching-2c2f5453905d. This is working via script but it'd be nice to be able to use the built-in commands but in such a way they support reusing module code via nuget packages hosted privately.

Remote Debug fails when using .Net5 or .Net6

Remote Debug fails due to access problem to the moduleuser directory when using docker images for .Net5 or .Net6. This is the error in VSCode:

image

My Dockerfile.amd64.debug is scaffolded using the tooling except I have changed the Runtime and SDK images to .Net5

FROM mcr.microsoft.com/dotnet/runtime:5.0-buster-slim AS base

RUN apt-get update && \
    apt-get install -y --no-install-recommends unzip procps && \
    rm -rf /var/lib/apt/lists/*

RUN useradd -ms /bin/bash moduleuser
USER moduleuser
RUN curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l ~/vsdbg

FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build-env
WORKDIR /app

COPY *.csproj ./
RUN dotnet restore

COPY . ./
RUN dotnet publish -c Debug -o out

FROM base
WORKDIR /app
COPY --from=build-env /app/out ./

ENTRYPOINT ["dotnet", "SampleModule.dll"]

Switching back to .Net Core 3.1 solves the issue.

Edge module Cross compilation issue By using the VS code 1.60.1.

Hi Team,
Am trying to Cross compile the edge module by using the VS code version 1.60.1 which fallen in to comparability issue with following error.

Sending build context to Docker daemon 21.5kB
Step 1/14 : FROM arm32v7/ubuntu:bionic AS base
---> 4fb51db5234a
Step 2/14 : RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common && add-apt-repository -y ppa:aziotsdklinux/ppa-azureiot && apt-get update && apt-get install -y azure-iot-sdk-c-dev && rm -rf /var/lib/apt/lists/*
---> [Warning] The requested image's platform (linux/arm/v7) does not match the detected host platform (linux/amd64) and no specific platform was requested
---> Running in 24b6634392b0
standard_init_linux.go:228: exec user process caused: exec format error

Below are the environment details:
Host machine:
Ubuntu :20.04.
sudo docker info
[sudo] password for ssk:
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Build with BuildKit (Docker Inc., v0.6.1-docker)
scan: Docker Scan (Docker Inc., v0.8.0)

Server:
Containers: 13
Running: 0
Paused: 0
Stopped: 13
Images: 4
Server Version: 20.10.8
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: e25210fe30a0a703442421b0f60afac609f950a3
runc version: v1.0.1-0-g4144b63
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 5.11.0-34-generic
Operating System: Ubuntu 20.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 16
Total Memory: 15.38GiB
Name: ssk-inspiron-7510
ID: HQSB:LAMF:VILT:U3ZG:SWMZ:KCP7:ZDM2:VZYH:2IKV:LDYK:UCWN:NHCH
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

Target platfotm:

Raspberry pi 4 model B.

Note: when i select the platform as amd64 no issue is found.

Tutorial link :

https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-c-module?view=iotedge-2018-06

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.