Hi All, is it possible to get a vnet ID from a nam...
# azure
m
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
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
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
Yeah, there’s no
GetSubscription
yet (file another issue?). You can read
the azure-nextgen:subscriptionID value in the config yam
Copy code
config = pulumi.Config("azure-nextgen")
confog.require("subscriptionID")
m
Thanks @tall-librarian-49374