Reputation: 1
I have set up an Azure Marketoffer that as a Managed Application. I have a createUiDefinition.json file that defines necessary tabs/inputs/fields etc that are used to create the Managed Application.
When testing via the Marketplace the Basics tab auto inserts two additional fields; Application Name and Managed Resource Group within a Managed Application Details sections.
Auto Genererated Managed Application Fields
From all my searching I have not been able to find in the Microsoft Documentation for createUiDefinition.json templates and/or samples how to read the output of those two fields.
Where there are references for [resourceGroup().name]
, [subscription().subscriptionId]
and [location()]
I am not able to find the reference values for the above field.
They can then be passed on within the createUiDefinition.json file for later use:
"outputs": {
"applicationName": "...", //need reference to inserted fields
"applicationManagedResourceGroup": "...",
"managedApplicationSubscriptionId": "[subscription().subscriptionId]",
"managedApplicationResourceGroup": "[resourceGroup().name]",
"location": "[location()]",
"vNetNewOrExisting": "[steps('deploymentDetails').vnet.newOrExisting]",
"vNetName": "[steps('deploymentDetails').vnet.name]",
...
Note: These fields are auto inserted by the Marketplace for Managed Applications. They do not show up when using the Sandbox tool as it is not linked to a Managed Application.
Doess anyone know how to reference those two values?
I have tried searching Microsoft site for any reference to these auto-inserted fields but have not found anything that references them.
I have tried guessing with [applicationResourceName()]
but that does not appear to work. Pulling my hair out as I can't be the only person who needs to capture those values.
Upvotes: 0
Views: 161
Reputation: 1
Turns out the name of the managed application can be found by grabbing resourceGroup().?managedBy
attribute in the bicep files.
This value only exists in cases like above when you allow the Azure Portal to create the Managed Application Name and Resource group fields. In my bicep file I used the following (note the null check) necessary if testing in the sandbox.
var managedApplicationId = resourceGroup().?managedBy ?? null
Upvotes: 0