Azure

Getting started with Azure Event Grid Extension for Visual Studio Code

I love Visual Studio Code and all the extensions that are available. It has become my preferred editor for almost everything (replacing Notepad++), except for when developing in Visual Studio.

Recently there is a new extension that was made available for working with Azure Event Grid. Typically when working with Azure Event Grid I use a tool called Postman to send test messages to my Azure Event Grid resource. But now with this latest extension you can use Visual Studio Code.

In this post I’ll walk through how to get started and use the Azure Event Grid extension for Visual Studio Code. Let’s get started.

Prerequisites

Before we can begin we need to make sure we have the following installed and setup:

  1. An Azure Subscription. If you don’t have an Azure Account, you can sign up for one today for free and receive $200 in credits by selecting "Create a Free Azure Account…" or selecting "View->Command Palette" and searching for "Azure: Create an Account"
  2. Install Visual Studio Code
  3. Visual Studio Code Extensions:
    • Install extension Azure Tools for Visual Studio Code
    • Install extension Azure Event Grid

Connecting to your Azure Subscription

First thing we need to do is connect to your Azure subscription. This will happen automatically when you go to the Azure tab in Visual Studio Code. You can also sign in from the Command palette and searching for “Azure: Login”.

image

image

image

Create an Event Grid Topic

Now that you’re signed in, let’s go ahead and create an Event Grid topic.

1. In the Event Grid Topics pane, click on the + button to create a new topic:

image

2. Then select your Azure Subscription to associate this topic with:

image

3. Now provide a topic name. I will use “VSCodeEventGridTopicDemo” for my demo:

image

4. Next select a resource group for your topic. I will use  “RGVSCodeEventGridDemo” for my demo:

image

5. Select your location for the resources:

sshot-636

6. Done. In a few seconds your Azure Event Grid will be created and displayed in Visual Studio Code:

image

image

You can login to your Azure Subscription and see everything we just created. Keep your Azure Subscription loaded in the browser as we’ll use it for the next section.

image

Create Event Grid Subscription

Now that we have an Event Grid Topic setup we need to create a subscription to receive the events we send it.

1. Here I will create a new Azure Function app:

image

2. Now create a new Event Grid Trigger function and after it’s created click on the Add Event Grid subscription link:

image

3. Fill in the details relating to the Azure Event Grid Topic we created earlier and then press the Create button:

image

Your Event Grid Topic now has an Event Grid Subscription and is ready to test!

Generating Mock Events

Apart from managing your Event Grids resources in Visual Studio Code, you can also generate and send mock events which is great for testing purposes. Instead of using Postman to do this, I find the Event Grid Extension better and mocking and sending events. So let’s get started now mocking some events.

1. To generate a mocked event, right click on your Event Grid Subscription in Visual Studio Code and select Create Mock Event Generator:

image

2. A new file will be created with all the details for generating mocked events for this subscription. The pattern property is defined with regex patterns for generating random data. You will noticed I changed the data section pattern value with regex pattern to generate the mocked data for my event:

image

3. At the top of the event generator file will be two links: Send Events and Preview Events. The actions do exactly as they say and are what you want to use when generating your mocked events.

image

4. If we click on Preview Events, another file is created with a preview of mocked event data to be sent. Notice the different values between the events. This is from the regex logic defined in the event generator. This can be customized to generate data appropriate for your needs.

image

5. Now click on Send Events link at the top of the event generator file and go to your Azure Portal where you previously defined your Azure Function for your Event Grid Topic, and you will see in the logs your mocked events:

sshot-647

As you can see the Azure Event Grid extension for Visual Studio Code is very powerful and is a handy tool to use in your Azure development.

Enjoy!

Reference

Create your free Azure account

Azure Event Grid Overview

Azure Event Grid Documentation

Introduction to Azure serverless with Azure Functions, Logic Apps and Azure Event Grid

AzureDevelopment

Connecting your code to the cloud with Visual Studio Connected Services

With each release of Visual Studio it’s getting easier to connect your application to Azure services. To access Visual Studio Connected Services, go to your projects Overview which can be accessed by right clicking on your project and select Overview.

image

Then select the Connected Services tab on the left to show the list of Connected Services available in your Visual Studio instance. More connected services can be installed from either the Visual Studio Marketplace or from within Visual Studio by going to the Tools –> Extensions and Updates… menu item.

image

To configure a particular Connected Service, just click on it and follow the prompts to wire up the desired Azure service.

Connected Services

With the announcement of what’s new in for Azure Development in Visual Studio on May 30 2018, support for three more Azure services were made available:

For a full list of available Connected Services take a look at the Microsoft Visual Studio Marketplace.

Enjoy!

References

New Updates for Azure Development in Visual Studio

Visual Studio Marketplace

AI

Download the Developer’s Guide to Building AI Applications

O'Reilly  E-book

Thinking about getting started with AI can be a daunting task. Thankfully there is a free e-book called A Developer’s Guide to Building AI Applications that is available to help get you started.

Artificial intelligence (AI) is accelerating the digital transformation for every industry, with examples spanning manufacturing, retail, finance, healthcare, and many others. At this rate, every industry will be able to use AI to amplify human ingenuity. In this e-book, Anand Raman and Wee Hyong Tok from Microsoft provide a comprehensive roadmap for developers to build their first AI-infused application.

This e-book provides an easy introduction to the tooling, infrastructure, and services provided by Microsoft AI Platform for creating powerful, intelligent applications. With this e-book you will learn the key ingredients needed to develop an intelligent chatbot. In addition you will also…

  • Understand how the intersection of cloud, data, and AI is enabling organizations to build intelligent systems.
  • Learn the tools, infrastructure, and services available as part of the Microsoft AI Platform for developing AI applications.
  • Teach the Conference Buddy application new AI skills, using pre-built AI capabilities such as vision, translation, and speech.
  • Learn about the Open Neural Network Exchange.

Download your copy now.

Enjoy!

    References

    https://info.microsoft.com/ww-landing-ai-developers-bot-ebook.html

    Uncategorized

    Azure Files shared by VMs in a Dev Team

    Roy Kim on Azure, Office 365 and SharePoint

    Azure File is a service in Azure Storage Accounts such that I look at it a managed network file share. For a further introduction read Introduction to Azure Files

    A practical use case for me in a development team scenario is where each team member has its own or shared Azure Virtual Machine and there is a need to share files. A traditional approach I have seen is using on-premises network file shares.

    The type of files one can store are software installation files, scripts, local Git repos, developer and system admin documentation, etc. But I wouldn’t suggest this to be a replacement for project and document management solutions such as SharePoint or TFS.

    Other alternative approaches may not feasible such as Dropbox or online cloud drives where they have network policies and security policies that discourage or limit use. Or on-premises network file shares may not be accessible or the…

    View original post 320 more words

    Uncategorized

    Azure Logic Apps for Document Content Approval

    Roy Kim on Azure, Office 365 and SharePoint

    Logic Apps is an Azure service for enterprise integration. It comes with many connectors including from outside of the Microsoft ecosystem. In this blog post, I will show an implementation and key implementation points that will facilitate an approval process for approving a document in SharePoint Online.

    Business Scenario

    1. User publishes a document for approval.
      LogicAppContentApproval3LogicAppContentApproval1
    2. Assigned approver gets an email to either approve or reject
      LogicAppContentApproval2
    3. Document is set as approved or rejected.
      LogicAppContentApproval3

    The business process will be integrating the following three Office 365 services.

    • SharePoint Online – Document Library
    • Office 365 User Profile with Email
    • Outlook

    The Logic App Design
    LogicAppContentApproval4

    Implementation Details

    1. To trigger this Logic App, it done through any modification of the document item properties such as the user action of publishing.
    2. We must get the file metadata of the document specifically the ETag which represents the file version. This is for future use. Note this is not…

    View original post 345 more words

    Database

    Installing Extensions in SQL Operations Studio

    Just like VS Code, extensions provide more functionality to SQL Operations Studio. These extensions can come from Microsoft or the community.

    Adding Extensions to SQL Operations Studio

    1. Open the Extensions manager by going to the View menu and selecting Extensions. After clicking on the Extensions menu item, the Extensions navigation icon shows up on the left side. I’m not sure why this isn’t always available like it is in VS Code.

    image

    2. Browse and select an available extension. At this time there are 9 extensions available to choose from. 

    image

    3. Click on the green button to install the desired extension. In my case I’m trying to install RedGate SQL Search which is a tool I use in SQL Server Management Studio. This will download the extension but if you try to double click and run it, the installation will fail. Instead you need to install it from SQL Operations Studio.

    4. From SQL Operations Studio, press Ctrl/Cmd+Shift+p, and type Extensions: Install from VSIX and then press enter.

    image

    5. You should then see a notification in the bottom right corner of SQL Operations Studio indicating the extension has successfully been installed.

    image

    Enjoy!

    References

    What is Microsoft SQL Operations Studio

    Installing SQL Operations Studio

    Extending the functionality of SQL Operations Studio

    CommunityMVP

    Callon Campbell Awarded Microsoft MVP – Azure

    mvp_logo_horizontal_preferred_cyan300_rgb_300ppi

    On June 1, 2018 I received notification from Microsoft that I was awarded the Microsoft Most Valuable Professional (MVP) award in the category of Azure for 2018-2019. This is my first MVP award and I feel truly honored, excited and thankful. I could not have got here without all the support from the community, so thank you! I look forward to continuing my work with the community and working towards my renewal next year.

    image

    In case the above image doesn’t load, here is what the letter states…

    Dear Callon Campbell,

    Congratulations! We’re pleased to present you with the 2018-2019 Microsoft Most Valuable Professional (MVP) award in recognition of your exceptional technical community leadership. We appreciate your outstanding contributions in the following technical communities during the past year:

    · Microsoft Azure

        

    Congratulations to all the other newly awarded, or renewed Microsoft MVP’s all over the world! You truly are an amazing community

    Enjoy!

    References

    Microsoft MVP Award

    Callon Campbell MVP Profile