Quantcast
Channel: Service Bus forum
Viewing all 1916 articles
Browse latest View live

Authentication with Service Bus for Windows Server 1.1

$
0
0

Hi:

I installed Service Bus for Windows server 1.1 on a windows server 2012 R2 which joined a windows domain.I built a application try to connect to that server from my windows 10 which not joined any windows domain.But I got a 401 exception.

below is my code:

string serverFqdn = "SB-160.moss.hnop.org"; int httpPort = 9355; int tcpPort = 9354; string serviceNamespace = "ServiceBusDefaultNamespace"; ServiceBusConnectionStringBuilder connBuilder = new ServiceBusConnectionStringBuilder(); connBuilder.ManagementPort = httpPort; connBuilder.RuntimePort = tcpPort; connBuilder.Endpoints.Add(new UriBuilder() { Scheme="sb",Host = serverFqdn,Path=serviceNamespace }.Uri); connBuilder.StsEndpoints.Add(new UriBuilder() { Scheme = "https", Host = serverFqdn, Path = serviceNamespace,Port=httpPort }.Uri); TokenProvider localUserTokenProvider = WindowsTokenProvider.CreateWindowsTokenProvider( connBuilder.StsEndpoints, new System.Net.NetworkCredential("adadmin", "abc@1234", "moss.hnop.org")); MessagingFactorySettings msgFactorySetting = new MessagingFactorySettings(); msgFactorySetting.TokenProvider = localUserTokenProvider; msgFactorySetting.OperationTimeout = new TimeSpan(50); NamespaceManagerSettings nmSetting = new NamespaceManagerSettings(); nmSetting.TokenProvider = localUserTokenProvider; MessagingFactory factory = MessagingFactory.Create( connBuilder.GetAbsoluteRuntimeEndpoints(),msgFactorySetting); NamespaceManager namespaceManager = new NamespaceManager( connBuilder.GetAbsoluteManagementEndpoints(), nmSetting); Console.WriteLine(namespaceManager.QueueExists("Test"));

Console.WriteLine(namespaceManager.QueueExists("Test")); Console.ReadLine();


can you help me ?thank you.


...


Automation of IoT Hub using PowerShell

$
0
0

Here’s the code:

 How do I create the SAS token using PowerShell?

# Load the System.Web assembly to enable UrlEncode

[Reflection.Assembly]::LoadFile( `

  'C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\System.Web.dll')`

  |out-null

 

$method="GET"

$URI='https://nameofiot.azure-devices.net/devices?top=10&api-version=“2015-08-15-preview"'

 

 

 

$encodedURI=[System.Web.HttpUtility]::UrlEncode($URI)

$policyname="iothubowner"

$primarykey="EA…."

$startDate=[datetime]”01/01/1970 00:00”

$hour=New-TimeSpan-Hours1

 

# Calculate expiry value one hour ahead

$sinceEpoch=NEW-TIMESPAN–Start$startDate–End ((Get-Date) +$hour)

$expiry=[Math]::Floor([decimal]($sinceEpoch.TotalSeconds+3600))

 

# Create the signature

$stringToSign=$encodedURI+"`n"+$expiry

$hmacsha=New-Object System.Security.Cryptography.HMACSHA256

$hmacsha.key=[Text.Encoding]::ASCII.GetBytes($primarykey)

$signature=$hmacsha.ComputeHash([Text.Encoding]::ASCII.GetBytes($stringToSign))

$signature=[System.Web.HttpUtility]::UrlEncode([Convert]::ToBase64String($signature))

 

# API headers

$headers= @{

           "Authorization"="SharedAccessSignature sig="+"$signature"+"&se="+$expiry+"&sr="+$encodedURI;

           "Content-Type"="application/json";

            }

 

# execute the Azure REST API

Invoke-RestMethod-Uri$URI -Method$method -Headers$headers

 

 

It would be great if someone could help me out with this!

Using AMQP to send data from Android device to Event Hub?

$
0
0

I was able to test the AMQP Java example sending data to Event Hub. However, I was wondering if there is an example showing AMQP with Android? The qpid-proton client would not work due to the lack of some javax libs in Android (Dalvik). Is there a different client that has been tested demonstrating this successfully? 

Thanks!

Eventhub Partition

$
0
0
What is the limit for partition in eventhub? I am getting error that maximum is 32. I had created a support ticket and they said number of partition can be equal to number of TU. Currently, I have 100 TU but I am not able to create 100 partitions. The support team said they have increased partition to 100. Can I have 100 partitions? If yes, what is the procedure? 

Azure ServiceBus Resource Manager

$
0
0

Hi,

I have created c# that provisions an IoT Hub using the Azure Resource Manager REST API. This works fine and after succesfull creation I can also get the security credentials by using "listkeys".

I was wondering if  there is something similar available for Service Bus. I can create a namespace but I cannot retrieve security credentials by using the ARM REST interface or am I missing something?

Thanks

Read Atom Feed With RSS reader

$
0
0

Hi all,

I'm looking to have clients subscribe to topics on an Azure service bus using an RSS/Atom Reader.

I know that the bus automatically produces a feed, but I don't understand how the users would subscribe to a specific queue or topic with an RSS reader as they will need a token.

Can anyone point me towards an answer?

python script which subscribes/listens to Azure Event Hub?

$
0
0
I am interested in listening to an Event Hub from a Python script and executing some code when an inbound message is detected.

On Ubuntu, using Python 2.7 with https://pypi.python.org/pypi/python-qpid-proton/0.10 and the example "receiver" script, I attempt to subscribe to a URI that looks like:

    amqps://<key name>:<key>@<namespace>.servicebus.windows.net/<event hub name>/ConsumerGroups/$Default/Partitions/0

The following error is returned:

    proton.MessengerException: Cannot subscribe to <...>

I believe that my Event Hub is set up correctly because I am able to send events into it using a separate "send" script and the Azure dashboard shows that events have arrived.  But I am unable to connect as a subscriber to receive messages.

Any thoughts/suggestions?

TIA
Jaman

Events HUB and Python

$
0
0

Hello,

Does Events HUB works with Python?

I saw in documentation only example for .NET, Java and C. 


NetTcpRelayBinding - The handshake failed due to an unexpected packet format

$
0
0

We have a WCF service that's self-hosted by a Windows Service inside our corporate network, which resides behind a HTTP web proxy (MacAfee Web Gateway).

The WCF service is called by a web application residing in Azure Websites. The web app calls the WCF by utilizing the NetTcpRelayBinding.

Since the WCF service is behind the HTTP proxy, I need to place the following in the app.config so that it can communicate through the HTTP proxy.

<defaultProxy useDefaultCredentials="true"> <proxy proxyaddress="http://OURPROXY:80" usesystemdefault="True"/></defaultProxy>

This setup has been working well for several months. The WCF service is using the Windows Azure Service Bus2.2.7 SDK.

https://www.nuget.org/packages/WindowsAzure.ServiceBus/2.2.7

Today I attempted to upgrade to a newer SDK and the result was that the WCF service could no longer communicate through the HTTP proxy. I would receive the following error when the WCF service attempted to start up and connect to Azure.

System.IO.IOException: The handshake failed due to an unexpected packet format.

I tried several different Azure Service Bus SDK versions, including the most recent version... 2.5.2. All versions give me the same error. I can only make things work with version 2.2.7. All the more recent versions cause this error when communicating through the HTTP proxy.

Everything works fine with the newer versions of the SDK if I'm on my home network, since I don't have to go through the HTTP proxy. 

It appears a change that was introduced in version 2.3.0 is causing the problems.

My question, can I get some information on what would have changed from version 2.2.7 of the SDK to version 2.3.0 that would cause our WCF service to no longer work through the HTTP web proxy while utilizing the NetTcpRelayBinding?

Thanks,

Chris.

 


Using SSIS to feed data to Azure Event Hub

$
0
0
Is anyone using SSIS to feed data into an Azure event hub? I'm going to have events streaming into the event hub and I need to ETL data from our on premise sql databases in real time into Azure and queued up to be used by an HDInsight cluster.  It seems like a feasible solution in my head, but I can't find examples of anyone actually doing this.  Thanks in advance.

Service Bus 1.1 for Windows Server configuration fail - Service can not start

$
0
0
I have an issue during configuration of Service Bus via GUI. It happens at adding host to service bus farm stage.

I found two errors in the details:
1.It failed to adding the logged in user account into local admin, but I am using another account during the configuration, and the highlighted account is already in the admin group. And whether the account is in the admin group or not, it will always show this error message.
2.The critical one, it can not start Service Bus Gateway service on the Windows 2012 R2 server, it keeps time out and having 2 error message in the event log.

I have installed service bus on other servers with the same feature and role configurations without any problem. But only this one. Would there be any port, security settings or network settings could cause the service to start?

Thank you.




Authorization needed to call TopicClient.SendBatch (Service Bus 1.0 for Window Server)

$
0
0

Hi,
I'm using Service Bus 1.0 for Windows Server (on premise) and I am tring to call TopicClient.SendBatch().
In the (Windows) user making the call is 'manage user' on the entire namespace, the call works fine.

If the user has onlysend and listen rights on a specific topic, the call toTopicClient.SendBatch() throws the following exception:
Unhandled Exception: System.UnauthorizedAccessException: 40100: Unauthorized.TrackingId:ed93d168-36a8-4357-b4755b0d679a2165_G******_G******,TimeStamp:19.12.2013 13:37:00 ---> System.ServiceModel.FaultException: 40100: Unauthorized. TrackingId:ed93d168-36a8-4357-b475-5b0d679a2165_G*******_G********,TimeStamp:19.12.2013 13:37:00

If I call TopicClient.Send(), with the above permissions, the call works fine.

The send and listen permissions are granted from code, as follows: 

topicDescription.Authorization.Add(
       new AllowRule("NamespaceName", "nameidentifier", "machine\\username", 
new List<AccessRights> { AccessRights.Listen, AccessRights.Send }));

All users are local Windows users, not domain accounts - no special permissions, just simple accounts members of the local 'Users' group. Both the client and the SB server are on the same machine.

Does anyone know if this is expected, or if the authorization should be set-up in another way?
---------------------------

The full stack trace is:

System.UnauthorizedAccessException occurred
  HResult=-2147024891
  Message=40100: Unauthorized.TrackingId:d2f234f1-b8bf-4b4b-8abf-a1dea7da11ff_G****-PC,TimeStamp:19.12.2013 15:44:41
  Source=Microsoft.ServiceBus
  StackTrace:
       at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.EndSendCommand(IAsyncResult result)
       at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.OnEndSend(IAsyncResult result)
       at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.OnSend(TrackingContext trackingContext, IEnumerable`1 messages, TimeSpan timeout)
       at Microsoft.ServiceBus.Messaging.MessageSender.Send(TrackingContext trackingContext, IEnumerable`1 messages, TimeSpan timeout)
       at Microsoft.ServiceBus.Messaging.MessageSender.SendBatch(IEnumerable`1 messages)
       at Microsoft.ServiceBus.Messaging.TopicClient.SendBatch(IEnumerable`1 messages)
       at...
  InnerException: System.ServiceModel.FaultException
       HResult=-2146233087
       Message=40100: Unauthorized.TrackingId:d2f234f1-b8bf-4b4b-8abf-a1dea7da11ff_G****-PC,TimeStamp:19.12.2013 15:44:41
       Source=Microsoft.ServiceBus
       Action=http://schemas.microsoft.com/servicebus/2010/08/protocol/Fault
       StackTrace:
         Server stack trace:
            at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.ThrowIfFaultMessage(Message wcfMessage)
            at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.HandleMessageReceived(IAsyncResult result)
         Exception rethrown at [0]:
            at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
            at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.DuplexCorrelationAsyncResult.End(IAsyncResult result)
            at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.EndRequest(IAsyncResult result)
            at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.RequestAsyncResult.<GetAsyncSteps>b__4(RequestAsyncResult thisPtr, IAsyncResult r)
            at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
         Exception rethrown at [1]:
            at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
            at Microsoft.ServiceBus.Common.AsyncResult`1.End(IAsyncResult asyncResult)
            at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.EndRequest(IAsyncResult result)
            at Microsoft.ServiceBus.Messaging.Sbmp.RedirectBindingElement.RedirectContainerChannelFactory`1.RedirectContainerSessionChannel.RequestAsyncResult.<>c__DisplayClass17.<GetAsyncSteps>b__a(RequestAsyncResult thisPtr, IAsyncResult r)
            at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
         Exception rethrown at [2]:
            at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
            at Microsoft.ServiceBus.Common.AsyncResult`1.End(IAsyncResult asyncResult)
            at Microsoft.ServiceBus.Messaging.Sbmp.RedirectBindingElement.RedirectContainerChannelFactory`1.RedirectContainerSessionChannel.EndRequest(IAsyncResult result)
            at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.RequestAsyncResult.<GetAsyncSteps>b__4(RequestAsyncResult thisPtr, IAsyncResult r)
            at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
         Exception rethrown at [3]:
            at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
            at Microsoft.ServiceBus.Common.AsyncResult`1.End(IAsyncResult asyncResult)
            at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.EndRequest(IAsyncResult result)
            at Microsoft.ServiceBus.Messaging.Sbmp.SbmpTransactionalAsyncResult`1.<GetAsyncSteps>b__36(TIteratorAsyncResult thisPtr, IAsyncResult a)
            at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
         Exception rethrown at [4]:
            at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
            at Microsoft.ServiceBus.Common.AsyncResult`1.End(IAsyncResult asyncResult)
            at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.EndSendCommand(IAsyncResult result)


Future of on premise version of service bus

$
0
0

Hello,

Does anyone have any insight on whether the on premise version of the service bus will be supported in the foreseeable future? It seems that it hasn't been updated since 2013, even though a yearly update was promised. This gives me the impression this product will overcome the same fate as other on premise products such as App Fabric, i.e. will be discontinued. Would it be smart to use this product for new development? Is there any road map?


Collect data from Azure ioT HUB with nodeJS?

$
0
0
Trying to find example code on how to connect to my Azure ioT HUB to collect the data my devices is sending to me? I only can find on how i can read from one device.

Run a simple C sample on Intel Edison

$
0
0

Hi all , I am trying to connect a intel Edison to IOT hub as to documentation on Azure at Git 

https://github.com/Azure/azure-iot-sdks/blob/26e81a7a3358815bfee9553678f546ffe6f3d3ce/c/doc/run_sample_on_intel_edison.md

it says to

Navigate to: ~/cmake/iothub_client/samples/iothub_client_sample_amqp

and

./iothub_client_samples_iothub_client_sample_amqp

but this folder have nothing to run

I found a .c file of it in  azure-iot-sdks/c/iothub_client/samples/iothub_client_sample_amqp

but it says I don't have permission , and I try it with gcc command but it says :

gcc ./iothub_client_sample_amqp.cthub_client/samples/iothub_client_sample_amqp#
./iothub_client_sample_amqp.c:7:27: fatal error: iothub_client.h: No such file or directory
 #include "iothub_client.h"
                           ^
compilation terminated.
cd \@pe3iot:~/azure-iot-sdks/c/iothub_client/samples/iothub_client_sample_amqp#

but in cmaker folder, I have iothub client folder , I have run

$ ./build_proton.sh
$ ./build.sh

successfully and copy libqpid-proton.so.2 to lib ,

my cmaker >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

root@pe3iot:~# cmake --version
cmake version 3.4.0

gcc:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

root@pe3iot:~# gcc --version
gcc (GCC) 4.9.1 

have tried Updated instructions too at

https://github.com/Azure/azure-iot-sdks/pull/212/files?short_path=af74a54

make all file changes it says but I was unable to run "make -f makefile.linux" with error

make: makefile.linux: No such file or directory
make: *** No rule to make target 'makefile.linux'.  Stop.

I notice that Documentation on Edison rarely updated (or any , don't starters deserve more support ?)

Thanks in Advance


Amqp client Android

$
0
0

Hi there

I am curious to see when will be there any sdk for android to connect directly to Azure service through Amqp? Is there a plan for microsoft to do so?

Thanks

Connecting ThreadX devices to Azure IOT Hub

$
0
0

This is more of a could do question, i have a ThreadX based RTOS system which supports http using Netx . The tutorials which MS provides does not speak of this system. Can we use Azure IOT Hub / Event hubs to send data to cloud through http with this controller ? Are there any libraries provided to support ?

Memory leak in the Azure Service Bus Queue

$
0
0

Hi guys,

I am using Azure Service Bus Queue as described here:

https://azure.microsoft.com/en-us/documentation/articles/service-bus-dotnet-how-to-use-queues/#comments

Source code is following:

...

            string connectionString = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString.Import");
            string importQueueName = CloudConfigurationManager.GetSetting("ImportQueueName");

            var namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);

            if (namespaceManager.QueueExists(importQueueName))
            {
                QueueClient client = QueueClient.CreateFromConnectionString(connectionString, importQueueName);
                BrokeredMessage message = new BrokeredMessage(XmlTextBox.Text);
                message.Properties["BusinessUnitCode"] = BusinessUnitTextEdit.Text;
                message.Properties["DocumentType"] = DocumentTypeComboBox.Text;
                client.Send(message);
                MessageBox.Show("Sent");
            }
            else
                MessageBox.Show("Not found!");

...

Every time this code is executed memory leaks approximately 1Mb. I tried to put "BrokeredMessage" inside "using" statement but that did not help either.

Is there anything that I am missing?

Thanks in advance.

[EventHub] Explicit call to close required: bug or wrong usage?

$
0
0

Hi everyone,

I have a simple web app that, on each request, send an event through an EventHub in order to process it later (for now with a Stream Analytics in order to get some "quick win aggregation"). I precise that, for each request, a new EventHubClient object is instanciated.

After running the app some times, I identified that the EventHub stopped to receive any events. Diving into logs, I found an exception thrown by the webapp on a call to theEventHubClient::SendAsync() method. The reason was something like "AMQP error: cannot register more than 4999 handlers"

To solve that issue, I just added a call to the EventHubClient::close() method at the end of my request. But the thing is, neither in the MSDN documentation neither in Azure Documenation (or here) a requirement to call that method is mentionned.

So some questions:

  • Is it normal that the EventHubClient doesn't "close itself" alone?
  • Do you see any drawback to close the EventHubClient instance manually? On each request?
  • I instanciate a new EventHubClient object on each request beacause MSDN documentation precise that EventHubClient's methods are not thread safe. Do you see any counterpart on that except maybe some additionnal time consuming for each request? I thought about implementing a kind of PoolOfEventHubClient that I would share between requests... do you think it might be really relevant?

Many thanks for your lights,

Trying to Connect to SSTP server using Service Bus Relay

$
0
0

From @msaqibhashmi via Twitter:

"I want to connect to my server using relay service bus. I am running RRAS server and I will use SSTP server for remote connection using relay service bus. Also is there any bandwidth limit using this relay service?

Thanks
@AzureSupport

Viewing all 1916 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>