Written by James McDonald

August 22, 2019

Function App Settings

Default URL Format

https://toggen-fa.azurewebsites.net/api/HttpTrigger1?code=<FUNCTION_KEY>

Default URL for HTTP Triggered function app has /api/HttpTrigger1 which is configured by two settings

 /api/HttpTrigger1
{routePrefix}{Route Template}
  1. routePrefix which by default is api
  2. Function name which in the example above is HttpTrigger1

routePrefix is set in host.json which is found by clicking the Function app title and clicking the Function App Settings tab or link and scrolling down to the host.json text edit field.

The function name part of the URL can be changed by setting Route Template under FunctionName (HttpTrigger1) => Integrate

You don’t need to put a leading slash in front of the Route Template value as shown below you can just put in CustomRoute or whatever you want and it will be fine.

But you can get it to show a custom path but the routePrefix is held in host.json under Function app settings. Version 2 has slightly different format add an “extensions” wrapper

{
  "version": "2.0",
  "extensions": {
    "http": {
        "routePrefix": ""
    }
  }
}

https://toggen-fa.azurewebsites.net/toggen/Route?code=<FUNCTIONorADMINKEY>

Service Bus Topic Versus Queue

A topic can have multiple clients or web apps subscribe and get the message. A queue can only have one client receive each message.

az servicebus namespace create --resource-group Toggen-Test --location australiasoutheast  --name tgn-sb-ns1
az servicebus topic create --name tgn-sb-topic1 --namespace-name tgn-sb-ns1 --resource-group Toggen-Test
az servicebus queue create --name tgn-sb-queue1 --namespace-name tgn-sb-ns1 --resource-group Toggen-Test

Virtual Network Gateway

How to get connected clients on an OpenVPN Gateway

Get-AzVirtualNetworkGatewayVpnClientConnectionHealth -VirtualNetworkGatewayName Toggen-VPNGW2 -ResourceGroupName Toggen-VPNResourceGroup | Format-List


VpnConnectionId           : OVPN_9AF0754C-AD3A-8CB9-EE95-BDD7E898C576
VpnConnectionDuration     : 3911
VpnConnectionTime         : 09/04/2019 13:28:57
PublicIpAddress           : 121.208.198.43:61218
PrivateIpAddress          : 10.18.19.2
VpnUserName               : clien1
MaxBandwidth              : 39000000
EgressPacketsTransferred  : 11634
EgressBytesTransferred    : 2054436
IngressPacketsTransferred : 12666
IngressBytesTransferred   : 798752
MaxPacketsPerSecond       : 1

Connect to file share from MacOS

The provided code to connect to an Azure file share in Mac doesn’t work. Throwing the error ‘route to host’

You also have to edit the code they provide and create the mount point

mount_smbfs -d 777 -f 777 //tgnstorage01:<PASSWORD>@tgnstorage01.file.core.windows.net tgnstorage01

The above code as provided by the Azure Portal doesn’t work

# create a mount point
mkdir tgnstorage01

# remove the password and append the share name (toggen-fileshare01)
mount_smbfs -d 777 -f 777 //[email protected]/toggen-fileshare01 tgnstorage01

# you will then be prompted for the password and it then connects

New-PSDrive only visible in the Powershell Session it is called from

Just tried to connect to an Azure File Share in Powershell and found it wasn’t showing in Windows Explorer or when running net use

Turns out that it is visible but only in the powershell session. As you can in the image net use or explorer will not show the drive

If you want to have it seen in Windows Explorer use the -Persist option:

New-PSDrive -Name S -PSProvider FileSystem -Persist -Root "\\tgnstorage01.file.core.windows.net\toggen-fileshare01"

https://community.spiceworks.com/topic/649234-powershell-mapped-drive-not-showing-in-my-computer

Practice Exams

I find that I learn best by first going through the ACloudGuru training, and completing all the demos, duplicating them in Azure.

After this first learning phase I have consumed so much knowledge that I’m not sure what I don’t know. A good practice exam I find is vital to round out my knowledge for the exam and highlight knowledge gaps.

In the past I’ve taken the practice exam multiple times, discovered my weak areas, then read the Microsoft documentation to better understand what I’m not getting. If I can get 95% and above for practice tests then I’m relatively confident I will pass the real exam

Yes they are a cost but I learnt from when I did my NT4 MCSE that brain dumps are not a good way of building knowledge so much of the information in them is not correct

Here is a link to the ‘official’ Microsoft Practice Test

https://au.mindhub.com/az-300-microsoft-azure-architect-technologies-microsoft-official-practice-test/p/MU-AZ-300

Here is the official MS blurb about the exam: https://www.microsoft.com/en-us/learning/exam-az-300.aspx

As of Aug 2019 some Powershell Snippets are Not provided as course material

I have had to pause the training and type the power shell scripts out

# Send a message to an Event Grid Topic
#
# EventGrid.ps1
$endpoint = (Get-AzEventGridTopic -ResourceGroupName 'Toggen-EventGripRG' -Name 'Toggen-EventGridTopic').Endpoint
$keys = Get-AzEventGridTopicKey -ResourceGroupName 'Toggen-EventGripRG' -Name 'Toggen-EventGridTopic'

$endpoint
$keys

$eventID = Get-Random 99999

$eventDate = Get-Date -Format s

$htbody = @{
    id = $eventID
    eventType = 'recordInserted'
    subject='myapp/vehicles/motorcycles'
    eventTime = $eventDate
    data= @{
        make="Ducati"
        model="Monster"
    }
    dataVersion="1.0"
}

$body = "["+(ConvertTo-Json $htbody)+"]"
Invoke-WebRequest -Uri $endpoint `
-Method "POST" -Body $body `
-Headers @{"aeg-sas-key" = $keys.Key1}

Remove all the Demo Resource Groups at the end of the Day

With a Free Trial account you $280 AUD of credit

To not pay for things while you are not using them you can bulk delete your Resource Groups with the following powershell snippet

This will give you a “clean” portal with (hopefully) no resources consuming your credits

Incidentally I’m using the Az module on powershell core on MacOS and it seems to work fine

Warning don’t do this in a production environment!!!

Get-AZResourceGroup | Remove-AzResourceGroup -Force -Verbose

If you have multiple Resource Groups to remove add the -AsJob argument

Get-AzResourceGroup | Remove-AzResourceGroup -Force -Verbose -AsJob

Assigning Azure Active Directory Premium P2 License

When assigning a P2 License to your user. The AZ-300 course states you need to edit the user and apply a Location. After adding and saving the location I found adding the P2 license failed

So an extra step is after assigning a location to your Global Administrator user account you need to logout and log back in to pick up the Location change in order to successfully assign the license

Showing Network Security Groups Associated with Interfaces and / or Subnet

If you are try to figure out which of your Network Security Groups is associated with a Subnet. Use the Edit Columns button to add the “ASSOCIATED WITH” column to the NSG View

AzureRM vs AZ

For some reason the docs talk about AzureRM but that has been replaces by the Az module.

I think I prefer the Az module because I installed PowerShell Core on my macbook and have successfully run the command I want with it. Pretty much the commands just go from being Get-AzureRMBlah to GetAXBlah

Connecting to Azure with AzureRM

# need to have 5.1 + powershell I think
Install-Module -Name AzureRM -AllowClobber -Scope CurrentUser
Connect-AzureRmAccount
Get-AzureRmRemoteDesktopFile -ResourceGroupName <ResourceGroup> -Name <YourVMName> -Launch

Free account hits a quota limit

I just tried to create a new VM in my free account and all the VM’s from the pick list were greyed out and a quota warning was displayed when I hovered over the ‘i’ icon.

Seems that the free account has a 4vCPU limit. When you delete VMs to come under the limit you may have to wait for a number of minutes before you can create a new V

Load Balancer does not get a Public IP

Problem: Created a Load Balancer and despite assigning a FrontEnd IP Configuration to it the Public IP wasn’t or being created…

Resolution: Dynamic IP address will get assigned only after you create a Health Probe and Load Balancing Rule for that Load Balancer.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Squarespace Image Export

To gain continued access to your Squarespace website images after cancelling your subscription you have several...

MySQL 8.x GRANT ALL STATEMENT

-- CREATE CREATE USER 'tgnrestoreuser'@'localhost' IDENTIFIED BY 'AppleSauceLoveBird2024'; GRANT ALL PRIVILEGES ON...

Exetel Opt-Out of CGNAT

If your port forwards and inbound and/or outbound site-to-site VPN's have failed when switching to Exetel due to their...