question

Nicen-8006 avatar image
0 Votes"
Nicen-8006 asked azure-cxp-api edited

Unable to register Azure CDN as an app using Powershell

Dear support,

I need your help with the below issue.

I was trying to register Azure CDN as an app using PowerShell and I found this article "https://github.com/MicrosoftDocs/azure-docs/commit/080f0d88908a563b2c47759ac2b4facd38ec487b" and I tried to follow the mentioned steps but I got below error when I run "New-AzureRmADServicePrincipal -ApplicationId "205478c0-bd83-4e1b-a9d6-db63a3e1e1c8"

The Error is:

New-AzureRmADServicePrincipal : Object reference not set to an instance of an object. At line:1 char:1 + New-AzureRmADServicePrincipal -ApplicationId 205478c0-bd83-4e1b-a9d6- ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [New-AzureRmADServicePrincipal], NullReferenceException + FullyQualifiedErrorId : Microsoft.Azure.Commands.ActiveDirectory.NewAzureADServicePrincipalCommand

Attached screenshot for more info.

![17347-error.jpg][1]

not-supported-azure
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JamesTran-MSFT avatar image
0 Votes"
JamesTran-MSFT answered JamesTran-MSFT commented

@Nicen-8006
It looks like you might have one too many quotes within your PS command, which could've caused the Application ID to not actually reference an object or App in this case. Can you try running the below command. You can do so using Azure PowerShell on your desktop or Azure Cloud Shell within the Portal. Keep in mind that if you're using your desktop you'll need AzureRM modules unless you'd like to use the Az commands to create a service principle.

New-AzureRmADServicePrincipal -ApplicationId "205478c0-bd83-4e1b-a9d6-db63a3e1e1c8"

17484-cdnsp.jpg

If you have any other questions please let me know.
Thank you for your time!


Additional Links:
Create a service principal
Create a new AD service principal using application id with role assignment


cdnsp.jpg (76.9 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Nicen-8006
I just wanted to check in and see if you're still having issues running the PS commands or if you have any other questions.

Thank you for your time.

0 Votes 0 ·
JamesHamil-MSFT avatar image
0 Votes"
JamesHamil-MSFT answered

Hi, are there any updates with this case? If not, please select the appropriate response as "Answered." Otherwise please let us know how we can assist you.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.