Resource Class

Definition

Represents an Azure resource to be provisioned.

public abstract class Resource : System.ClientModel.Primitives.IPersistableModel<Azure.Provisioning.Resource>
type Resource = class
    interface IPersistableModel<Resource>
Public MustInherit Class Resource
Implements IPersistableModel(Of Resource)
Inheritance
Resource
Derived
Implements

Constructors

Resource(IConstruct, Resource, String, ResourceType, String, Func<String,Object>)

Initializes a new instance of the Resource.

Properties

Id

Gets the ResourceIdentifier of the resource.

IsExisting

Whether or not the resource already exists.

Name

Gets the name of the resource.

Parent

Gets the parent Resource.

ResourceData

Gets the data of the resource.

Scope

Gets the IConstruct scope of the resource.

Version

Gets the version of the resource.

Methods

AddDependency(Resource)

Adds a dependency to the resource.

AssignRole(RoleDefinition, Nullable<Guid>, Nullable<RoleManagementPrincipalType>)

Assigns a role to the resource.

FindParentInScope(IConstruct)

Finds the parent resource in the scope.

GetAzureName(IConstruct, String)

Validate and sanitize the resource name.

GetBicepName(Resource)

Gets the name of the resource for Bicep.

GetGloballyUniqueName(String)

Gets a globally unique name for the resource.

NeedsParent()

Determines whether the resource needs a parent declaration.

NeedsScope()

Determines whether the resource needs a scope declaration.

Explicit Interface Implementations

IPersistableModel<Resource>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<Resource>.GetFormatFromOptions(ModelReaderWriterOptions)

Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.

IPersistableModel<Resource>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

Applies to