- Details
- Written by: Stanko Milosev
- Category: Windows
- Hits: 5793
First we will go to service bus:
Â
Â
And we will create one service bus:
Â
After we created service bus, we can create either queue or topic. Topic is like a "view of queues" - can be understood like view in MS SQL Server. Topic and queues can be created manually or programmatically.
One example of creating topics, is something like:
TokenProvider tokenProvider = TokenProvider.CreateSharedSecretTokenProvider (TopicUtilities.GetIssuerName (), TopicUtilities.GetIssuerKey ()); Uri serviceUri = ServiceBusEnvironment.CreateServiceUri ("sb", TopicUtilities.GetServiceNamespace (), string.Empty); NamespaceManager namespaceManager = new NamespaceManager (serviceUri, tokenProvider);
Where GetIssuerName, GetIssuerKey, and GetServiceNamespace are like:
Â
public static String GetIssuerName() { if (_IssuerName == null) { lock (SYNC_LOCK) { if (_IssuerName == null) { _IssuerName = ReadAttribute("myNameSpace.something.Client.IssuerName", DefaulIssuerName); } } } return _IssuerName; } public static String GetIssuerKey() { if (_IssuerKey == null) { lock (SYNC_LOCK) { if (_IssuerKey == null) { _IssuerKey = ReadAttribute("myNameSpace.something.Client.IssuerKey");
} } } return _IssuerKey; } public static String GetServiceNamespace() { if (_ServiceNamespace == null) { lock (SYNC_LOCK) { if (_ServiceNamespace == null) { _ServiceNamespace = ReadAttribute("myNameSpace.something.Client.ServiceNamespace");
} } } return _ServiceNamespace; }
Then in, for example, ServiceConfiguration.Local.myApp.cscfg you must have something like:
 <ConfigurationSettings> <Setting name="myNameSpace.something.Client.IssuerName" value="owner" /> <Setting name="myNameSpace.something.Client.IssuerKey" value="myKey" /> <Setting name="myNameSpace.something.Client.ServiceNamespace" value="stanko2" /> </ConfigurationSettings>
Where myKey you can get if you click on service bus, and then on the access key, like on the picture
ServiceConfiguration.Local.myApp.cscfg is configuration if you want to deploy your app to Azure, but first to test it locally, so this configuration is for local Azure deployment.
For command line test, you can just something like:
Â
NamespaceManager namespaceManager = NamespaceManager.Create();
but in your app.config you must to have something like:
<?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <!-- Service Bus specific app setings for messaging connections --> <add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://stanko.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue=Bqcy7BC020Top5t1jcQnJ7CZN23t2JmqhpXwIRDGjEU=" /> </appSettings> </configuration>
None of these examples were not tested.
- Details
- Written by: Stanko Milosev
- Category: SQL
- Hits: 5620
How to check locks in Azure SQL?
Â
SELECT * FROM sys.dm_db_wait_stats ORDER BY wait_time_ms desc
- Details
- Written by: Stanko Milosev
- Category: SQL
- Hits: 5595
Table where we can see logs from Windows Azure.
- Details
- Written by: Stanko Milosev
- Category: SQL
- Hits: 5667
Use "CREATE DATABASE destination_database_name AS COPY OF [source_server_name.] source_database_name" to make a copy of database on the Azure SQL.
There is also possibility to check progress of DB copy, but at this moment I don't have that code.Â