Month: September 2017

Azure – First look into “Event Grid Subscriptions”

This blog takes a first look at the “Event Grid” service by Azure. Microsoft announced this service in August 2017. This is still in public preview as of writing this blog.

Azure Event Grid allows you to easily build applications with event-based architectures. You select the Azure resource you would like to subscribe to and give the event handler or WebHook endpoint to send the event to. Event Grid has built-in support for events coming from Azure services, like storage blobs and resource groups. Event Grid also has custom support for application and third-party events, using custom topics and custom webhooks.

You can use filters to route specific events to different endpoints, multicast to multiple endpoints, and make sure your events are reliably delivered. Event Grid also has built in support for custom and third-party events.

event-grid-functional-model

We shall create a simple “Event Grid Subscription” which comes under Event Grid. This Event Subscription will monitor one of Azure Resource Group for events. Trigger an Azure automation runbook, in case if any event occurs on the resource group.

Below is the event types that the event subscription will monitor:

RG_Event_Types.jpg

  1. Search for the “Event Subscription”search_event_subscription
  2. Fill in the required details and click on CREATE. Enter your Azure Automation Runbook’s webhook under the “Subscriber Endpoint”. Thus, your runbook will be triggered when ever any event under the specified runbook occurs.create_event_sub
  3. Once the “Event Subscription” is created. Create a simple resource (like public IP), and we can see that our runbook is triggered. [Open JOBS pane under the runbook to verify that the runbook has run]trigger_runbook

 

Follow this link, if you are looking for Azure APIs to create Event Subscriptions.

Follow this link for more information about Azure Event Grid.

 

Looking for free PowerShell scripts? Check out my Powershell Contributions under Microsoft Technet Script Centre

Advertisements

Windows – Convert windows partition from GPT to RAW

This blog will teach you how to convert a “GPT” partition to “RAW” using Windows Command Prompt.

  1. Bring up the windows disk partition tool
    C:\Users\manju>diskpart
  2. List the existing disks
    DISKPART> list disk
  3. Select the disk that you want to change to “RAW” type
    DISKPART> select disk 3
  4. Now type “clean” to convert any partition (GPT in this example) to “RAW”
    DISKPART> clean
  5. Verify by listing the disks
    DISKPART> list disk

 

Screenshot:

convert_GPT_2_RAW

Powershell – SQL Server pre configuration

This script can be used as a pre-configuration script in case if you want to attach a disk and partition it. Later use the partition as SQL Data and Log folder.

Below is the script flow:

1. Creates a log file in C:\temp folder for logging purpose.

2. Checks for the attached disks and checks for RAW partition.

3. Initializes the RAW to GPT.

4. Creates two partitions of equal size, format them to NTFS with drive letters ‘R’ and ‘S’. (Different drive letters can be provided by changing the appropriate variables)

5. Configure the SQL Server, to use, ‘R’ and ‘S’ as Data and Log directory respectively.

6. Validate the SQL Server service status.

Note: Tested and validated on SQL Server 2012

Download the Powershell script: SQL Server pre configuration

Screenshots:

 

R_and_S_folder

 

temp_data_log_folders

 

database_config