Graph query for accessing details of Azure storage, data management lifecycle policies

Ben Wild 0 Reputation points
2024-08-15T12:58:59.06+00:00

I'm trying to create a query that will retrieve the details of a lifecycle management policy held against our azure storage accounts and I'm struggling to find the right properties to retrieve the details I need.

Firstly, is this possible using Graph and if so, how might I achieve it.

Below is a screen shot of the sort of info I'm after that is found in the Azure portal.

ThanksUser's image

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,830 questions
Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
868 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Hitesh Pachipulusu - MSFT 1,180 Reputation points Microsoft Vendor
    2024-08-15T13:49:56.2366667+00:00

    Hello Ben Wild,

    Thank you for contacting Microsoft Support!

    Currently, retrieving the details of a lifecycle management policy for Azure Storage accounts using the Microsoft Graph API is not supported. However, you can achieve this using the Azure Resource Graph or Azure CLI.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


  2. Prashant Kumar 775 Reputation points Microsoft Employee
    2024-08-23T12:25:04.76+00:00

    Hi Ben,

    Unfortunately, it is not possible to get storage life cycle management policies through Azure Resource Graph. Currently ARG does not support all resource types and Microsoft.Storage/storageAccounts/managementPolicies is one of the not supported resource types.

    You can use PowerShell, CLI or REST API though.

    PS : https://video2.skills-academy.com/en-us/powershell/module/az.storage/get-azstorageaccountmanagementpolicy?view=azps-12.2.0

    CLI : https://video2.skills-academy.com/en-us/cli/azure/storage/account/management-policy?view=azure-cli-latest#az-storage-account-management-policy-show

    REST API: https://video2.skills-academy.com/en-us/rest/api/storagerp/management-policies/get?view=rest-storagerp-2023-05-01&tabs=HTTP

    Would strongly recommend to request for this in the community page: https://feedback.azure.com/d365community

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.