我需要使用Power Shell腳本將通知中心層免費更改爲標準。幫助我的腳本。我沒有找到任何東西。如何使用PowerShell更改NOTIFICATION HUBS計費層?
我試過使用自動比例設置,但它不工作。
我需要使用Power Shell腳本將通知中心層免費更改爲標準。幫助我的腳本。我沒有找到任何東西。如何使用PowerShell更改NOTIFICATION HUBS計費層?
我試過使用自動比例設置,但它不工作。
要更改計費層,您需要更新您的名稱空間。
可以使用Service Bus管理API創建/更新通知中心名稱空間。這裏有一篇關於how to create a namespace的文章,另一篇關於how to create a hub。更新應該與那些非常相似。
或者,這裏是REST API to create or update a Notification Hubs namespace。
另外,您可以使用下面的請求主體來更改層。這是使用在鏈接中提到的服務管理API之上
請求方法:PUT
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}?api-version=2016-03-01
請求體
{
"Location": [Resource Location],
"Tags": null,
"Properties": {
"NamespaceType": "NotificationHub"
},
"sku":{
"name":"Standard"
}
}
以下是你可以用它來更新層次的PowerShell腳本示例。你需要安裝azure powershell sdk。
$skuTier = "Standard"
Set-AzureRmNotificationHubsNamespace -ResourceGroup $ResourceGroup -Namespace $namespaceName -Location $location -Tags $tags -skuTier $skuTier -Force
還是我得到的錯誤。 –
Set-AzureRmNotificationHubsNamespace:找不到與參數名稱'skuTier'匹配的參數。 在線:1 char:127 + ...「West US」-skuTier $ skuTier -Force + ~~~~~~~~ + CategoryInfo:InvalidArgument:(:) [Set-AzureRmNotificationHubsNamespace],ParameterBindingException + FullyQualifiedErrorId:NamedParameterNotFound,Microsoft.Azure.Commands.NotificationHubs.Commands.Namespace.SetAzureNotificationHubsNamesp –
請看看[如何提問](https://stackoverflow.com/help/how-to-ask) –