https://pulumi.com logo
Title
m

mysterious-australia-14256

10/06/2020, 8:15 AM
Hi All, is it possible to get a vnet ID from a name and resource group using Azure Nextgen? I've been looking at the vnet docs but can't see a way to retrieve the ID.
t

tall-librarian-49374

10/06/2020, 8:40 AM
Hmm, it looks like it’s missing indeed. Could you file an issue in https://github.com/pulumi/pulumi-azure-nextgen/ ? Meanwhile, you can make it manually as
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}"
m

mysterious-australia-14256

10/06/2020, 9:14 AM
Thanks @tall-librarian-49374 I've raised the issue. Is there an easy way to pull out the subscriptionID either from azure nextgen or the azure-nextgen:subscriptionID value in the config yaml? In the original azure module I was using Pulumi.Azure.Core.GetSubscription but can't see an equivalent for that either.
t

tall-librarian-49374

10/06/2020, 9:46 AM
Yeah, there’s no
GetSubscription
yet (file another issue?). You can read
the azure-nextgen:subscriptionID value in the config yam
config = pulumi.Config("azure-nextgen")
confog.require("subscriptionID")
m

mysterious-australia-14256

10/06/2020, 10:35 AM
Thanks @tall-librarian-49374