你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Resource Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |