-
Ensure that you are logged in to your Windows 10 Virtual Machine using the following credentials:
-
Username: Admin
-
Password: Pa55w.rd
-
-
Observe the Taskbar located at the bottom of your Windows 10 desktop. The Taskbar contains the icons for the common applications we will use in the labs:
-
Microsoft Edge
-
File Explorer
-
Bash on Ubuntu on Windows
-
Windows PowerShell
-
Microsoft Word 2016
Note: You can also find shortcuts to these applications on the Desktop and in the Start Menu.
-
-
On the Taskbar, click the Microsoft Edge icon.
-
In the open browser window, navigate to the Azure Portal (https://portal.azure.com).
-
Enter the email address of your Microsoft account.
-
Click the Next button.
-
Enter the password for your Microsoft account.
-
Click the Sign in button.
-
On the left side of the portal, click the Create a resource link.
-
At the top of the New blade, locate the Search the Marketplace field.
-
Enter the text Service Bus into the search field and press Enter.
-
In the Everything search results blade, select the Service Bus result.
-
In the Service Bus blade, click the Create button.
-
In the Create namespace blade, perform the following actions:
a. In the Name field, enter a globally unique name.
a. Leave the Pricing tier option set to its default value.
a. Leave the Subscription field set to its default value.
a. In the Resource group section, select the Create new option.
a. In the Resource group section, enter the value MOD11SBLA into the empty field.
a. In the Location field, select the East US location.
-
Wait for the creation task to complete before moving on with this lab.
-
On the left side of the portal, click the Resource groups link.
-
In the Resource groups blade, locate and select the MOD11SBLA Resource Group link.
-
In the MOD11SBLA blade, select the Service Bus Namespace you most recently created.
-
In the Service Bus blade, locate the Entities section on the left side of the blade and click the Queues link.
-
In the Queues pane, click the + Queue button at the top of the pane.
-
In the Create queue popup, perform the following actions:
a. In the Name field, enter the value messages.
a. Leave all other fields set to their default values.
a. Click the Create button.
-
Wait for the new queue to be successfully created before moving on with this lab.
-
On the left side of the portal, click the Resource groups link.
-
In the Resource groups blade, locate and select the MOD11SBLA Resource Group link.
-
In the MOD11SBLA blade, select the Service Bus Namespace you most recently created.
-
In the Service Bus blade, locate the Settings section on the left side of the blade and click the Shared access policies link.
-
In the Shared access policies pane, locate the single default policy named RootManageSharedAccessKey and click the policy link.
-
In the SAS Policy popup that appears, locate and record the value in the Primary Connection String field. This value will be used later in this lab.
Review: In this exercise, you created a new Service Bus namespace and recorded a connection string to access queues in the namespace.
-
At the top of the New blade, locate the Search the Marketplace field.
-
Enter the text Storage Account into the search field and press Enter.
-
In the Everything search results blade, select the Storage Account - blob, file, table, queue result.
-
In the Storage Account - blob, file, table, queue blade, click the Create button.
-
In the Create storage account blade, perform the following actions:
a. In the Name field, enter a globally unique name.
a. In the Deployment model section, select the Resource manager option.
a. In the Account kind section, select the Storage (general purpose v1) option.
a. In the Performance section, select the Standard option.
a. In the Replication list, select the Locally-redundant storage (LRS) option.
a. In the Secure transfer required section, select the Disabled option.
a. Leave the Subscription field set to its default value.
a. In the Resource group section, select the Use existing option.
a. In the Resource group section, locate the dropdown list and select the MOD11SBLA option.
a. In the Location field, select the East US location.
a. In the Configure virtual networks section, select the Disabled option.
a. Click the Create button.
-
Wait for the creation task to complete before moving on with this lab.
-
On the left side of the portal, click the Resource groups link.
-
In the Resource groups blade, locate and select the MOD11SBLA Resource Group link.
-
In the MOD11SBLA blade, select the Storage Account you most recently created.
-
In the Storage account blade, click the Blobs link in the center of the blade.
-
In the Blob service blade, click the + Container button at the top of the blade.
-
In the New container dialog that appears, perform the following actions:
a. In the Name field, enter the value messageoutput.
a. In the Public access level list, select the Blob (anonymous read access for blobs only) option.
a. Click the OK button.
-
At the top of the New blade, locate the Search the Marketplace field.
-
Enter the text Logic into the search field and press Enter.
-
In the Everything search results blade, select the Logic App result.
-
In the Logic App blade, click the Create button.
-
In the Create logic App blade, perform the following actions:
a. In the Name field, enter the value ServiceBusWorkflow.
a. Leave the Subscription field set to its default value.
a. In the Resource group section, select the Use existing option.
a. In the Resource group section, locate the dropdown list and select the MOD11SBLA option.
a. In the Location field, select the East US location.
a. In the Log Analytics section, select the Off option.
a. Click the Create button.
-
Wait for the creation task to complete before moving on with this lab.
-
On the left side of the portal, click the Resource groups link.
-
In the Resource groups blade, locate and select the MOD11SBLA Resource Group link.
-
In the MOD11SBLA blade, select the ServiceBusWorkflow Logic App you most recently created.
-
In the Logic App blade, you will see the default Logic App Designer screen. Scroll down and click the Blank Logic App option in the Templates section.
-
In the Logic Apps Designer pane, you will see an open dialog for creating an initial action (trigger).
-
In the Choose an action dialog that displays, perform the following actions:
a. Enter the value Service Bus into the search field.
a. In the search results, select the Trigger named Service Bus - When a message is received in a queue (auto-complete).
a. In the Connection Name field on the next pane, enter the value ServiceBusConnection.
a. In the list of Service Bus namespaces, select the namespace you created earlier in this lab.
a. In the list of policies, select the RootManageSharedAccessKey policy.
a. Click the Create button.
-
In the When a message is received in a queue (auto-complete) step that is created, perform the following actions:
a. In the Queue name list, select the messages option.
a. In the Interval field, enter the value 30.
a. In the Frequency field, enter the value Second.
-
Click the + New Step button in the designer. Click the Add an action button to open the dialog for creating an action.
-
In the Choose an action dialog that displays, perform the following actions:
a. Enter the value Storage Blob into the search field.
a. In the search results, select the Action named Azure Blob Storage - Create Blob.
a. In the Connection Name field on the next pane, enter the value StorageConnection.
a. In the list of Storage accounts, select the account you created earlier in this lab.
a. Click the Create button.
-
In the Create Blob step that is created, perform the following actions:
a. In the Folder path field, enter the value /messageoutput.
a. In the Blob Name field, enter the value @concat(triggerBody()?['MessageId'], '.txt').
a. In the Blob content field, enter the value @string(decodeBase64(triggerBody()?['ContentData'])).
-
At the top of the Logic Apps Designer blade, click the Save button to persist your workflow.
-
At the top of the portal, click the Cloud Shell icon to open a new shell instance.
-
In the Cloud Shell command prompt at the bottom of the portal, type in the following command and press Enter to install the azure package in Node using NPM:
npm install azure
-
Type in the following command and press Enter to open the interactive node terminal:
node
-
Type in the following command and press Enter to import the azure module in Node:
var azure = require('azure');
-
Type in the following command and press Enter to create a new variable for your Service Bus' connection string replacing the placeholder with the value of your connection string recorded earlier in this lab:
var connectionString = '[Service Bus Connection String]';
Make sure you replace the [Service Bus Connection String] placeholder with the connection string for your Service Bus instance. For example, if your connection string is Endpoint=sb://testdbns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=kXUiFkzSg20TrhUhhyNlqjndV/zKALu1S+nikPqIO8U=, your command will look like this:
var connectionString = 'Endpoint=sb://testdbns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=kXUiFkzSg20TrhUhhyNlqjndV/zKALu1S+nikPqIO8U=';
-
Type in the following command and press Enter to create a new client to connect to Service Bus:
var serviceBusService = azure.createServiceBusService(connectionString);
-
Type in the following command and press Enter to send a message to Service Bus using the client.
serviceBusService.sendQueueMessage('messages', { body: 'Hello World' }, function(error) { console.log(error) });
-
In the Resource groups blade, locate and select the MOD11SBLA Resource Group link.
-
In the MOD11SBLA blade, select the Storage Account you most recently created.
-
In the Storage account blade, click the Blobs link in the center of the blade.
-
In the Blob service blade, click the messageoutput container in the list of containers.
-
Observe the newly created blob in your container.
Review: In this exercise, you created a logic app that is triggered by queue messages from Service Bus.
-
At the top of the portal, click the Cloud Shell icon to open a new shell instance.
-
In the Cloud Shell command prompt at the bottom of the portal, type in the following command and press Enter to list all resource groups in the subscription:
az group list
-
Type in the following command and press Enter to delete the MOD11SBLA Resource Group:
az group delete --name MOD11SBLA --no-wait --yes
-
Close the Cloud Shell prompt at the bottom of the portal.
- Close the currently running Microsoft Edge application.
Review: In this exercise, you "cleaned up your subscription" by removing the Resource Groups used in this lab.