This is useful for when you have a hyper v host only nope with CLI and no GUI
DRConfigurator.exe /r /friendlyname MyServerName /credentials “C:\Software\vaultname_asr_DayMonthDateYear.VaultCredentials”
loading...
loading...
This is useful for when you have a hyper v host only nope with CLI and no GUI
DRConfigurator.exe /r /friendlyname MyServerName /credentials “C:\Software\vaultname_asr_DayMonthDateYear.VaultCredentials”
PreReq’s
connect-azaccount
2. Select Azure Subscription
Select-AzureSubscription -Current -SubscriptionName $AzureSubscriptionName
3.
# Upload the VHD
$urlOfUploadedImageVhd = (‘https://$storageaccount.blob.core.windows.net/’ + $containername + ‘/’ + $vhdName)
Add-AzVhd -ResourceGroupName $resourceGroup -Destination $urlOfUploadedImageVhd -LocalFilePath $localPath
This will try and convert the VHDX file to VHD
To be compatible with Azure, Add-AzVhd will automatically try to convert VHDX files to VHD, and resize VHD files to N * Mib using Hyper-V Platform, a Windows naitive virtualization product.
For more information visit https://aka.ms/usingAdd-AzVhd
MD5 hash is being calculated for the file \\XXXX\f$\TEMP\XXXX.VHD.
MD5 hash calculation is completed.
Elapsed time for the operation: 00:16:32
Creating new page blob of size 68719477248…
Detecting the empty data blocks in the local file.
Detecting the empty data blocks completed.
Elapsed time for upload: 00:32:37
LocalFilePath DestinationUri
————- ————–
\\vbr01\f$\TEMP\XXXX.VHD https://$storageaccount.blob.core.windows.net/$containername/XXXX.VHD
You will have the new Blob URL for the VHD, now you need to make a managed disk from it – https://aidanfinn.com/?p=20441
Once you have a managed disk you can then create a VM from that Managed Disk
Recently after creating a site with Virtual Machines sitting on a Vnet on the application Gateway , I could not add this subnet to be routable from the Virtual Network Gateway
The solution is to use Vnet peering to create a new subnet for the Virtual network gateways and peer this with the Application Gateway subnet
You then need to enable Remote Gateways per below , so VPN clients can route to the Application Gateway Subnet via a route :
Recently we had moved some onpremise Server 2016 machines to Azure using ASR. When trying to activate them using the Microsoft steps
It did not work, we had to use Automatic Virtual Machine Activation (AVMA)
slmgr /ipk C3RCX-M6NRP-6CXC9-TW2F2-4RHYD
I got deployment failed when trying to change a SQL servers License from Express to Developer.
I checked the Server and it had developer license installed on SQL
Looking at the JSON
Enter internal URL , will be presented external URL
Login to Azure Active Directory. Locate Usage & insights , under Monitoring
Select “Users registerd for Multi-Factor Authentication”
Can also be done in powershell : https://dirteam.com/sander/2020/05/14/todo-optimize-the-azure-multi-factor-authentication-methods-used-throughout-your-organization/
Monitoring with PowerShell: Monitoring the used MFA type for O365/Azure.
#Downloads the Docker File from Dock Hub
dock pull %dockerusername%/%dockername%:latest
#Runs the Docker File on port 80 if the container is active on port 3000 ( Test go to http://localhost )
docker run -p 80:3000 %dockerusername%/%dockername%:latest
#List current dockers running
docker ps -a
#Stop the container by id ( found from above )
docker stop ad5b49ba5476
#Clear Stopped Containers
docker container prune
**Create an Azure Container or reuse an existing one**
**Run the below in Azure Shell**
#Show credentials for login and save username and password
az acr credential show --name %azurecontainer%
**Run on Docker PC**
#Login to Azure Docker
docker login %azurecontainer%.azurecr.io --username name %azurecontainer%
#Tag docker for upload
docker tag %dockerusername%/%dockername% name %azurecontainer%.azurecr.io/%dockername%:latest
#Push Docker to Azure
docker push name %azurecontainer%.azurecr.io/%dockerusername%/%dockername%:latest
#Create Azure Service plan
az appservice plan create --name %serviceplanname% --resource-group %azureresourcegroup% --sku S1 --is-linux
#Add Docker App to Azure Service Plan
az webapp create --resource-group %azureresourcegroup% --plan %serviceplanname% --name %appname% --deployment-container-image-name %azurecontainer%.azurecr.io/%dockername%:latest
#Set the details to access the Docker
az webapp config container set --name %appname% --resource-group %azureresourcegroup% --docker-custom-image-name %azurecontainer%.azurecr.io/%dockername%:latest --docker-registry-server-url https://%azurecontainer%.azurecr.io --docker-registry-server-user %azurecontainer% --docker-registry-server-password %passwordfromshowcredential%
#Make the app live on its specific port e.g. 3000
az webapp config appsettings set --resource-group %azureresourcegroup% --name %appname% --settings WEBSITES_PORT=3000
Test the app
http://%appname%.azurewebsites.net/