Azure-docs: Module Missing Parameter

Created on 4 Sep 2019  ·  21Comments  ·  Source: MicrosoftDocs/azure-docs

In both the Az module and AzureRM module, the New-AzSqlServerDnsAlias and New-AzureRmSqlServerDnsAlias cmdlets are missing -DnsAliasName or any variation of the parameter. Any attempt to "guess" the parameter fails. Additionally, the documentation does not include any reference to the actual -DnsAliasName parameter or an equivalent parameter. How are we supposed to use this cmdlet if it doesn't even take in a parameter to specify the actual alias?

Documentation in question (Az version):

https://docs.microsoft.com/en-us/azure/sql-database/dns-alias-powershell

AND ALSO:

https://docs.microsoft.com/en-us/powershell/module/az.Sql/New-azSqlServerDnsAlias?view=azps-2.6.0


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri3 assigned-to-author operationsubsvc product-issue review-team-triage sql-databassvc triaged

All 21 comments

@DevGuy80 please provide us with the link to the documentation you are following so we can better assist.

@DevGuy80 thanks for that! I have assigned this to one of our SQL engineers to investigate further.

@MicahMcKittrick-MSFT Thank you! Having this cmdlet working would be great!

@DevGuy80 The AzureRM version of the doc has been updated to use the newer Az module:

Screenshot (227)

And then looking at the AND ALSO doc link the examples includes the -DNSAliasName parameter:

$serverDNSAlias = New-AzSqlServerDnsAlias -ResourceGroupName rg -ServerName serverName -DnsAliasName aliasName

Does this parameter throw an error in your case? What are you seeing?

It does. I can provide detailed screenshots tomorrow.

Attached are a few screenshots. First, one screenshot shows the Command tool does not even include DnsAliasName as an option. When filling out that command you get the error that the “DNS Alias name” cannot be empty or null. Upon adding “-DnsAliasName” to the script, you get a different error – “Cannot bind parameter because parameter Name is specified more than once.

[cid:[email protected]]

This is my console output:

[cid:[email protected]]

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Mike Ubezzi notifications@github.com
Sent: Monday, September 9, 2019 6:02:06 PM
To: MicrosoftDocs/azure-docs azure-docs@noreply.github.com
Cc: DevGuy80 rmmoore80@outlook.com; Mention mention@noreply.github.com
Subject: Re: [MicrosoftDocs/azure-docs] Module Missing Parameter (#38296)

@DevGuy80https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDevGuy80&data=02%7C01%7C%7Cb9ae3804726f4381e9cb08d735715ab2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637036633270524130&sdata=2g4Dt8Nn6NyCmhTPQ34GfFKGe2D3p3upb%2FrptR1oHQw%3D&reserved=0 The AzureRM version of the doc has been updated to use the newer Az module:

[Screenshot (227)]https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F37126106%2F64569348-1499b300-d312-11e9-9992-c239b6de6ccd.png&data=02%7C01%7C%7Cb9ae3804726f4381e9cb08d735715ab2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637036633270534141&sdata=dB97PCM7TMXPd2r%2BqWa5meOkyZnfFxTjvCL1B84oVZ8%3D&reserved=0

And then looking at the AND ALSO doc link the exampleshttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Faz.Sql%2FNew-azSqlServerDnsAlias%3Fview%3Dazps-2.6.0%23examples&data=02%7C01%7C%7Cb9ae3804726f4381e9cb08d735715ab2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637036633270544152&sdata=r3AHXx%2BhUz7pZCcSuKr2v43bqj6Ff1rddCligYSAV40%3D&reserved=0 includes the -DNSAliasName parameter:

$serverDNSAlias = New-AzSqlServerDnsAlias -ResourceGroupName rg -ServerName serverName -DnsAliasName aliasName

Does this parameter throw an error in your case? What are you seeing?

@DevGuy80 Screen captures did not display. Can you send them to me, and I will post them if you are having issues. Please click on this link to send to AzCommunity.

I am experiencing the following issue:
The script is unable to find my resource group and it is wanting to move a DNS alias from SQL Server 1 to SQL Server 2. Why?

Screenshot (234)

@DevGuy80 I am experiencing a differant issue but do want to have your screen captures added to this issue to have that information available. I am going to assign this to the content author and have this documentation updated.

Attached in a different manner. Let me know if these work.

Ryan

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Mike Ubezzi notifications@github.com
Sent: Wednesday, September 11, 2019 2:21:38 PM
To: MicrosoftDocs/azure-docs azure-docs@noreply.github.com
Cc: DevGuy80 rmmoore80@outlook.com; Mention mention@noreply.github.com
Subject: Re: [MicrosoftDocs/azure-docs] Module Missing Parameter (#38296)

@DevGuy80https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDevGuy80&data=02%7C01%7C%7C83b3cc7a59b64244745708d736e4e338%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637038228994516267&sdata=wipw4Vgtkz8qedpmplPY92CAEHACNtCgcga13vhFqug%3D&reserved=0 I am experiencing a differant issue but do want to have your screen captures added to this issue to have that information available. I am going to assign this to the content author and have this documentation updated.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoftDocs%2Fazure-docs%2Fissues%2F38296%3Femail_source%3Dnotifications%26email_token%3DANC53PKZG5KKA3V26PZS4TDQJEZLFA5CNFSM4ITVD6FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6PNPEY%23issuecomment-530503571&data=02%7C01%7C%7C83b3cc7a59b64244745708d736e4e338%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637038228994526272&sdata=snEu4%2FxgKGnDPP0qZZwP0S7bAuai4SXEfhyY6GSN%2Fwc%3D&reserved=0, or mute the threadhttps://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FANC53PJZMIHGZ2FQ5OPSH63QJEZLFANCNFSM4ITVD6FA&data=02%7C01%7C%7C83b3cc7a59b64244745708d736e4e338%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637038228994546306&sdata=IptDpywqLkrlecDCKrVT%2F87WpjS%2BBg2vbhs0HEeKGjo%3D&reserved=0.

@DevGuy80 Based on my testing it appears that the latest version of cmdlet uses -Name instead of -ServerDNSAliasName as the positional parameter. Please try it out and confirm that you are able to create the alias

I re-ran my script based on your feedback and I get the following error:

PS C:\Users\rmmoo> New-AzSqlServerDnsAlias -Name drivendata-dev.database.driven-data.com -ResourceGroupName DrivenData-V2 -ServerName drivendata-dev
New-AzSqlServerDnsAlias : Server DNS Alias name cannot be empty or null. It can only be made up of lowercase letters 'a'-'z', the numbers 0-9 and the hyphen. The hyphen may not lead or trail in the name.
At line:1 char:1

  • New-AzSqlServerDnsAlias -Name drivendata-dev.database.driven-data.com ...
  • ~~~~~~~~~~~~~~~~~

    • CategoryInfo : CloseError: (:) [New-AzSqlServerDnsAlias], CloudException

    • FullyQualifiedErrorId : Microsoft.Azure.Commands.Sql.ServerDnsAlias.Cmdlet.NewAzureSqlServerDNSAlias

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Ryan Moore
Sent: Tuesday, September 10, 2019 4:33:05 PM
To: MicrosoftDocs/azure-docs reply@reply.github.com; MicrosoftDocs/azure-docs azure-docs@noreply.github.com
Cc: Mention mention@noreply.github.com
Subject: RE: [MicrosoftDocs/azure-docs] Module Missing Parameter (#38296)

Attached are a few screenshots. First, one screenshot shows the Command tool does not even include DnsAliasName as an option. When filling out that command you get the error that the “DNS Alias name” cannot be empty or null. Upon adding “-DnsAliasName” to the script, you get a different error – “Cannot bind parameter because parameter Name is specified more than once.

[cid:[email protected]]

This is my console output:

[cid:[email protected]]

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Mike Ubezzi notifications@github.com
Sent: Monday, September 9, 2019 6:02:06 PM
To: MicrosoftDocs/azure-docs azure-docs@noreply.github.com
Cc: DevGuy80 rmmoore80@outlook.com; Mention mention@noreply.github.com
Subject: Re: [MicrosoftDocs/azure-docs] Module Missing Parameter (#38296)

@DevGuy80https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDevGuy80&data=02%7C01%7C%7Cb9ae3804726f4381e9cb08d735715ab2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637036633270524130&sdata=2g4Dt8Nn6NyCmhTPQ34GfFKGe2D3p3upb%2FrptR1oHQw%3D&reserved=0 The AzureRM version of the doc has been updated to use the newer Az module:

[Screenshot (227)]https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F37126106%2F64569348-1499b300-d312-11e9-9992-c239b6de6ccd.png&data=02%7C01%7C%7Cb9ae3804726f4381e9cb08d735715ab2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637036633270534141&sdata=dB97PCM7TMXPd2r%2BqWa5meOkyZnfFxTjvCL1B84oVZ8%3D&reserved=0

And then looking at the AND ALSO doc link the exampleshttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Faz.Sql%2FNew-azSqlServerDnsAlias%3Fview%3Dazps-2.6.0%23examples&data=02%7C01%7C%7Cb9ae3804726f4381e9cb08d735715ab2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637036633270544152&sdata=r3AHXx%2BhUz7pZCcSuKr2v43bqj6Ff1rddCligYSAV40%3D&reserved=0 includes the -DNSAliasName parameter:

$serverDNSAlias = New-AzSqlServerDnsAlias -ResourceGroupName rg -ServerName serverName -DnsAliasName aliasName

Does this parameter throw an error in your case? What are you seeing?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoftDocs%2Fazure-docs%2Fissues%2F38296%3Femail_source%3Dnotifications%26email_token%3DANC53PLDFQZG4GB3PI6VYDLQI3BV5A5CNFSM4ITVD6FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6JFQQQ%23issuecomment-529684546&data=02%7C01%7C%7Cb9ae3804726f4381e9cb08d735715ab2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637036633270554157&sdata=zZ%2BVC4WMYXiGVAH0p2MSF0hjKu8xjxaxwM2XlE%2BHu8I%3D&reserved=0, or mute the threadhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FANC53POYTMQBDE2AEC45IZ3QI3BV5ANCNFSM4ITVD6FA&data=02%7C01%7C%7Cb9ae3804726f4381e9cb08d735715ab2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637036633270564162&sdata=xsRrGck7217PZjzeMH4ijoKjvIxSoOBfk7X84Y4%2FVdA%3D&reserved=0.

The error is because of having dots(.) in your alias. Can you try with a simple string without any dots to confirm if it works?

That worked. So this is NOT a command to add custom DNS aliases from our own domain, correct? I misunderstood the intention of this command I think. Here is the command that ran:

Connect-AzAccount
New-AzSqlServerDnsAlias -Name drivendata-dev2 -ResourceGroupName DrivenData-V2 -ServerName drivendata-dev

The results:

Account SubscriptionName TenantId Environment
------- ---------------- -------- -----------
ryan.[email protected] Pay-As-You-Go 96154abf-1d08-4172-80e7-c8f899dfd9ed AzureCloud

ResourceGroupName : DrivenData-V2
ServerName : drivendata-dev
DnsAliasName : drivendata-dev2
Id : /subscriptions/7aef6f3f-1bfa-49e3-ac74-7991a041903b/resourceGroups/DrivenData-V2/providers/Microsoft.Sql/servers/drivendata-dev/dnsAliases/drivendata-dev2

Ryan

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Rohit Nayak notifications@github.com
Sent: Wednesday, September 11, 2019 5:37:07 PM
To: MicrosoftDocs/azure-docs azure-docs@noreply.github.com
Cc: DevGuy80 rmmoore80@outlook.com; Mention mention@noreply.github.com
Subject: Re: [MicrosoftDocs/azure-docs] Module Missing Parameter (#38296)

The error is because of having dots(.) in your alias. Can you try with a simple string without any dots to confirm if it works?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoftDocs%2Fazure-docs%2Fissues%2F38296%3Femail_source%3Dnotifications%26email_token%3DANC53PJW2N6ZCSOD42DCUD3QJFQIHA5CNFSM4ITVD6FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6P7GMI%23issuecomment-530576177&data=02%7C01%7C%7C932bb7b8a7454c4f5b6808d737003289%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637038346287522505&sdata=s6lTkHv%2B2n73R0fwKvqXaXOiUaVNFbHg%2BAJzMBMhx9Y%3D&reserved=0, or mute the threadhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FANC53PLNL6ON5IZYEKKFUTDQJFQIHANCNFSM4ITVD6FA&data=02%7C01%7C%7C932bb7b8a7454c4f5b6808d737003289%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637038346287522505&sdata=CvwqwdLPifPROhUCFKaO3OgKwW3SufEwEJ7uicR0xJg%3D&reserved=0.

@DevGuy80 you are correct in stating that this is "NOT a command to add custom DNS aliases from our own domain". For that check out Private DNS Zones feature under Azure Networking.

Thank you for all your help!

We will now proceed to close this thread. If there are further questions regarding this matter, please comment and we will gladly continue the discussion.

@rohitnayakmsft
Hello Rohit,

Regarding the statement mentioned above "you are correct in stating that this is "NOT a command to add custom DNS aliases from our own domain". For that check out Private DNS Zones feature under Azure Networking."
How about if we want to use just the custom Domain of ours in the SQL Server?
Is that an option?

PS: We just want to use Public Network to connect and not Private.

@DevGuy80 you are correct in stating that this is "NOT a command to add custom DNS aliases from our own domain". For that check out Private DNS Zones feature under Azure Networking.

@rohitnayakmsft, One is able to just create a CNAME record in a public DNS zone and connect to AzSQLdb using the custom record by disabling certificate verification. However, I think the AzSQLdb product group should provide documentation on how to do a certificate verification to avoid man-in-the-middle attacks while using custom DNS alias in a public DNS zone for Azure SQL database.

@SakethTubati

Was this page helpful?
0 / 5 - 0 ratings