question

PranavBande-3573 avatar image
0 Votes"
PranavBande-3573 asked JamesTran-MSFT edited

Activate Azure Resources using Powershell / API call

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


azure-ad-privileged-identity-management
image.png (19.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LimitlessTechnology-2700 avatar image
1 Vote"
LimitlessTechnology-2700 answered

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://docs.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://docs.microsoft.com/en-us/azure/role-based-access-control/tutorial-role-assignments-user-powershell

Manage Azure resources by using Azure PowerShell https://docs.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–

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

lukemurraynz avatar image
1 Vote"
lukemurraynz answered
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.