https://pulumi.com logo
Title
f

full-winter-70537

03/11/2021, 6:56 AM
Hi, I am trying to create a service bus and grab the connection string so I can consume it elsewhere. I'm trying to use the
ListTopicKeys.InvokeAsync()
passing in:
new ListTopicKeysArgs
                        {
                            NamespaceName = args.ServiceBusName,
                            AuthorizationRuleName = "RootManageSharedAccessKey",
                            ResourceGroupName = args.ResourceGroupName,
                            TopicName = "mytopic"
                        })
But I get the error:
Status=404 Code="NotFound" Message="The requested resource RootManageSharedAccessKey does not exist.
It's clearly available on the service bus under Shared Access Policies (see below). I have placed the InvokeAsync() call into a
ComponentResource
and made it DependOn the service bus, so it should exist by the time it is called. Is my understanding of how ListTopicKeys works correct? Any idea how to retrieve the connection string from the service bus?
t

tall-librarian-49374

03/11/2021, 7:37 AM
Is that a topic rule, not a namespace one?
f

full-winter-70537

03/11/2021, 7:43 AM
Hmm, I see you created the rules yourself:
const sendEventSourceKey = new eventhub.EventHubAuthorizationRule("send", {
    resourceGroupName: resourceGroupName,
    namespaceName: eventHubNamespace.name,
    eventHubName: eventHub.name,
    authorizationRuleName: "send",
    rights: ["send"],
}, { parent: eventHub });
The one I'm trying to access is the default namespace SAS Policy. Here what I see from the ARM template:
{
    "type": "Microsoft.ServiceBus/namespaces/AuthorizationRules",
    "apiVersion": "2017-04-01",
    "name": "[concat(parameters('namespaces_mynamespace_name'), '/RootManageSharedAccessKey')]",
    "location": "Australia East",
    "dependsOn": [
        "[resourceId('Microsoft.ServiceBus/namespaces', parameters('namespaces_mynamespace_name'))]"
    ],
    "properties": {
        "rights": [
            "Listen",
            "Manage",
            "Send"
        ]
    }
},
oh, I'm searching for
Topic
key. Duh. My bad, thanks
You guys don't sell ducks with the Pulumi logo on it by any chance? 🙂 🦆
t

tall-librarian-49374

03/11/2021, 8:30 AM
😁