Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var serviceNamespace = "<SERVICE_NAMESPACE>";
var eventHubsName = "<EVENTHUBS_NAME>";
var deviceName = "myDevice";
// 管理権限を持つ共有アクセスポリシー
var sharedAccessPolicyName = "<NAME>";
var sharedAccessPolicyKey = "<KEY>";
// メタデータの取得
var manageTokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider(sharedAccessPolicyName, sharedAccessPolicyKey);
var timeSpan = TimeSpan.FromHours(1);
var retryPolicy = new Microsoft.ServiceBus.RetryExponential(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(60), 5);
var nmSettings = new NamespaceManagerSettings() { OperationTimeout = timeSpan, RetryPolicy = retryPolicy, TokenProvider = manageTokenProvider };
var manager = new Microsoft.ServiceBus.NamespaceManager(ServiceBusEnvironment.CreateServiceUri("sb", serviceNamespace, ""), nmSettings);
var revoked = manager.RevokePublisher(eventHubsName, deviceName);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment