質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
PowerShell

Windows PowerShellはコマンドラインインターフェースであり、システム管理を含むWindowsタスク自動化のためのスクリプト言語です。

Azure

Azureは、マイクロソフトのクラウド プラットフォームで、旧称は Windows Azureです。PaaSとIaaSを組み合わせることで、 コンピューティング・ストレージ・データ・ネットワーキング・アプリケーションなど多くの機能を持ちます。

Q&A

解決済

1回答

1445閲覧

Az PowerShell 1.8.0でCloud Service(クラシック)のデプロイIDを取得したい。

currysita

総合スコア40

PowerShell

Windows PowerShellはコマンドラインインターフェースであり、システム管理を含むWindowsタスク自動化のためのスクリプト言語です。

Azure

Azureは、マイクロソフトのクラウド プラットフォームで、旧称は Windows Azureです。PaaSとIaaSを組み合わせることで、 コンピューティング・ストレージ・データ・ネットワーキング・アプリケーションなど多くの機能を持ちます。

0グッド

0クリップ

投稿2019/04/24 08:19

編集2019/04/24 09:31

PowerShellからAzure内のリソースを管理できないかと試行錯誤しています。
以下のURLを参照しています。
https://docs.microsoft.com/en-us/powershell/azure/overview?view=azps-1.8.0

目的は、CloudService(クラシック)のデプロイIDを取得する事です。

リソースグループとリソース名を指定して、クラウドサービス(クラシック)を取得する事は成功しました。

PowerShell

1$cloudService = Get-AzResource -ResourceGroupName "ResourceGroupHoge" -ResourceName "CloudServiceHoge"

しかし、このCloudServiceのメンバーには、デプロイIDが存在しません。以下はGet-Memberを使用してメンバーの一覧を取得したものです。

PowerShell

1$cloudService | Get-Member 2 TypeName: Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels.PSResource 3 4Name MemberType Definition 5---- ---------- ---------- 6Equals Method bool Equals(System.Object obj) 7GetHashCode Method int GetHashCode() 8GetType Method type GetType() 9ToString Method string ToString() 10ChangedTime Property System.Nullable[datetime] ChangedTime {get;set;} 11CreatedTime Property System.Nullable[datetime] CreatedTime {get;set;} 12ETag Property string ETag {get;set;} 13ExtensionResourceName Property string ExtensionResourceName {get;set;} 14ExtensionResourceType Property string ExtensionResourceType {get;set;} 15Id Property string Id {get;set;} 16Identity Property Microsoft.Azure.Management.ResourceManager.Models.Identity Identity {get;set;} 17Kind Property string Kind {get;set;} 18Location Property string Location {get;set;} 19ManagedBy Property string ManagedBy {get;set;} 20Name Property string Name {get;set;} 21ParentResource Property string ParentResource {get;set;} 22Plan Property Microsoft.Azure.Management.ResourceManager.Models.Plan Plan {get;set;} 23Properties Property psobject Properties {get;set;} 24ResourceGroupName Property string ResourceGroupName {get;set;} 25ResourceId Property string ResourceId {get;set;} 26ResourceName Property string ResourceName {get;set;} 27ResourceType Property string ResourceType {get;set;} 28Sku Property Microsoft.Azure.Management.ResourceManager.Models.Sku Sku {get;set;} 29SubscriptionId Property string SubscriptionId {get;set;} 30Tags Property System.Collections.Generic.IDictionary[string,string] Tags {get;set;} 31Type Property string Type {get;set;}

この先、どこを見ればデプロイIDを見つけられるでしょうか?

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

stackoverflowに以下のような投稿があり、参考にして調べてみました。
https://stackoverflow.com/questions/45834981/how-to-get-the-configuration-of-cloudserviceclassic-with-azure-arm-api

通常のコマンドだけでは取れないようですね。ブラウザで動作するAzure Resource Explorer からResourceIDを調べて、そのリソースIDで取得するしかないようです。
CloudServiceのWebRoleは、ResourceTypeが"Microsoft.ClassicCompute/domainNames/slots/roles"となるのですが、Get-Resource でResourceType Microsoft.ClassicCompute/domainNames/slots/roles を指定しても何も取得できません。

お騒がせしました。

投稿2019/04/24 09:37

currysita

総合スコア40

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問