Hi all, new to Pulumi & not that great at Pyth...
# python
h
Hi all, new to Pulumi & not that great at Python. I am trying to build a few things using azure-nextgen provider and I am having trouble with creating a storage account, then retrieving its account key:
Copy code
import pulumi
from pulumi_azure_nextgen.containerinstance import latest as containerinstance
from pulumi_azure_nextgen.resources import latest as resources
from pulumi_azure_nextgen.storage import latest as storage

app_name = "tigstack"

resource_group = resources.ResourceGroup("resourceGroup",
    resource_group_name="rg-syd-dev-{0}".format(app_name),
    location="australiaeast")

account = storage.StorageAccount("storageAccount",
    account_name="grafana",
    resource_group_name=resource_group.name,
    location=resource_group.location,
    sku=storage.SkuArgs(
        name="Standard_LRS"
    ),
    kind="StorageV2")

file_share = storage.FileShare("smbFileShare",
    account_name=account.name,
    enabled_protocols="SMB",
    resource_group_name=resource_group.name,
    share_name="tigstack")

storageAccountKeys = pulumi.Output.all(resource_group.name, account.name).apply(
        lambda args: storage.list_storage_account_keys(args))
I came up with that where I want to refer to storageAccountKeys later in the code but it doesn't seem to work - i think I don't understand the output.all that well
w
I think the call to
list_storage_account_keys
needs to specify the property names and not just the values. So something like this:
Copy code
storageAccountKeys = pulumi.Output.all(resource_group.name, account.name).apply(
        lambda args: storage.list_storage_account_keys(resource_group_name: args[0], account_name: args[1]))
h
So close and yet so far away. Thank you Mitch that works!!