Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/itpropro/serverlessworkshop


https://github.com/itpropro/serverlessworkshop

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# ServerlessWorkshop

# 1. Setup/Preparation
## 1. VMs
![Log Analytics parameters](/images/ServerlessWorkshop-0010.jpg)
![Log Analytics parameters](/images/ServerlessWorkshop-0009.jpg)
![Log Analytics parameters](/images/ServerlessWorkshop-0008.jpg)
![Log Analytics parameters](/images/ServerlessWorkshop-0007.jpg)
![Log Analytics parameters](/images/ServerlessWorkshop-0006.jpg)
![Log Analytics parameters](/images/ServerlessWorkshop-0005.jpg)
![Log Analytics parameters](/images/ServerlessWorkshop-0004.jpg)
## 2. Azure Function

## 3. Logic App
![Log Analytics parameters](/images/ServerlessWorkshop-0000.jpg)
# 2. Network Watcher configuration

To configure Azure Network Watcher, you need to enable Network Watcher on your subscription for the designated region first.
To activate Network Watcher
1. Search for Network Watcher in the Azure Portal
2. Select and expand the region you want to activate
3. Click on the three dots to the right and select "Enable network watcher"

![Network Watcher](/images/ServerlessWorkshop-0002.jpg)

# 3. Azure Functions configuration
## 1. Configure MSI

To configure the Azure Function to use an managed service identity browse to the Function Apps pane in the Azure Portal and select the Function App where you want to enable a MSI
1. On the platform features pane of your function app select the Identity option found under the category Networking
![fapp1](/images/ServerlessWorkshop-0012.jpg)

2. Set the status for a system assigned identity to On and save

![fapp2](/images/ServerlessWorkshop-0013.jpg)

3. Configure permissions by adding the role !role! at the subscription scope for the MSI

## 2. Write Azure Functions Code

To run and debug Azure functions locally with Visual Studio Code, you need the following requirements:
- Install PowerShell Core (https://github.com/PowerShell/PowerShell/releases)[https://github.com/PowerShell/PowerShell/releases]
- Install the .NET Core SDK 2.1+ (https://dotnet.microsoft.com/download)[https://dotnet.microsoft.com/download]
- Install Azure Functions Core Tools version 2.4.299 or later `npm i -g azure-functions-core-tools@2`
- Install Azure Functions extension in Visual Studio Code (https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions)[https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions]

# 6. Event Grid configuration
Azure Logic Apps have built-in Azure integration. Therefore the Event Grid Subscription for blob creation is created during Logig App Configuration.

# 7. Logic App configuration
Azure Logig Apps can handles the events that are generated by the Event Grid Subscription. To create a Logic App that sends an email every time a new blob on a specific storage account is created perform the following steps:

1. Create a new empty Logic App
2. Start with the common trigger 'When an Event Grid resource event occurs'
3. Connect the Logic App to Event Grid using ur Azure Credentials
4. Open the Logic Apps Designer
5. Configure the common trigger as shown in the screenshot:
![lapp1](/images/ServerlessWorkshop-0011.jpg)
6. Create an action using the Standard: Office 365 Outlook ation template
7. Choose as action Send an email and connect a valid O365 account
8. Supply recipient, subject and body for the automatic mail
9. Save the configuration

# 8. Simulate VM traffic
1. Clone this repo: https://github.com/ubeeri/Invoke-UserSimulator
2. Import the script modules:
`PS>Import-Module .\Invoke-UserSimulator.ps1`
3. Run only the Internet Explorer function on the local host:
`PS>Invoke-UserSimulator -StandAlone -IE`
# 9. Bring everything together