https://pulumi.com logo
Title
f

fancy-artist-45287

05/15/2023, 8:53 AM
Pulumi AI keep suggesting I use
azure_native.devices.listIotHubResourceKeys
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const resourceGroupName = "example-rg";
const iotHubName = "example-iothub";

const iotHubKeys = pulumi.all([resourceGroupName, iotHubName]).apply(([rgName, iotName]) =>
    azure_native.devices.listIotHubResourceKeys({
        resourceGroupName: rgName,
        resourceName: iotName,
    }),
);

iotHubKeys.apply((keys) => {
    for (const key of keys.value) {
        console.log(`KeyName: ${key.keyName}, Rights: ${key.rights}`);
    }
});

export const iotHubResourceKeys = iotHubKeys;
but I get the following exception: unrecognized data function (Invoke): azure-native:devices:listIotHubResourceKeys
Diagnostics:
  pulumi:pulumi:Stack (DDSConnected-dev):
    error: Error: invocation of azure-native:devices:listIotHubResourceKeys returned an error: unrecognized data function (Invoke): azure-native:devices:listIotHubResourceKeys
        at Object.callback (C:\dev\DDS\DDSConnected\Infrastructure\node_modules\@pulumi\runtime\invoke.ts:172:37)
        at Object.onReceiveStatus (C:\dev\DDS\DDSConnected\Infrastructure\node_modules\@grpc\grpc-js\src\client.ts:356:26)
        at Object.onReceiveStatus (C:\dev\DDS\DDSConnected\Infrastructure\node_modules\@grpc\grpc-js\src\client-interceptors.ts:455:34)
        at Object.onReceiveStatus (C:\dev\DDS\DDSConnected\Infrastructure\node_modules\@grpc\grpc-js\src\client-interceptors.ts:417:48)
        at C:\dev\DDS\DDSConnected\Infrastructure\node_modules\@grpc\grpc-js\src\resolving-call.ts:111:24
        at processTicksAndRejections (node:internal/process/task_queues:78:11)
The same goes for
azure-native.devices.listIotHubResourceKeysForKeyName