你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

QueueClient.CreateIfNotExistsAsync 方法

定义

CreateIfNotExistsAsync(IDictionary<String,String>, CancellationToken) 操作在指定的帐户下创建新队列。 如果队列已存在,则不会更改。

有关详细信息,请参阅 创建队列

public virtual System.Threading.Tasks.Task<Azure.Response> CreateIfNotExistsAsync (System.Collections.Generic.IDictionary<string,string> metadata = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateIfNotExistsAsync : System.Collections.Generic.IDictionary<string, string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
override this.CreateIfNotExistsAsync : System.Collections.Generic.IDictionary<string, string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function CreateIfNotExistsAsync (Optional metadata As IDictionary(Of String, String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response)

参数

metadata
IDictionary<String,String>

要为此队列设置的可选自定义元数据。

cancellationToken
CancellationToken

可选 CancellationToken ,用于传播应取消操作的通知。

返回

如果队列尚不存在,则为 描述 Response 新创建的队列的 。 如果队列已存在,则为 null

注解

RequestFailedException如果发生故障,将引发 。

适用于