Azure / Azure/azure-cli

Microsoft.Network Resource Provider "Subscription is not registered with NRP."

Open
#26,489 3 comments 0 reactions 1 assignee Claimed by @zhoxing-ms View on GitHub
act-identity-squad ARM Auto-Assign Azure CLI Team question
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62

Checked and did not see any under these terms: https://github.com/Azure/azure-cli/issues?q=is%3Aissue+is%3Aopen+NRP

**Related command**
I am unable to use my subscription when running an mg deployment command like. `az deployment mg create --name $name --location $location --template-file $file --management-group-id $mgid --parameters networkingSub=$networkingSub`.

**Describe the bug**
I am unable to use my subscription when running an mg deployment command like. `az deployment mg create --name $name --location $location --template-file $file --management-group-id $mgid --parameters networkingSub=$networkingSub`. The subscription is [created using bicep](https://github.com/Azure/ALZ-Bicep/blob/main/infra-as-code/bicep/CRML/subscriptionAlias/subscriptionAlias.bicep).

Even when running the command to register my networking subscription with the networking resource provider using `az provider register --namespace 'Microsoft.Network' --subscription $networkingSub`, I still face this subscription is not registered with NRP error even with retry logic in place. When using other resource provdiers like `az provider register --namespace 'Microsoft.AnyType' --subscription $subscriptionId`, I have no issues and the registration happens without fail.

**To Reproduce**

1. Create a subscription [using bicep](https://github.com/Azure/ALZ-Bicep/blob/main/infra-as-code/bicep/CRML/subscriptionAlias/subscriptionAlias.bicep).
2. Try to interact with this subscription by adding it to a Management Group and deploy some networking resources in a resource group underneath this subscription.

**Expected behavior**
The Microsoft.Network resource provider should register without issue and I should be able to deploy networking resources underneath this subscription.

When using Azure PowerShell I see the expected behavior when trying to register this subscription with the Microsoft.Network resource provider. No issues are faced with Azure PowerShell and no retry logic is needed.
```ps
Set-AzContext -Subscription "$networkingSub"
Register-AzResourceProvider -ProviderNamespace Microsoft.Network
```

**Environment summary**
Locally deployed using Windows.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.