https://pulumi.com logo
#general
Title
# general
e

early-plastic-49211

06/09/2023, 12:53 PM
Hello, I'm using the following to get an existing subnet from Azure:
Copy code
AzureNative.Network.GetSubnet.Invoke(new ()
{
    ResourceGroupName = "rg-name",
    VirtualNetworkName = "vnet-name",
    SubnetName = "subnet-name",
    Expand = "routeTable"
});
However, the routeTable is empty. When I try the request using the REST API directly (az rest --method get --uri ''https://management.azure.com/subscriptions/<subId>/resourceGroups/<rgName>/providers/Microsoft.Network/virtualNetworks/<vnetName>/subnets/<subnetName>?api-version=2020-11-01&$expand=routeTable''), the routeTable information is properly returned. Does anyone have an idea why?
b

billowy-army-68599

06/09/2023, 2:56 PM
Are you sure the azure credentials you’re using for the cli are the same as the Pulumi call?
e

early-plastic-49211

06/09/2023, 3:00 PM
Yes, both commands are executed on the same machine and Pulumi uses the same credentials as Azure CLI
b

billowy-army-68599

06/09/2023, 3:01 PM
e

early-plastic-49211

06/09/2023, 3:19 PM
I see that: I0609 110906.919050 14330 eventsink.go:78] eventSink::Infoerr(<{%reset%}>I0609 110906.916901 14995 log.go:75] Unmarshaling property for RPC[azure-native.Invoke(azure-nativenetwork/v20220901getSubnet).args]: expand={routeTable}
But the logged URL does not include the expand parameter
b

billowy-army-68599

06/09/2023, 3:23 PM
interesting, could you file an issue in the azure-native repo?
e

early-plastic-49211

06/09/2023, 3:26 PM
Yes, I will, thank you