cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sanjeev40084
Regular Visitor

Setup Power Platform Security Group from CLI

Is there a way to setup power platform environment with the database's security group from CLI? I didn't see any command on pac cli nor in powershell side. 

 

Thanks,

Sanjeev

5 REPLIES 5
Ionaaa
Helper II
Helper II

Yes you can 😁

https://docs.microsoft.com/en-us/powershell/module/microsoft.powerapps.administration.powershell/new...

The Powerapps administration powershell module has the following command:

 

New-AdminPowerAppEnvironment

 

Which takes as inputs:

 

   [-DisplayName <String>]
   -LocationName <String>
   -EnvironmentSku <String>
   [-ProvisionDatabase]
   [-CurrencyName <String>]
   [-LanguageName <String>]
   [-Templates <String[]>]
   [-SecurityGroupId <String>]
   [-DomainName <String>]
   [-WaitUntilFinished <Boolean>]
   [-ApiVersion <String>]
   [<CommonParameters>]

 so you can actually pas the Azure security group ID!

sanjeev40084
Regular Visitor

Thank you. It seems like you can only do that while creating new instance. Do you know if that can be done while resetting the instance too?

Ionaaa
Helper II
Helper II

Not sure if you can actually reset and assign a security group in one call, but you have options in that module to add security groups. It is also possible to do via REST api, so there are some options, might require combining some actions.

sanjeev40084
Regular Visitor

can you provide me rest api info?

Ionaaa
Helper II
Helper II

I don't have the documentation at hand right now, but you could reverse engineer the Power Automate action 😉

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (4,288)