I recently started using pulumi with python to cre...
# general
n
I recently started using pulumi with python to create azure resources. I created azure storage account resource using azure-native API, extracted the
primary key
using list_storage_account_keys_output(…) method. My use case is that I need to pass this primary_key to the azure pipeline task so that service deployment can use it further. When I passed this primary via os.environ[‘primary_key’] to the pipeline, it reported error as “TypeError("str expected, not %s" % type(value).name)”. Then, I used Output.all(primary_key).apply(lambda args: f’{args[0]}’) which was recommended but still getting the same error. Can you please advice how can I pass value of primary_key as a str to the azure pipeline?
m
n
Thanks Thomas for your reply! I already tried this way but it reports that primary_key data type is Output<String> instead of String. I am trying to set this primary_key as os.environ['storage_account_key'] = primary_key so that it becomes available to access in azure pipeline. But, ends up in the error with datatype mismatch
m
You’ll have to do the assignment to os.environ inside an
apply
. See here for an explanation.