设置主机名通过Azure的PowerShell的天青网站 [英] Setting Host Names for Azure Websites via Azure Powershell

查看:265
本文介绍了设置主机名通过Azure的PowerShell的天青网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用PowerShell的主机分配到Azure的网站实例。我已经验证域/主机我想补充的是有效的,甚至到了Azure的门户网站,以验证其标识的新域名是有效的。出于某种原因,虽然,下面的脚本不设置主机名,因为我相信它应该,当我一个新的值设置为主机名之后检查,这是完全一样的,因为它以前。谁能告诉我什么,我在剧本做错了?

I'm attempting to use PowerShell to assign hosts to an Azure Website instance. I've verified the domain/host I want to add is valid and even went to the Azure portal to verify it identified the new domain as valid. For some reason though, the below script is not setting the HostNames as I believe it's supposed to and when I check after setting a new value to HostNames, it's the exact same as it was before. Can someone tell me what I'm doing wrong in the script?

$newHosts = @("mysite.azurewebsites.net","www.mysite.com")

$result = Get-AzureWebsite -Name mysite | Set-AzureWebsite -HostNames $newHosts

我抽离我的真实情况和域名的例子。

I've abstracted away my real instance and domain names for the example.

推荐答案

原来你是不是应该包括蔚蓝分配的主机名(mysite.azurewebsites.net),只包括自己的自定义的主机。它没有错误,只是如果包括蔚蓝分配的主机不会做任何事情。

Turns out you are not supposed to include the azure assigned host name (mysite.azurewebsites.net) and only include your own custom hosts. It doesn't error, it just won't do anything if you include the azure assigned host.

这篇关于设置主机名通过Azure的PowerShell的天青网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆