Here’s a test:
Here’s a module:
namespace OrderRequest.DataGateway open Microsoft.Azure.ServiceBus.Management module AzureTopic = let existsAsync(topicName:string) (connectionstring:string) = async { let client = ManagementClient(connectionstring) return! client.TopicExistsAsync(topicName) |> Async.AwaitTask } let createAsync(topicName:string) (connectionstring:string) = async { let client = ManagementClient(connectionstring) let! found = client.TopicExistsAsync(topicName) |> Async.AwaitTask if not found then let description = TopicDescription(topicName, EnablePartitioning= true) do! client.CreateTopicAsync(description) |> Async.AwaitTask |> Async.Ignore } let deleteAsync(topicName:string) (connectionstring:string) = async { let client = ManagementClient(connectionstring) let! found = client.TopicExistsAsync(topicName) |> Async.AwaitTask if found then do! client.DeleteTopicAsync(topicName) |> Async.AwaitTask }