Menu
Install Azure Data Studio. To install Azure Data Studio onto your Mac: Visit the Azure Data Studio download page, and click the.zip file for macOS; Once the.zip file has finished downloading, double click it to expand its contents; Drag the.app file to the Applications folder (the file will probably be called Azure Data Studio.app). By default, all applications on a Mac, including Visual Studio for Mac, are single-instance apps. If the application you want to use is already open, selecting the associated icon again opens the running instance rather than a new one.
Today I’m going to show you how to add a second NIC to an Azure Virtual Machine and how to change the MAC Address on your Azure Virtual Machine.
I had this requirement while automating the deployment of a component that is license locked to the MAC address of a NIC. In itself this is not a problem but combined with Azure and our deployment workflow it presented some challenges. As part of the deployment workflow the Azure VM is deleted and restored from a VHD image. Since this process creates a new VM and new NICs you also get a new MAC address every time which caused the license check to fail.
To avoid interfering with the normal operation of the networking in Azure I thought it best to add a second NIC on its own subnet and use it for the license while leaving the default NIC intact.
So recently I did a article Azure: Point To Site VPN (Remote Access User VPN) but what if you want to use the same solution for a remote mac user? Firstly you will want to download the VPN package (and have a valid client/user certificate, see the link above). Create Azure apps Visual Studio for Mac pricing Access developer tools, cloud services, software, support, and training—the complete package for building your next great app for any platform. Start free with the Visual Studio for Mac Community edition.
So the first step was to create a new subnet and to give it a different IP address range from the default NIC.
The second step is to add another NIC to the VM when you create it:
Add-AzureNetworkInterfaceConfig -Name 'LicenseNIC' -SubnetName 'License' -VM $NewVM
Thirdly there is the PowerShell script to change the MAC address when the new VM is created. Credit to Jason Fossen for the original script. This script is executed on the VM itself not against Azure. You can use Invoke-Command for instance as part of your deployment script to execute it remotely on the VM.
In the script I identify the NIC used for licencing based on it’s IP address 10.32.2.* and then I retrieve the index number for this NIC. This index is the same one used to find this NIC in the registry.
$indexobj = Get-WmiObject win32_networkadapterconfiguration -Filter 'ipenabled = 'true' | Where-Object {$_.IPAddress -like '10.32.2.*' } | Select-Object -Property Index
$index = $indexobj.index
The registry key for the NIC always has four digits, so padleft, then get the key.
$index = $index.tostring().padleft(4,'0')
$regkey = get-item 'hklm:systemCurrentControlSetcontrolclass{4D36E972-E325-11CE-BFC1-08002BE10318}$index'
![Mac Mac](https://excellence-it.co.uk/wp-content/uploads/2018/11/OneDrive-1.png)
Set a new value for MAC address, in this case 30-D5-1E-DD-F2-A5.
$regpath = 'hklm:systemCurrentControlSetcontrolclass{4D36E972-E325-11CE-BFC1-08002BE10318}$index'
set-itemproperty -path $regpath -name 'NetworkAddress' -value $('30-D5-1E-DD-F2-A5')
If the NIC is not refreshed the new MAC address is not picked up by the licensing component we used. This may not be neccesary depending on your use case.
ipconfig.exe /release ''$($thenic.netconnectionid)'' | out-null
$thenic.disable() | out-null
$thenic.enable() | out-null
ipconfig.exe /renew ''$($thenic.netconnectionid)'' | out-null
If you now look at your NIC properties you will see the new MAC address.
PS. On my Windows 10 machine it didn’t display properly on the NIC properties but you can use ipconfig /all to see the MAC address.
- How To Convert A Linux Disk Or Image File To VMDK File - July 8, 2020
- Read SMART Attributes Using PowerShell And Smartmontools - February 10, 2020
- How To Install OMS Agent On Server Core - June 25, 2018
Azure Functions v3 was recently released on 09 December 2019 with support for .NET Core 3 and .NET Standard 2.1. Here's how to install the new runtime in Visual Studio and Visual Studio for Mac.
1. Install .NET Core 3
![Azure App On Mac Azure App On Mac](/uploads/1/3/4/1/134121243/979871398.png)
Azure Functions v3 runs on .NET Core 3.
To install .NET Core 3, visit Download .NET Core.
I recommend selecting the latest
LTS
version. LTS
stands for Long Term Support
, meaning that Microsoft is committed to supporting this specific version of .NET Core with bug fixes for approximately 2-3 years.As of today, the current
LTS
version of .NET Core is .NET Core 3.1.2. Update the CSPROJ
Let's ensure our
csproj
file has been updated for Azure Functions v3. Bein sports app.https://technologyclever105.weebly.com/instrumentsapp-mac-download.html. We'll need to set the following three things:
- Target Framework is
netcoreapp3.1
(or higher) - Microsoft.NET.Sdk.Functions NuGet Package is v3.0.1 (or higher)
- AzureFunctionsVersion is
v3
Here is an example from my GitTrends app: https://github.com/brminnick/GitTrends/blob/master/GitTrends.Functions/GitTrends.Functions.csproj
3a. (Visual Studio) Update Azure Functions Runtime
Note: If you're using Visual Studio for Mac, skip to the next section
Let's now install the Azure Functions Runtime for Visual Studio 2019
- In Visual Studio, select Create a new project
2. In the Create a new project window, in the search bar, enter
Functions
3. In the Create a new project window, in the search results, select Azure Functions
4. In the Create a new project window, select Next
Rss mac app store. 5. In the Create a new Azure Functions Application window, stand by while it is 'Getting information about the latest function tools..'
6. In the Create a new Azure Functions Application window, once the new tools have been downloaded, click Refresh 8x8 mac app polycom.
3b. (Visual Studio for Mac) Update Azure Functions Runtime
Note: If you are using Visual Studio on PC, you may skip this step
Let's now install the Azure Functions Runtime for Visual Studio for Mac
- In the Visual Studio for Mac window, select New
2. In the New Project window, on the left-hand menu, under Cloud, select General
3. In the Configure you Azure Functions Project window, standby until it finishes installing the Azure Functions components
4. Conclusion
Mac Os On Azure
Updating to Azure Functions v3 requires a couple steps:
Azure App Mac
- Installing .NET Core 3
- Updating our
csproj
- Updating Visual Studio's Azure Functions Runtime
Azure App Mac
If you'd like to see an existing Azure Functions project using v3, feel free to check the Azure Functions Backend in my GitTrends app: https://github.com/brminnick/GitTrends/tree/master/GitTrends.Functions