none
Service Bus subscription creation RRS feed

  • Question

  • Failed creating Service Bus subscription "NAME" with error code: InternalServerError and with message: CorrelationId: 49f92880-ed43-49e1-88c5-c839b8536f84.

    Since two days I'm got this error. What's going on?

    CODE:

     if (await manager.TopicExistsAsync(sb.TopicPath))
    {
       if (!await manager.SubscriptionExistsAsync(sb.TopicPath, sb.Name))                        {
                                await manager.CreateSubscriptionAsync(sb);
                            }
    }


    Thanks

    Friday, June 7, 2019 2:44 PM

All replies

  • Can you try below samples and see if it helps. The complete samples is there on the GitHub service-bus-dotnet-management.

    private static async Task CreateSubscription()
    		{
    			try
    			{
    				if (string.IsNullOrEmpty(namespaceName))
    				{
    					throw new Exception("Namespace name is empty!");
    				}
    
    				var token = await GetToken();
    
    				var creds = new TokenCredentials(token);
    				var sbClient = new ServiceBusManagementClient(creds)
    				{
    					SubscriptionId = appOptions.SubscriptionId,
    				};
    
    				var subscriptionParams = new SBSubscription
    				{
                        MaxDeliveryCount = 10
    				};
    
    				Console.WriteLine("Creating subscription...");
    				await sbClient.Subscriptions.CreateOrUpdateAsync(resourceGroupName, namespaceName, TopicName, SubscriptionName, subscriptionParams);
    				Console.WriteLine("Created subscription successfully.");
    			}
    			catch (Exception e)
    			{
    				Console.WriteLine("Could not create a subscription...");
    				Console.WriteLine(e.Message);
    				throw e;
    			}
    		}

    Monday, June 10, 2019 4:47 AM
    Moderator
  • Any updates on this ?
    Tuesday, June 11, 2019 2:43 AM
    Moderator