Azure / Azure/azure-quickstart-templates

Test-AzureName is SM not ARM!

Open
#3,131 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Bicep
Stars
14.9k
Forks
16.2k
Avg merge
6d 21h
Merged PRs (30d)
6

Description

In https://github.com/Azure/azure-quickstart-templates/blob/master/201-vmss-windows-customimage/scripts/deployScaleSet.ps1#L78

Line 78 executes `Test-AzureName` which is a Service Management cmdlet.
This triggers `Select-AzureSubscription` if there's no SM context, which results in this:
```
2017-02-24T09:42:37.534 System.ApplicationException: No default subscription has been
designated. Use Select-AzureSubscription -Default to set the default
subscription.
at ...
```

`Test-AzureName` is good for Cloud Services, Storage and Service Bus in Service Management stack only:
https://docs.microsoft.com/en-us/powershell/servicemanagement/azure.compute/v1.6.1/test-azurename

>Tests whether a Microsoft Azure cloud service name, storage service name or service bus namespace name exists or not.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with scripts/deployScaleSet.ps1 at line 78 and inspect how the deployment script validates the name. Reproduce the failure in an environment without a Service Management context, then identify the appropriate ARM-compatible validation path. Done means the script no longer requires a default Service Management subscription and the scale-set deployment proceeds successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cloud
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.