ArmStorageModelFactory.StorageCorsRule Method

Definition

Specifies a CORS rule for the Blob service.

public static Azure.ResourceManager.Storage.Models.StorageCorsRule StorageCorsRule(System.Collections.Generic.IEnumerable<string> allowedOrigins = default, System.Collections.Generic.IEnumerable<Azure.ResourceManager.Storage.Models.CorsRuleAllowedMethod> allowedMethods = default, int maxAgeInSeconds = 0, System.Collections.Generic.IEnumerable<string> exposedHeaders = default, System.Collections.Generic.IEnumerable<string> allowedHeaders = default);
static member StorageCorsRule : seq<string> * seq<Azure.ResourceManager.Storage.Models.CorsRuleAllowedMethod> * int * seq<string> * seq<string> -> Azure.ResourceManager.Storage.Models.StorageCorsRule
Public Shared Function StorageCorsRule (Optional allowedOrigins As IEnumerable(Of String) = Nothing, Optional allowedMethods As IEnumerable(Of CorsRuleAllowedMethod) = Nothing, Optional maxAgeInSeconds As Integer = 0, Optional exposedHeaders As IEnumerable(Of String) = Nothing, Optional allowedHeaders As IEnumerable(Of String) = Nothing) As StorageCorsRule

Parameters

allowedOrigins
IEnumerable<String>

Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow all domains.

allowedMethods
IEnumerable<CorsRuleAllowedMethod>

Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin.

maxAgeInSeconds
Int32

Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response.

exposedHeaders
IEnumerable<String>

Required if CorsRule element is present. A list of response headers to expose to CORS clients.

allowedHeaders
IEnumerable<String>

Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request.

Returns

A new StorageCorsRule instance for mocking.

Applies to