PolicyDefinitionVersionCollection.CreateOrUpdate Method
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.
This operation creates or updates a policy definition in the given subscription with the given name.
- Request Path. : /subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}.
- Operation Id. : PolicyDefinitionVersions_CreateOrUpdate.
- Default Api Version. : 2025-12-01-preview.
public virtual Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Resources.Policy.PolicyDefinitionVersionResource> CreateOrUpdate(Azure.WaitUntil waitUntil, string policyDefinitionVersion, Azure.ResourceManager.Resources.Policy.PolicyDefinitionVersionData data, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdate : Azure.WaitUntil * string * Azure.ResourceManager.Resources.Policy.PolicyDefinitionVersionData * System.Threading.CancellationToken -> Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Resources.Policy.PolicyDefinitionVersionResource>
override this.CreateOrUpdate : Azure.WaitUntil * string * Azure.ResourceManager.Resources.Policy.PolicyDefinitionVersionData * System.Threading.CancellationToken -> Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Resources.Policy.PolicyDefinitionVersionResource>
Public Overridable Function CreateOrUpdate (waitUntil As WaitUntil, policyDefinitionVersion As String, data As PolicyDefinitionVersionData, Optional cancellationToken As CancellationToken = Nothing) As ArmOperation(Of PolicyDefinitionVersionResource)
Parameters
- waitUntil
- WaitUntil
Completed if the method should wait to return until the long-running operation has completed on the service; Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- policyDefinitionVersion
- String
The policy definition version. The format is x.y.z where x is the major version number, y is the minor version number, and z is the patch number.
The policy definition properties.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
policyDefinitionVersion or data is null.
policyDefinitionVersion is an empty string, and was expected to be non-empty.