Azure / CloudShell

Container Image for Azure Cloud Shell (https://azure.microsoft.com/en-us/features/cloud-shell/)
https://shell.azure.com
MIT License
251 stars 102 forks source link

az iot extention not working #51

Closed Teodelas closed 3 years ago

Teodelas commented 3 years ago

Reproduce: az dt model create --models '{ "@id": "dtmi:contosocom:DigitalTwins:Thermostat;1", "@type": "Interface", "@context": "dtmi:dtdl:context;2", "contents": [ { "@type": "Property", "name": "Temperature", "schema": "double" } ]}' -n teoadtdemo

Command results in a loop where the shell reports that 0.10.2 is required, attempts to install, and then reports that it's already installed. Here's the output from the shell. The command requires the extension azure-iot. Do you want to install it now? The command will continue to run after the extension is installed. (Y/n): Y Run 'az config set extension.use_dynamic_install=yes_without_prompt' to allow installing extensions without prompt. Extension 'azure-iot' 0.10.2 is already installed. It will be updated if available. No updates available for 'azure-iot'. Use --debug for more information. The command requires the extension azure-iot. Do you want to install it now? The command will continue to run after the extension is installed. (Y/n): Y Run 'az config set extension.use_dynamic_install=yes_without_prompt' to allow installing extensions without prompt. Extension 'azure-iot' 0.10.2 is already installed. It will be updated if available. No updates available for 'azure-iot'. Use --debug for more information. The command requires the extension azure-iot. Do you want to install it now? The command will continue to run after the extension is installed. (Y/n): Y Run 'az config set extension.use_dynamic_install=yes_without_prompt' to allow installing extensions without prompt. Extension 'azure-iot' 0.10.2 is already installed. It will be updated if available. No updates available for 'azure-iot'. Use --debug for more information.

I've tried removing and adding the az iot extensions with no success.

edyoung commented 3 years ago

I wasn't able to repro this, but I think it's because I'm hitting some other problem first. Here's what I've done:

> az extension add --name azure-iot
> az dt create -n edyoungdt -g edyoung -l westus2
> az dt model create --models '{ "@id": "dtmi:contosocom:DigitalTwins:Thermostat;1", "@type": "Interface", "@context": "dtmi:dtdl:context;2", "contents": [ { "@type": "Property", "name": "Temperature", "schema": "double" } ]}' -n edyoungdt
Command group 'dt' is in preview. It may be changed/removed in a future release.
Current principal access is forbidden. Please validate rbac role assignments.

If you know what the rbac issue is, let me know?

edyoung commented 3 years ago

Actually I then tried

az dt role-assignment create -n edyoungdt --assignee "edyoung@microsoft.com" --role "Azure Digital Twins Owner (Preview)"
az dt model create --models '{ "@id": "dtmi:contosocom:DigitalTwins:Thermostat;1", "@type": "Interface", "@context": "dtmi:dtdl:context;2", "contents": [ { "@type": "Property", "name": "Temperature", "schema": "double" } ]}' -n edyoungdt
Command group 'dt' is in preview. It may be changed/removed in a future release.
[
  {
    "decommissioned": false,
    "description": {},
    "displayName": {},
    "id": "dtmi:contosocom:DigitalTwins:Thermostat;1",
    "uploadTime": "2020-10-11T05:44:16.9230504+00:00"
  }
]

So it actually seems to be working for me. Anything different you can think of that you're doing?

edyoung commented 3 years ago

Closing because I can't reproduce. If you still see an issue and can clarify what it is, feel free to reactivate.