We are using Azure SQL template to deploy VMs with managed disks instead of storage blobs. Unfortunately, the auto generated managed disk names are not desired and we cannot find a way to change them in the deployment template.
Is there a way to rename a managed disk post deployment? (or during)
Well, it is super easy to give them names. there's a name property for that...
"storageProfile": {
"imageReference": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "2016-Datacenter",
"version": "latest"
},
"osDisk": {
"createOption": "FromImage",
"name": "somename" <<< THIS IS IT
}
},
I'm not sure that its possible to rename after you've created the disk. might be possible if you create a managed disk out of managed disk and you would be able to supply the name for the new one.
Related
I am currently deploying some new azure VMs using a template. This template contains a link to a VHD image and uses availability sets.
After having a look at the azure docs, I cannot seem to tell or find out if it's possible to use my current procedure to deploy the VM in a specific zone.
I changed my template to use zones rather than sets but when I use it in Azure CLI I have this error message returned:
"Virtual Machines deployed to an Availability Zone must use managed disks."
I then tried to add the managed disk section to the template without success.
Below there is the pseudocode of the template related to the storage of the VM:
"storageProfile": {
"osDisk": {
"managedDisk": {
"storageAccountType": "StandardSSD_LRS"
},
"osType": "Linux",
"name": "myName.vhd",
"createOption": "FromImage",
"image": {
"uri": "myUri.vhd"
},
"vhd": {
"uri": "myVhdImageUri.vhd"
},
"caching": "ReadWrite"
}
}
You have to convert disk to managed disk first. Then you will be able to use it in your template.
I have an Azure ADLS storage account called eventcoadltest and I have a container called eventconnector-transformed-data-fs.
I have deployed this ADLS through an ARM template but I need to create a directory inside of eventconnector-transformed-data-fs as shown below (the folder debugging was created through the UI but I need to achieve the same with an ARM template):
I have found some posts that indicate this is not possible but it can be bypassed with some workarounds:
How to create empty folder in azure blob storage
Use ARM template to create directories in Azure Storage Containers?
How to create a folder inside container in Azure Data Lake Storage Gen2 with the help of 'azure-storage' Package
ARM template throws incorrect segments lengths for array of storage containers types
how to create blob container inside Storage Account using ARM templates
Microsoft Azure: How to create sub directory in a blob container
How to create an azure blob storage using Arm template?
How to create directories in Azure storage container without creating extra files?
How to create a folder inside container in Azure Data Lake Storage Gen2 with the help of 'azure-storage' Package
I have tried to modify my ARM template as well to achieve a similar result but I haven't had any success.
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountDLName": {
"type": "string"
},
"sku": {
"type": "string"
},
"directoryOutput":{
"type": "string"
}
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2021-02-01",
"sku": {
"name": "[parameters('sku')]",
"tier": "Standard"
},
"kind": "StorageV2",
"name": "[parameters('storageAccountDLName')]",
"location": "[resourceGroup().location]",
"tags": {
"Contact": "[parameters('contact')]"
},
"scale": null,
"properties": {
"isHnsEnabled": true,
"networkAcls": {
"bypass": "AzureServices",
"virtualNetworkRules": [],
"ipRules": [],
"defaultAction": "Allow"
}
},
"dependsOn": [],
"resources": [
{
"type": "storageAccounts/blobServices/containers",
"name": "[concat('default/', 'eventconnector-raw-data-fs/test')]",
"apiVersion": "2021-02-01",
"properties": {},
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountDLName'))]"
]
}
]
}
]
}
The following code was modified for trying to create the folders inside of the containers.
"type": "storageAccounts/blobServices/containers",
"name": "[concat('default/', 'eventconnector-raw-data-fs/test')]"
The reason why I am trying to solve this problem is because I won't have access to create folders in our production environment, so that's why I need to do the deployment fully through ARM. How can I create this folder with the deployment script? Is there another alternative for achieving my desired result? Any idea or suggestion is welcome :)
this doesn't make any sense, as you can not create folders in Azure Storage. They don't have folders. blobs are individual objects\entities. you are confused to believe folders exist, because UI renders them as folders, however THERE ARE NO FOLDERS in a Azure Storage Blob Container.
TLDR: you can not do this at all no matter how hard you try
After some research I found out that it is possible to create a folder via Databricks with the following command:
dbutils.fs.mkdirs("dbfs:/mnt/folder_desktop/test/uploads")
I had to configure Databricks with my Azure Datafactory in order to run this command.
I've been trying to get Premium managed disks (SSD) enabled for Azure Virtual Machine Scale Sets, but I don't seem to get it setup.
Standard (HHD) seems to work for managed disks.
Anybody got this working?
Just pick SSD capable VM's when creating the VMSS.
The VMSS portal page would say that its still using HDD, but if you check the actual resource properties it would say:
"storageProfile": {
"osDisk": {
"createOption": "FromImage",
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Premium_LRS"
}
},
"imageReference": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "2016-Datacenter",
"version": "latest"
}
},
Does anybody know how to set up Service Fabric cluster with VMs on managed disks(both OS and Data)? I would be very interested to know how to do this using template config.
You need to change VMSS api version to 2016-04-30-preview and storageProfile to this:
"storageProfile": {
"imageReference": {
"publisher": "[parameters('vmImagePublisher')]",
"offer": "[parameters('vmImageOffer')]",
"sku": "[parameters('vmImageSku')]",
"version": "[parameters('vmImageVersion')]"
},
"osDisk": {
"createOption": "FromImage"
"managedDisk": {
"storageAccountType": "Standard_LRS"
# defauls to Standard_LRS,
# you can choose to pick Premium_LRS if your VM size supports premium storage
# or you can omit this node completely if you need standard storage
}
}
}
Storage Accounts are redundant when using managed disks (you don't need them, Azure handles that for you).
According to the documentation I can enable the Azure Event Hubs Archive feature using an Azure Resource Manager template. The template takes a blobContainerName argument:
"The blob container where you want your event data be archived."
But afaik it's not possible to create a blob container using an ARM template, then how am I supposed to enable the Archive feature on an Event Hub?
The purpose of the ARM template is to provision everything from scratch, not to manually create some of the resources using the portal.
It wasn't possible before to create containers in your storage account, but this has been changed. New functionality has been added to the ARM template for Storage Accounts which enable you to create containers.
To create a storage account with a container called theNameOfMyContainer, add this to your resources block of the ARM template.
{
"name": "[parameters('storageAccountName')]",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"kind": "StorageV2",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"accessTier": "Hot"
},
"resources": [{
"name": "[concat('default/', 'theNameOfMyContainer')]",
"type": "blobServices/containers",
"apiVersion": "2018-03-01-preview",
"dependsOn": [
"[parameters('storageAccountName')]"
],
"properties": {
"publicAccess": "Blob"
}
}]
}
To my knowledge, you can use None, Blob or Container for your publicAccess.
It's still not possible to create Queues and Tables, but hopefull this will be added soon.
Just like you said, there is no way to create a blob in Azure ARM Template, so the only logical answer to this question is: supply existing blob at deployment time. One way to do that would be to create a blob with powershell and pass it as a parameter to ARM Deployment.