Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a reason to allow max length as 90 in resource group definition name #20

Open
azsec opened this issue Jan 1, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@azsec
Copy link

azsec commented Jan 1, 2020

I look into Azure Blueprint module (ResourceGroupDefinition class) and not sure why it allows max length 90 only.

"virtualMachineResourceGroup": {
    "name": "[concat(parameters('ags_projectCode'), '-', parameters('ags_projectStage'), '-vm', '-rg')]",
    "location": "[parameters('ags_resourceGroupLocation')]",
    "metadata": {
        "displayName": "Virtual Machine resource group"
    }
}

It should of allowed longer to satisfy complex naming convention. To fix the above issue I had to cut the total string length of name 's value. Replacing params with prefix ags by g as follows passed the validation

"virtualMachineResourceGroup": {
    "name": "[concat(parameters('g_projectCode'), '-', parameters('g_projectStage'), '-vm', '-rg')]",
    "location": "[parameters('ags_resourceGroupLocation')]",
    "metadata": {
        "displayName": "Virtual Machine resource group"
    }
}
@alex-frankel
Copy link
Contributor

Thanks for bringing this up. We are aware of this issue, but it has only come up one other time, so it is not high in our priority list for our backlog. I will pass this on to the rest of the time and see if we can squeeze it in.

@alex-frankel alex-frankel added the bug Something isn't working label Jan 9, 2020
@AzureArchitecture
Copy link

AzureArchitecture commented Jan 30, 2020

I have the same issue. I tried to use variables but got a function error. Are variables not supported?

    "variables": { 
      "shared-rg": "[concat('rg-',parameters('orgTag'),'-shared-',parameters('Env'),'-',parameters('suffix'))]",
      "adap-rg": "[concat('rg-',parameters('orgTag'),'-adap-',parameters('Env'),'-',parameters('suffix'))]",
      "mgmt-rg": "[concat('rg-',parameters('orgTag'),'-mgmt-',parameters('Env'),'-',parameters('suffix'))]",
      "network-rg": "[concat('rg-',parameters('orgTag'),'-network-',parameters('Env'),'-',parameters('suffix'))]"
    },

@azsec
Copy link
Author

azsec commented Jan 30, 2020

I have the same issue. I tried to use variables but got a function error. Are variables not supported?

    "variables": { 
      "shared-rg": "[concat('rg-',parameters('orgTag'),'-shared-',parameters('Env'),'-',parameters('suffix'))]",
      "adap-rg": "[concat('rg-',parameters('orgTag'),'-adap-',parameters('Env'),'-',parameters('suffix'))]",
      "mgmt-rg": "[concat('rg-',parameters('orgTag'),'-mgmt-',parameters('Env'),'-',parameters('suffix'))]",
      "network-rg": "[concat('rg-',parameters('orgTag'),'-network-',parameters('Env'),'-',parameters('suffix'))]"
    },

What error have you encountered? Mine was due to the limitation that the PowerShell module doesn't allow (Name value is not greater than 90 chars).

Note that if you use Azure Blueprint PowerShell module you need to follow the standard blueprint as code that Alex suggests. I also wrote some tips here to use with large Azure blueprint https://azsec.azurewebsites.net/2020/01/04/essential-tips-for-building-a-large-azure-blueprint/

@nbwdk
Copy link

nbwdk commented Mar 29, 2021

Getting hit by this same issue. The errors comes because, we want to control how naming of the resource groups are generated.
Considering creating the Resource Groups with an ARM template as well.

@iamgayatriray
Copy link

When will this be resolved ?

@alex-frankel
Copy link
Contributor

There is no plan to resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants