Resource group name doesn't satisfy the constraint pattern /^[-\w\._\(\)]+$/
See original GitHub issue- Package Name: @azure/arm-resources
- Package Version: 4.0.0
- Operating system: MacOS Catalina Version 10.15.7
- nodejs
- version: 10.17.0
- browser
- name/version:
- typescript
- version:
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://docs.microsoft.com
Describe the bug
I have created an Azure resource group from the portal named Instruktører
. Now I am trying to do a GET call for this resource group it is throwing me this error.
(node:57737) UnhandledPromiseRejectionWarning: Error: "resourceGroupName" with value "Instruktører" should satisfy the constraint "Pattern": /^[-\w\._\(\)]+$/.
at failValidation (/Users/turbotindia/Documents/Azure/node_modules/@azure/arm-resources/node_modules/@azure/ms-rest-js/dist/msRest.node.js:461:19)
at Serializer.validateConstraints (/Users/turbotindia/Documents/Azure/node_modules/@azure/arm-resources/node_modules/@azure/ms-rest-js/dist/msRest.node.js:495:21)
at Serializer.serialize (/Users/turbotindia/Documents/Azure/node_modules/@azure/arm-resources/node_modules/@azure/ms-rest-js/dist/msRest.node.js:550:18)
at getOperationArgumentValueFromParameterPath (/Users/turbotindia/Documents/Azure/node_modules/@azure/ms-rest-azure-js/node_modules/@azure/ms-rest-js/dist/msRest.node.js:4720:24)
at getOperationArgumentValueFromParameter (/Users/turbotindia/Documents/Azure/node_modules/@azure/ms-rest-azure-js/node_modules/@azure/ms-rest-js/dist/msRest.node.js:4695:12)
at ResourceManagementClient.ServiceClient.sendOperationRequest (/Users/turbotindia/Documents/Azure/node_modules/@azure/ms-rest-azure-js/node_modules/@azure/ms-rest-js/dist/msRest.node.js:4488:45)
at ResourceGroups.get (/Users/turbotindia/Documents/Azure/node_modules/@azure/arm-resources/dist/arm-resources.js:6302:32)
at msRestNodeAuth.interactiveLogin.then (/Users/turbotindia/Documents/Azure/resourceGroup.js:16:25)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:57737) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:57737) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
From what I understand there is an issue with a character used in the resource group name (ø
).
To Reproduce A sample code to replicate this behaviour.
const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
const azureArmResources = require("@azure/arm-resources");
const subscriptionId = "<your_subscription_id>";
let resourceGroup;
// This works
// resourceGroup = "<any_other_resource_group_name>";
// This doesn't work
resourceGroup = "Instruktører";
msRestNodeAuth.interactiveLogin().then((credentials) => {
const client = new azureArmResources.ResourceManagementClient(credentials, subscriptionId);
client.resourceGroups.get(resourceGroup).then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.error(err);
});
Expected behaviour
The resource group name Instruktører
is a valid name since I have created a resource group with this name from the portal. So the SDK should accept this as a valid name and not throw an error.
Screenshots Resource group which I created.
Additional context N/A
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Issues - GitHub
Resource group name can only contain 'w' and no other alphanumeric characters. Steps to reproduce: Run azure group create 'test-group-name' ' ...
Read more >Set-AzureRmResourceGroup : 'resourceGroupName' does not ...
First you filtered the content of $RGInfo to only the Resource Group name, you cannot add tags to just the name
Read more >'resourceGroupName' does not match expected pattern'^[-\w ...
i am getting error while setting resource group name in azure powershell ... 'resourceGroupName' does not match expected pattern'^[-\w.
Read more >How to fetch resource group name( with pattern matching ...
First is to go with transforming json output to proper object for PowerShell as ... az group list --query "[?contains(name,'kafka')].name".
Read more >Resolve the "Parameter validation failed" error in AWS ...
As a parameter in a child stack. The error occurs when the value of the child stack that's passed from the parent stack...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed here: https://github.com/Azure/azure-rest-api-specs/pull/13492
This is a gap between the portal behavior and the swagger definition regarding the resource group name constraint. Need to involve service team for further explaination.