-
Notifications
You must be signed in to change notification settings - Fork 2
[IDEA] YAML files to automate the provisioning of a Power Platform environment with creation of the service connection #8
Comments
Can we provide those within a YAML? Is this not stuff we have to do manually? |
Using the Azure DevOps CLI, it is possible to create a service endpoint using a configuration file (https://docs.microsoft.com/en-us/azure/devops/cli/service-endpoint?view=azure-devops#create-service-endpoint-using-a-configuration-file). For the Power Platform environment provisioning and the creation of the application user for the service principal connection, I think there is different ways to achieve this. |
I was in a meeting today were we talked about the management of applications registrations for the service principals. Even if I can understand some reasons around that idea (security for example), I am not sure it will help to automate the provisioning of environments (even if we could, in theory, automatically generate application registrations with the right access). As best practice, we could imagine having an application registration per category of environment.
What do you think @BenediktBergmann ? |
Can you confirm to me that the Create Environment task of the Power Platform Build Tools has been updated recently @BenediktBergmann? (see the screenshot below) It seems that there is now everything we need to manage the creation of new environments directly from a pipeline. |
That is actually a good first step at least. I am still missing the option to install several languages. We usually have English as the base language and swedish as an additional language. |
Indeed, I think it is a good first step even if it does not cover all your requirements around languages. Do you know if it is possible to add languages using PowerShell or a REST API? |
Regarding your comment about the App Registrations: Regarding the language: |
Hi Guys, you can look at this powershell package. I never try this particular method but there is a function called 'Enable-CrmLanguagePack' that does exactly this. We use this package regularly in our release pipelines for things like : disable autosave or other system settings ----EXAMPLE POWERSHELL SCRIPT--------- Write-Output "Installing Microsoft.Xrm.Data.PowerShell" #Write-Output "Installing Microsoft.CrmSdk.XrmTooling.CrmConnector.PowerShell" Write-Output "Connecting to CRM" Write-Output "Fetching organizationid" Write-Output "Changing setting on organization: $($organizationid)" Set-CrmRecord -EntityLogicalName organization -conn $conn -Id $organizationid -Fields @{"isautosaveenabled"= $false; "isexternalsearchindexenabled"= $true; "useskypeprotocol"=$false} $org = Get-CrmRecord -EntityLogicalName organization -conn $conn -Id $organizationid -Fields isautosaveenabled,isexternalsearchindexenabled,useskypeprotocol |
Thank you so much for the hint (again). I will try it. I also found the request that is needed for installing/enablind languages - Its ProvisionLanguageRequest |
@drivardxrm: Another question you might have some tips on. Have you managed to opt an environment into the early access via a script? |
@BenediktBergmann that would be a very good one. Not sure if it's (easilly) scriptable. Here is the request that is sent when you click on the Enable button: The tricky part would be to assess when the upgrade process is finished in order to put it in a release pipeline. By analyzing the request sent by the admin portal I think this could be achieved. The response gives the status of the upgrade in the AppsUpgradeState property Hope this helps, |
@BenediktBergmann I agree with you about the app registrations. I am like you and I think that one app registration per environment is overkill. @drivardxrm thank you for the help! Guys, perhaps we could create other issues for the points you talked about and keep this one for the first version of a group of yaml files for the provisioning of an environment with creation of a service connection. What do you think? |
@BenediktBergmann I have created the following issues for the other ideas we discussed in the thread of this one:
@drivardxrm I hope you will be ok with the fact I put the information you gave us in the description of these new issues. |
During the last tests of the YAML pipeline prepared for this issue, I always got an error about the 'canada' location that does not exist... It is a really strange error. I am currently doing my tests on a trial tenant without capacity, so perhaps the error come from that (there is a note regarding this point in the Microsoft documentation). I will try to make other tests in a tenant with some capacity in the next days to see if the pipeline works better there. |
@rpothin: Please let me know if I could assist with something here. I might have access to different tenants with capacity. |
Thank you @BenediktBergmann, I found a place with capacity to make more tests. But if you can test the pipelines in the current PR in a tenant where you have some capacity it could be great 😊 |
I have been able to make a test in a tenant with capacity, but unfortunately, I get the same error: The region 'canada' is invalid. Please enter the valid region or select from the picklist You can find below some details around the error I got configuring a simple pipeline with the Classic UI:
Do you have an idea regarding this error @BenediktBergmann ? I did not find anything about the Get-RegionKey PowerShell function that seems to be at the origin of this error... |
Just to avoid any confusion, I want to precise I am using the out-of-the-box Power Platform Create Environment action of the Power Platform Build Tools extension in that scenario. |
Having the same issue, any workarounds? |
Hey @mjfara, I created a support request few weeks ago, but it is still in investigation. |
Thanks I'd appreciate that. |
@mjfara there is perhaps a workaround using one of the latest versions of the Microsoft.PowerApps.Administration.PowerShell module in PowerShell. I will try to make some tests this weekend and I will let you know the results. I think you are at the right place for what you are trying to achieve. The goal of this issue is to prepare a pipeline in yaml to facilitate the creation of a new environment with its service connection in Azure DevOps. |
Ya we've been using a workaround in powershell, but we have to be logged in as a user, since the service principal does not have access to environments outside of the one it is associated with. Seems like we need a tenant-level service principal or something similar. But as you mentioned, having this all in the yaml pipeline would be ideal. |
Hello everyone, For your information, the error I had with the Power Platform Create Environment action in the Power Platform Build Tools extension for Azure DevOps seems corrected. |
Hello everyone, My last tests tonight have shown a new error in the Create Environment task of the Power Platform Build Tools extension. I will try to push this issue to Microsoft to be able to resolve it as soon as possible. |
Hello @rpothin, I also use the PowerApps create environment task in Azure DevOps and get the error: The region 'canada' is invalid. Please enter the valid region or select from the picklist. I noticed that you mentioned Microsoft.PowerApps.Administration.PowerShell, but I don't know how to use it. Would you mind telling me more about it? Any help would be appriciate. |
Hey @Olivia-devops, I am sorry I did not answer earlier. I will try to contact Microsoft to let them know that the fact the Create Environment task in the Power Platform Build Tools extension is so unstable make it impossible to use... In the same time, we can use:
I hope all this will help you. |
Hello @rpothin, thank you very much! |
To be able to use a Power Platform environment in your ALM process, we need 3 things (if we want to use service principal authentication):
One way to achieve all this is with YAML files.
The text was updated successfully, but these errors were encountered: