I have a requirement where I need to put a ticket into an azure queue from a SSIS package.
I have previously set up control flows using "Message Queue Tasks" for add a ticket in MSMQ but did not know if there was way to trigger tickets into an azure service bus queue.
What I have tried:
As a alternative solution, I am accessing use a REST web service as a middle man. I trigger the webservice using "Web Service Task" which then puts a ticket in the azure queue.
There are two approaches of solving the problem in general
approach 01 : chicken out.
you could technically have a separate infrastructure piece between your SSIS package and the azure service bus queue which could reference the Azure SDK using nuget and put tickets for you, your SSIS package would then be calling this REST web api to put the ticket in.
approach 02 A : script task with .dll reference
You could reference the Microsoft.ServiceBus.dll inside a script task in the SSIS package which will construct a BrokeredMessage and put it in the queue.
The dll needs to be added to the GAC using gacutil.exe for the script task to work at runtime.
approach 02 B : script task calling azure service bus REST API
You could create a script task which calls and puts message using azure service bus REST API. There is a tutorial available here : https://msdn.microsoft.com/en-us/library/azure/hh416754.aspx but I never happened get beyond the point of sending actual data.
Related
I want to create a web app with node.js where users can schedule tasks that are executed on a specific time entered by the user.
I was thinking to use azure-webjobs or azure-functions for executing said tasks. I understand that scheduling in the azure portal is possible, however I couldn't find an API to schedule a webjob or function programmatically (for example using the Azure REST API).
Is it possible to schedule a azure-webjob or azure-function programmatically?
Azure WebJobs provide a more or less hidden API inside of KUDU called WebJobs API. This API is REST based webservice and it can be used to manage your jobs programmatically.
There are API endpoints available for the Azure WebJob which will be used for triggering the WebJob.
See the following documentation link for details on the list of available endpoints: https://github.com/projectkudu/kudu/wiki/WebJobs-API
Check this article: How to manage Azure WebJobs programmatically?
Also see this article might be helpful.
I have a console application connecting to database and executing DML transactions. This console application is currently scheduled using windows task scheduler. I am planning to migrate this to Azure.
Which is the recommended strategy ?
Should this be moved as Azure webjobs or function apps ?
Since you already have a console project, then it's more easier to use Azure Webjobs to achieve that.
To create a webjob, just create a .zip file which includes the .exe / .dll and other necessary files, then upload to azure. For schedule, please refer to Create a scheduled WebJob. For more details, you can refer to this doc.
Note: there're some limitation of azure webjobs / azure function, see Azure-Web-App-sandbox. But if you only need to connecting to database and executing DML transactions, you can ignore the limits.
And yes, you can also do this via azure function, but since you already have a console project, it's easier to use webjobs.
Is it possible to trigger an VSTS/TFS build based on the condition if a blob in a storage account is updated?
I tried to create a function app, but with little to no result, I cannot trigger a VSTS/TFS build.
Easiest solution (from my understanding) will be to use a logic app:
Create a logic app that is triggered whenever a blob is added/updated into a specific container.
Queue a VSTS build
NOTE
your VSTS account should have "Third-party application access via OAuth" enabled. (Go to Administration > Control panel > Settings page)
According to the official docs, it is possible to:
...start a function when a new or updated blob is detected. The blob contents are provided as input to the function.
Then, the only thing the Azure function should do it to queue a build in VSTS with the help of REST API. You might also want to check the Getting Started page of VSTS REST API docs - it contains the basic samples to quickly get up to speed.
I am currently working on a project in which I need to accomplish the following using a scheduled task in an Azure Mobile Service (if it's possible):
Update a cloud service deployment configuration to put the cloud service into maintenance mode.
Wait a predetermined length of time for any pending work in the cloud service to complete.
Perform a backup of SQL Azure database used by the cloud service.
Wait another predetermined length of time for the backup to complete.
Update the cloud service deployment configuration to bring the cloud service out of maintenance mode.
I've got step 3 figured out already and steps 2 and 4 are relatively trivial to add. My hangup is with updating the cloud service deployment configuration using the Azure Service Management REST Api.
(I've come across no other means of doing this in a Node.js script).
The calls to the endpoint using the provided Node.js module request (example: http://msdn.microsoft.com/en-us/library/windowsazure/jj631641.aspx) are easy enough but the requests must contain a management certificate as per http://msdn.microsoft.com/en-us/library/windowsazure/ee460782.aspx
So my question is: How do I attach my management certificate to the request?
Keeping in mind that this is to be done within a scheduled task (which is a Node.js script).
Management certificate is just a standard certificate file (.cer) (X.509 v3). You can put the contents in a string (Don't kill me for suggesting this) or a table which your script would read.
Once you have the certificate content in hand as a string, you can attach it to the HTTPS request you are making to the Azure service management API. Nate Good has a nice post on how to achieve this with nodejs. He is reading the certs from files, so you'll have to change that part and replace it with your cert strings.
I'd like to know what is the best practice for doing incremental production deployment in azure with servicebus,
How to ensure that the messages don't get deleted when deploying a new version
Is there a backup mechanism to save the messages and load it back after the deployment is complete?
The Windows Azure Service Bus is a service which runs outside of your deployment, similar to Windows Azure SQL Database or Windows Azure Storage. This means that it does not depend on your deployment: you can deploy, remove, re-deploy your application without impacting the messages present in the Service Bus.
The only thing you'll need to take care of when you deploy a new version of your application is that the messages available in Service Bus Queues / Subscriptions might have been sent by the old version of the application. So take into account that the new version of your application will need to be compatible with these "old" message formats.