Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command 'az timeseriesinsights'= 'CommandNotFoundError: 'timeseriesinsights' is misspelled or not recognized by the system.' #69

Open
ksaye opened this issue Mar 22, 2021 · 3 comments

Comments

@ksaye
Copy link

ksaye commented Mar 22, 2021

On page: https://docs.microsoft.com/en-us/learn/modules/develop-with-azure-digital-twins/route-output-from-azure-digital-twins-to-downstream-services/6-exercise-visualize-data-time-series-insights

It has you run the command

$storage="adtholtsitorage"+(get-random -maximum 10000)
$tsiname=$random+"tsienv"
az storage account create -g $rgname -n $storage --https-only -l $location
$key=$(az storage account keys list -g $rgname -n $storage --query [0].value --output tsv)
az timeseriesinsights environment longterm create -g $rgname -n $tsiname --location $location --sku-name L1 --sku-capacity 1 --data-retention 7 --time-series-id-properties '$dtId' --storage-account-name $storage --storage-management-key $key -l $location

but az timeseriesinsights does not seem to work.

@logcorner
Copy link

+1

@howardginsburg
Copy link

I updated the scripts needed to build out the TSI instance and plumbing. I don't have permissions to do a pull request, so here it is.

Create a Time Series Insights (TSI) environment

  1. The commands below will create a storage account (needed by TSI) and provision the TSI environment

    $storage="adtholtsitorage"+(get-random -maximum 10000)
    $tsiname=$random+"tsienv"
    az storage account create -g $rgname -n $storage --https-only -l $location
    $key=$(az storage account keys list -g $rgname -n $storage --query [0].value --output tsv)
    az tsi environment gen2 create --name '$tsiname' --location $location --resource-group $rgname --sku name="L1" capacity=1 --time-series-id-properties name='$dtId' type=String --warm-store-configuration data-retention=P7D --storage-configuration account-name=$storage management-key=$key
    
  2. After the TSI environment is provisioned, we need to setup an event source. We will use the Event Hub that receives the processed Twin Change events

    $es_resource_id=$(az eventhubs eventhub show -n tsi-event-hub -g $rgname --namespace $ehnamespace --query id -o tsv)
    $shared_access_key=$(az eventhubs namespace authorization-rule keys list -g $rgname --namespace-name $ehnamespace -n RootManageSharedAccessKey --query primaryKey --output tsv)
    az tsi event-source eventhub create --resource-group $rgname --name 'tsieh' --environment-name $tsiname --event-hub-name 'tsi-event-hub' --key-name RootManageSharedAccessKey --shared-access-key $shared_access_key --service-bus-namespace $ehnamespace --event-source-resource-id $es_resource_id --consumer-group-name '$Default' --location $location
    
  3. Finally, configure permissions to access the data in the TSI environment.

    $id=$(az ad user show --id $username --query objectId -o tsv)
    az tsi access-policy create -g $rgname --environment-name $tsiname -n access1 --principal-object-id $id  --description "some description" --roles Contributor Reader
    

@cranberry13
Copy link

The correct time series commands are:

az eventhubs eventhub create --name "tsi-event-hub" --resource-group $rgname --namespace-name $ehnamespace

AND

az eventhubs eventhub authorization-rule create --rights Listen Send --resource-group $rgname --namespace-name $ehnamespace --eventhub-name "tsi-event-hub" --name

AND

az tsi environment gen2 create --name $t siname --location $location --resource-group $rgname --sku name="L1" capacity=1 --time-series-id-properties name ='$dtId' type=String --warm-store-configuration data-retention=P7D --storage-configuration account-name=$storage management-key=$key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants