Deploy ServiceBus with multiple Topics and Queues at once - azure

I'm fairly new to using the servicebus and other Azure features. After creating a servicebus manually on the Azure portal, I try to figure out how this can be achieved automatically. After a while of reading I thought that using the azure resource manager should be the way to go. Deploying just one topic is no big deal. But I can't find an example, that shows how to deploy multiple topics and queues at once. Or am I on the wrong approach?
Thanks for your answers!
Helmut

What we do (and I saw other teams doing the same) is simple: when your producer/consumer application starts, it checks if required queues/topics/subscriptions exist, and creates them otherwise.
So we create all Service Bus entities from C# code, which also gives the full flexibility for options.
Code sample:
var namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
if (!namespaceManager.TopicExists(topicName))
{
namespaceManager.CreateTopic(new TopicDescription(topicName));
namespaceManager.CreateSubscription(
new SubscriptionDescription(topicName, subscriptionName));
}
That's not to say your ARM approach is wrong or bad, just to give a simple alternative.

Using the new azure portal (here), there is an Automation script feature.
I've created a new resource group with a service bus namespace that contains 2 topics and 1 queue:
You can see on the left panel, there is an Automation script feature.
In this section, you can find a template that represents the resources that you've created manually. you can then use this template to automate your deployment to others environment.
See also Deploy resources with Resource Manager templates and Azure PowerShell

Related

Create Azure servicebus subscription from another pipeline then the one that creates the servicebus

Within Azure DevOps I have two pipelines. Pipeline A creates a servicebus with topics. Pipeline B wants to create a subscription on one of the topics from the servicebus.
So for one strange reason I can't get it working to create the subscription from pipeline B. It constantly complains about not finding the servicebus resource. I've done some searching and the only solutions that I could find where creating servicebus topics and subscriptions in once. But in my opinion this is not correct, because why should the creator of the servicebus also be involved in creating the subscriptions???
So my question: is it possible to create a subscription from another pipeline (and thus another resourcegroup) and if so, how would I do this.
Thanks in advance,
Herman

Azre Data Explorer Data Connection Automation

Is there anyway to automate the creation of an Azure Data Explorer Data Connection.
I want to create it as part of an automated deployment so either ARM or through C#. The Data Connection source is an EventHub and needs to include the properties specifying the table, consumer group, mapping name and data format.
I have tried creating a resource manually and epxporting the template but it doesn't work. I have also looked through the MSFT online documentation and cannot find a working example.
This is all I have found example
Please take a look at this good example which shows how to create control plane resources (cluster, database, data connection) using ARM templates, and using a data plane python API for the data plane resources (table, mapping).
In addition, for C# please see docs here and following C# example for how to create an event hub data connection:
var dataConnection = managementClient.DataConnections.CreateOrUpdate(resourceGroup, clusterName, databaseName, dataConnectionName,
new EventHubDataConnection(eventHubResourceId, consumerGroup, location: location));
I've actually just finished building and pushing an Azure Sample that does this (see the deployment template and script in the repo).
Unfortunately, as I elected not to use the Azure CLI (and stick with pure Azure PowerShell), I wasn't able to fully automate this, but you can at least see the approach I took.
I've filed feedback with the product group here on UserVoice

Azure resource Created By & Timestamp

We have Azure environment with 3 different subscription and around 5 project resources are deployed in this environment.
Each project team has rights to create resources under specific Resource Group (RG) within Azure.
Now from Azure Admin perspective, i would like to know Who, When
This is basic requirements for any organization to track their cost, resource information. When i looked in Azure, this information is not available directly at resource level.
Few posts are mentioning to use Tagging for this or use logs (2 years back, really?)? Is it? I am surprised.
Can i use Application Insight for this? or only available for App Service kind of services?
Please help me to get this information in efficient way
Your only option is to implement some sort of logging (like poll Azure Subscription events) and save it somewhere. You can use Azure Monitor to achieve that rather easily. But by itself Azure doesnt offer anything like that out of the box.
you can use tagging, but with obvious challenges. logs only go 3 months back.

Disable / suspend Azure Time Series Insight

Since the pricing does not offer much choice in terms of flexibility my developer MSDN account is quickly running out of credits using Azure Time Series Insights fro a Proof of Concept. Is it somehow possible to suspend the service so no costs are incurred? I would hate to have to delete the whole thing and set it up again when we start working again on the PoC.  
Currently, Azure still do not provide a way to suspend TSI environment.
Maybe you can use scripted template deployment for creating/deleting TSI environment.
With this approach, however, you are going to constantly loose your data.
On the link below there are guidelines, provided by Microsoft, on how to implement template deployment:
https://learn.microsoft.com/en-us/azure/time-series-insights/time-series-insights-manage-resources-using-azure-resource-manager-template
The general steps provided by MSFT are:
Install PowerShell
Create the template and a parameter file.
In PowerShell, log in to your Azure account.
Create a new resource group if one does not exist.
Test the deployment.
Deploy the template.

What about Azure Cloud Services in the new "Resource Manager world"

I just read a small post of #pierreroman with the title Azure Cloud Service VS Azure Resource Manager. Unfortunately I was not able to comment his post (There was an error saving your comment. (Cannot create comment - access denied.)). Therefore and because I think this topic is interesting for many folks who are using azure cloud services right now, I write my "comment" here and send him a tweet. Maybe he or someone else can answer my questions.
I think that more interesting than the "what is the difference between cloud services and resource groups" is the question "should we plan to move from cloud services to azure resource groups?". Is it even possible? Or are we comparing apples to oranges?
What about scaling (for example adding new instances of a worker role with a simple slider or with auto scaling)?
The comparison is kind of apples(Cloud Service) and grocery(ARM) where can manage fruits, meats, and fishes.
But, very first concept of Cloud Service was similar to the ARM. That's why sometimes confusing.
Below quote is from free ebook Azure Web Apps for Developers (download), page 12 and 13.
An Azure Resource Group is a logical container for grouping Azure resources.
Grouping resources this way helps simplify the implementation, deployment, management, and monitoring of resources in the resource group. From a billing perspective, it gives you a way to view costs for the resource group rather than for individual resources, eliminating the need to figure out which resources are related. You can think of an Azure Resource Group as a unit of management.
The last line helps to understand clearly, Azure Resource Group is a unit of management.

Resources