Activate Azure Resources using Powershell / API call

Pranav Bande 6 Reputation points
2022-05-18T12:17:49.063+00:00

Is there a way to activate my eligible subscriptions in Azure resource under PIM , through an API call / Powershell script ?
If Yes , Please help me with the code/script.
203199-image.png

Microsoft Entra
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Limitless Technology 39,341 Reputation points
    2022-05-19T07:23:54.973+00:00

    Hi there,

    You can deploy Azure resources directly by using Azure PowerShell.The following script creates a storage account.

    $resourceGroupName = Read-Host -Prompt "Enter the Resource Group name"
    $location = Read-Host -Prompt "Enter the location (i.e. centralus)"
    $storageAccountName = Read-Host -Prompt "Enter the storage account name"

    Create the storage account.

    $storageAccount = New-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $storageAccountName
    -Location $location `
    -SkuName "Standard_LRS"

    Retrieve the context.

    $ctx = $storageAccount.Context

    Some useful article links that might help you in getting some insights are listed below. Get started with Azure PowerShell https://learn.microsoft.com/en-us/powershell/azure/get-started-azureps?view=azps-7.5.0

    Tutorial: Grant a user access to Azure resources using Azure PowerShell https://learn.microsoft.com/en-us/azure/role-based-access-control/tutorial-role-assignments-user-powershell

    Manage Azure resources by using Azure PowerShell https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resources-powershell

    ----------------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept it as an answer–

    1 person found this answer helpful.
    0 comments No comments

  2. Luke Murray 10,526 Reputation points MVP
    2022-05-19T07:54:02.26+00:00
    1 person found this answer helpful.