This message was deleted.
# azure
s
This message was deleted.
m
Use
Apply
. See https://www.pulumi.com/docs/intro/concepts/programming-model/#apply
Copy code
var url = virtualmachine.DnsName.Apply(dnsName => "https://" + dnsName);
c
Thank you for the response Justin, but doesn't the Apply method still returns an Output of something?
My use case is to generate a SAS token via
Pulumi.Azure.Storage.Invokes.GetAccountBlobContainerSAS
for a storage account I'm creating but the GetAccountBlobContainerSASArgs has strings properties instead of Inputstring parameters
m
You'll need to call
GetAccountBlobContainerSAS
inside the
Apply
where the argument will be a string.
c
Works like a charm, thanks!
🎉 1
t
Great that you made it work. Note that we have
SharedAccessSignature.SignedBlobReadUrl(blob, storageAccount);
in the standard library.
c
Nice, will look into that one. BTW I love pulumi guys
c
turned >3k LOC of ARM template into ~500 lines of C#
t
Nice! Maybe you can pack it up even further 🙂
c
Sure, but I'm just starting out
so I still have a lot to learn here
I have one question, can I somehow import an existing resource group into a pulumi stack?
t
yes you can. do you want to just reference it to retrieve its property or do you want to start managing it from pulumi?
c
My plan is to throw away the arm template and replace it with pulumi, the problem is that pulumi generates names that differ from the one I've generated already
thanks, will look into it!
t
you can override the default names
c
you mean by specifinng the whole name?
t
yes
c
I know but for ~100 resources is a bit tedious to do
that's eventually my plan
I was hoping to find something smarter though 🙂
t
like what?
c
like importing the existing resources into a stack so pulumi can use the existing names instead of generating new ones but I have to admit I didn't read the docs on that part because I'm just focusing on creating the equivalent of the arm template now
so I may have missed something there
t
So “adopting” above is the way to import resources, but you still have to write code for them manually and resolve IDs (not names). There’s no auto-import tool currently.