https://pulumi.com logo
#general
Title
# general
w

wooden-receptionist-75654

11/01/2021, 4:47 PM
Hey Guys, I’m trying to get azure subscriptionId from azure-native. And a bit confused with Input/Output
Copy code
const azure = authorization.getClientConfig();
const subscriptionId = azure.then(azure => azure.subscriptionId)

new authorization.RoleAssignment("ass", {
  principalId: kprincipalId,
  principalType: "ServicePrincipal",
  roleDefinitionId:
    `/subscriptions/${subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/${id}`,
  scope: resourceGroup.id,
});
And I’m still got
[object Promise]
for subscriptionId. What I’m missing?
b

billowy-army-68599

11/01/2021, 4:57 PM
@wooden-receptionist-75654 have a look here, you need to await the authorization call https://github.com/pulumi/examples/blob/ca40203279f393c0c159dadcadc97c6007122997/azure-ts-call-azure-sdk/index.ts
w

wooden-receptionist-75654

11/01/2021, 5:01 PM
@billowy-army-68599 thank you!