问题标签 [azure-powershell]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
2310 浏览

powershell - 启动/停止特定订阅下的所有 VM

我正在使用 Azure Powershell cmdlet 来启动/停止 VM。

是否有命令可以启动/停止特定订阅下的所有虚拟机而不是单个虚拟机?如果没有,我正在寻找一个脚本来为每个 VM 并行运行以上代码多次。

0 投票
1 回答
1548 浏览

powershell - 确定指定服务和插槽是否存在 Azure 部署

我想知道是否可以确定给定服务(以及相应的插槽(ProductionStaging))是否存在部署。

我发现的只是调用它会在 PowerShell 中Get-AzureDeployment -ServiceName xxxservice抛出一个错误。Get-AzureDeployment : ResourceNotFound: No deployments were found.

0 投票
1 回答
939 浏览

azure - 使用 powershell cmdlet 为 Azure 订阅启用诊断

真的可以使用 powershell cmdlet 为整个 Azure 订阅启用诊断吗?还是应逐个启用诊断(监视 azure 应用程序、监视 vm 和存储帐户)?

在操作管理器控制台中,我们添加了我们的 azure 订阅,导入了 azure 管理包,但操作管理器没有发现该订阅下的 azure 云服务、vm 或存储帐户...我们希望为 azure 订阅启用诊断将解决问题。

0 投票
1 回答
1652 浏览

powershell - 将许多域添加到 azure 网站

我正在将一个非常严肃的多租户应用程序迁移到 Azure,我看到的挑战之一是它托管了一百多个域。

在 Azure 方面,我看到添加自定义域的唯一方法是通过门户手动输入它们。我真的很想用 Azure PowerShell 或(对于这种一次性操作可能不太理想)一种 .Net API 来编写脚本。

我确实找到了这个,这表明它可以使用 REST API 之一完成:通过代码将域添加到 Azure 网站

PowerShell 有什么用吗?

0 投票
3 回答
17654 浏览

powershell - 带有订阅 ID 的 Azure Powershell Select-AzureSubscription

我正在使用 Powershell Azure cmdlet 对我拥有的每个订阅执行一些操作。

但是,我所有的订阅都具有相同的名称。因此,如果我执行以下操作:

它始终适用于相同的订阅,因为订阅仅在订阅 ID 上有所不同。

并且Select-AzureSubscription没有-SubscriptionId参数。

任何想法如何找到解决方法?

0 投票
2 回答
1157 浏览

powershell - 我们可以使用 Java 代码执行 Windows Azure PowerShell

我尝试在网上搜索相同的内容,但找不到任何有用的东西。我浏览了这个这个链接,但他们都只谈论 PowerShell 而不是 Azure PowerShell。

我仍然尝试并得到以下错误

C:\Windows\SysWOW64\WindowsPowerShell\v1.0>powershell.exe Get-AzureVM Get-AzureVM :术语“Get-AzureVM”未被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名称的拼写,或者如果包含路径,请验证路径是否正确并重试。在 line:1 char:1 + Get-AzureVM + ~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Get-AzureVM:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

任何帮助,将不胜感激。先感谢您。

0 投票
3 回答
437 浏览

azure - Import-AzurePublishSettingsFile throws CryptographicException, Internal Error when called from IIS

I am experiencing a problem similar to the one described here:

Import-AzurePublishSettingsFile throws CryptographicException

We are calling Powershell from IIS to programmatically deploy VMs. Part of this process involves loading new Publish Settings Files in for new customers. We are getting the following error when attempting to do so:

I have a hunch this has something to do with the user space, as if I run exactly the same script from an interactive PS session, on the same server, it works fine.

Any ideas on how to troubleshoot this?

Edit: Stack trace from Powershell:

0 投票
2 回答
528 浏览

.net - Azure Cmdlets:字符串未被识别为有效的布尔值

我正在使用Start-AzureWebsite(以及 Stop-AzureWebsite)azure powershell cmdlet 来启动 azure 网站。它工作了大约 3 个月,并在 2 天前(2014 年 1 月 31 日)停止工作(环境没有任何变化)。现在两个 cmdlet 都崩溃并出现以下错误:

我试图在不同的帐户和不同的机器上运行它,但没有成功。我还尝试安装最新版本的 azure sdk。

如果您对此问题有任何建议,请告诉我。

-石油

0 投票
2 回答
1494 浏览

azure-web-app-service - 如何通过 Azure PowerShell 获取 PublishUrl?

我的目标是能够传入站点名称和位置并创建一个新站点,检索适当的凭据/URL 并使用 WebDeploy 部署我的站点。

我从这里使用 Azure Powershell 工具:http: //www.windowsazure.com/en-us/downloads/

我可以创建一个新网站

作为对此的回应,我获得了有关已创建站点的详细信息,包括发布用户名和密码(PublishingUsername 和 PublishingPassword),我没有得到的一条信息是发布 URL(我可以从 Azure 管理门户中检索)在 XML 格式的文件中)。在 XML 文件中,它是 publishProfile 节点上的 publishUrl 属性。

我的问题是,有没有办法通过 PowerShell 获取发布 URL,或者通过 REST API,但我更喜欢 PowerShell。

这是一个类似的问题,听起来似乎还不可能,至少在撰写本文时:如何通过管理 API 获取我的 Azure 网站的 FTP URL?

0 投票
2 回答
1056 浏览

powershell - 使用 Azure Powershell 将第二个 DNS 添加到 VM

我目前正在推出具有 2 个域控制器(两个 VM 也是)的 IaaS 环境 在操作系统适配器设置中静态设置 DNS 不是在 Azure 中采用的方式(重新加载将清除设置)

当我创建 VM 时,我正在通过 powershell 设置 DNS 设置

$myDNS = New-AzureDNS -Name 'myDC01' -IPAddress abcd .. New-AzureVM -serviceName $cloudservice -DnsSettings $myDNS -VNetName $vnetname -waitforboot

这在 ipconfig 中设置了 1 个 DNS 服务器,但是有没有办法添加备用(第二个)DNS 设置?这样我就可以将两个 DC 都放在一个可用性组中,并确保 DNS 得到保证。