AzureProvisioningResource
Class net8.0
An Aspire resource that supports use of Azure Provisioning APIs to create Azure resources.
namespace Aspire.Hosting.Azure;
public class AzureProvisioningResource : Aspire.Hosting.Azure.AzureBicepResource{ // ...} 9 members
Constructors1
Section titled ConstructorsProperties2
Section titled PropertiesConfigureInfrastructuregetAction<AzureResourceInfrastructure> Callback for configuring the Azure resources.
ProvisioningBuildOptionsget; setProvisioningBuildOptions? Gets or sets the
Provisioning.ProvisioningBuildOptions which contains common settings and functionality for building Azure resources. Methods6
Section titled MethodsAddAsExistingResource(AzureResourceInfrastructure)virtualProvisionableResource Adds a new
Primitives.ProvisionableResource into infra. The new resource represents a reference to the current AzureProvisioningResource via https://learn.microsoft.com/azure/azure-resource-manager/bicep/existing-resource. AddRoleAssignments(IAddRoleAssignmentsContext)virtual Adds role assignments to this Azure resource.
CreateExistingOrNewProvisionableResource(AzureResourceInfrastructure, Func<string, BicepValue<string>, T>, Func<AzureResourceInfrastructure, T>)staticT Encapsulates the logic for creating an existing or new
Primitives.ProvisionableResource based on whether or not the ExistingAzureResourceAnnotation exists on the resource. GetBicepTemplateFile(string?, bool) Gets the path to the bicep file. If the template is a string or embedded resource, it will be written to a temporary file.
GetBicepTemplateStringstring Get the bicep template as a string. Does not write to disk.
TryApplyExistingResourceAnnotation(IAzureResource, AzureResourceInfrastructure, ProvisionableResource)staticbool Attempts to apply the name and (optionally) the resource group scope for the
Primitives.ProvisionableResource from an ExistingAzureResourceAnnotation attached to aspireResource.