This message was deleted.
# azure
s
This message was deleted.
w
Are you able to access the environment variables? If so, you might be able to get the Azure config directly from the environment vars.
m
Locally, Pulumi is using the Azure CLI for me to be authenticated, so I don't think environment variables would contain my subscription name. concerning Azure DevOps, the authentication is done using the Azure DevOps token and the organizationUrl set in the configuration so I don't think I can the organization name from the env vars.
t
Does this work?
Copy code
var organisationName = Pulumi.AzureDevOps.GetClientConfig.Invoke()
    .Apply(c => new Uri(c.OrganizationUrl).Segments.Last());
or did we miss adding Invoke there?
m
Invoke is not available,only invokeasync.
Anyway it works, but does not feel very easy to read. Even worse for retrieving the subscription name. I was wondering if I was missing some better ways to do that.
t
We should add it. Could you please open an issue?
m
👉 https://github.com/pulumi/pulumi-azuredevops/issues/169 For the subscription name however, I did not find something better than calling the Azure SDK. In the Azure Classic provider there is a method to do retrieve it directly but referencing the classic SDK just for that is not somethin I want to do. The apply everywhere does not make thing very readable either. It seems to me that I had less Apply when using TypeScript, is it because Lifting does not completly work in C# ?