salmon-printer-16080
01/26/2022, 5:13 AMUserAssignedIdentity
into a WebApp
before in TS? I am having a lot of trouble.
The example I have here, shows I can add a UAI to a webapp when I hardcode the id as the property, with a value of {}
as stated by the documentation here: https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/#managedserviceidentity _(I found that even the docs mentions that the second property should be user_assigned_identities
but that doesnt work even with hardcoding, so ive fallen back to the ARM template output from a pre-created resource which seems to work)_
The entire string looks like this:
let identity: any = {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/<sub-id>/resourcegroups/<rg>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<uai-name>" : {}
}
}
However, I cannot get the actual UAI id into the identity object due to the property of userAssignedIdentities
not accepting an Output<string>
as a property type. Using [UAI]: {}
to try cast the identity does not work either as it tries to cast it to a string. How does everyone else do it?Output<string>
as a property of a Map?echoing-dinner-19531
01/26/2022, 9:42 AMlet out = <some output value>
let map = out.apply(value => { "key": value })
brave-planet-10645
01/26/2022, 2:11 PMsalmon-printer-16080
01/26/2022, 8:15 PMconst getId = (id: string) => {
const dict: {[key: string]: object} = {};
dict[id] = {};
return dict;
}
let identity: any = {
type: "userAssigned",
userAssignedIdentities: args.userAssignedIdentity.id.apply(id => getId(id))
}