How to access the publishing credentials of a website using Azure RM and ResourceId

雨燕双飞 提交于 2019-12-12 03:24:59

问题


I'm trying to get the publishing credentials of a website using AzureRm and PowerShell using Invoke-AzureRmResourceAction and PowerShell.

In this answer @David Ebbo explains how to do it using ResourceName and ResourceGroupName as parameters of the Invoke-AzureRmResourceAction cmdlet. I've tried that and it works perfectly and the object I get back has an Id property that looks a lot like a ResourceId. I've tried using that Id as the ResourceId parameter and removing ResourceName and ResourceGroupName but I get an error saying the resource doesn't exist.

I'd like to use ResourceId because I need to automate this for a series of Websites in different resource groups and I only have (easy) access to the ResourceId (and the ResourceId of the website looks really similar to the Id of the publishing credentials object I get using ResourceName and ResourceGroupName).

Thanks!


回答1:


It is working fine for me with the following command:

Invoke-AzureRmResourceAction -ResourceId /subscriptions/$sub/resourceGroups/$rg/providers/Microsoft.Web/sites/$sitename/config/publishingcredentials -Action list -ApiVersion 2015-08-01 -Force -Debug


来源:https://stackoverflow.com/questions/36801349/how-to-access-the-publishing-credentials-of-a-website-using-azure-rm-and-resourc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!