We are running a Master Tenant and several Sub Tenants. All tenants are created with the Advanced Options of Account Number, Account Name and Customer Number. We need this information very early in a Provisiong Workflow - Configuration Phase to set a Hostname based on the Customer Number for the Spec.
We are running a Powershell script in that Workflow and read the Customer Number with a Rest API call on the endpoint “/api/accounts&name=customerName”. Unfortunately, we only found out how to fill the variable customerName manually before the script runs - that is, we put in the appropriate Tenant Name from case to case depending on the Tenant where we are logged in…
We could not figure out how to read the actual Tenant Name where we are logged into automatically. Within “Edit Task” of the Powershell script we saw variables like <%=tenant%> or <%=account%>, but we could not manage to deliver output from those.
Is there any way to find out the Tenant Name where I am actually logged in and read the Customer Number, both automatically in a script?
Hi Kai. It looks like accountNumber is available as a pre-provision var for instance and host naming, so could a hostname policy help, or at least give you the data and you then mutate it?
Thank you for your very quick response. I will check this out and come back here to mark it as solution as early as I got it managed. I know, you already point in the right direction …
I have managed to use the variables ${accountName} or ${customerNumber} within an Instance Naming Policy - but I cannot find a way to put the same or similar variables in a Powershell script and use it in the Configuration Phase of a Provisioning Workflow.
Since this script is a two line script like the following, can you try to get it running:
I see your answer as solution, since one could use this way to extract the customerNumber in a script now and move on in the same script … Thank you.
Although I am also thinking about raising an idea in the appropriate section of this forum to find any easier way to read the information of accountName, accountNumber and customerNumber from anywhere at any time, since these values are really independent of any other component like an Instance, App, Cloud, …
I have tested the code lines within my environment and it works out fine! Hence, this is also a solution to the question - or like the music group U2 would say: Even Better Then The Real Thing.