Follow the steps mentioned here to set up and administer a Power Catalog: Administer the catalog - Power Platform | Microsoft Learn
Add the URL of the required environment in environment variables in your ADO Pipeline or Github Workflow.
Import the CatalogExtension_1_0_1_3.zip present in the repository, in the environment where the catalog is created.
Open Power Catalog Manager App. Select Catalog Publishers and create a new publisher. Note the Publisher Name and the Publisher ID.
Install Pac cli. Use this documentation: Microsoft Power Platform CLI - Power Platform | Microsoft Learn
In the repository, Templates folder has all the Catalog items that need to be submitted in your target catalog.
In the Templates folder, each catalog item folder has a SubmissionDoc.json and a zip file.
Run update-submission-docs.ps1 – PowerShell script. Enter publisher ID, publisher name, Engineering contact details and support contact details when prompted while running the PowerShell script. This will update the above fields inside each SubmissionDoc json file.
Once the over script ran successfully, run submit-to-catalog-script.ps1 – PowerShell script. Enter the organization url.
To get thorganization url - Go to power apps home page. Choose the environment where the catalog is created. Click on settings -> Developer resources. Copy the Web API endpoint base url.
Clone the repository and open it in Visual Studio Code. Automation-Catalog-for-Power-Platform
-
Create an azure subscription or use an existing subscription. (Create an Enterprise Agreement subscription - Azure Cost Management + Billing | Microsoft Learn )
-
Make a note of the subscription ID
-
Create an application registration (Quickstart: Register an app in the Microsoft identity platform - Microsoft identity platform | Microsoft Learn )
-
While creating the app registration, use the default options.
-
Make a note of client ID and tenant ID from the app registration
Configuring Azure DevOps
Create a service connection (Service connections - Azure Pipelines | Microsoft Learn )
Use the following details, while creating a service connection.
-
Type: Azure Resource Manager
-
Authentication Method: Service Principal (automatic)
-
Scope Level: Subscription
-
Resource Group: (none)
-
Service connection name:
Make a note of service connection name.
Create an environment (Create and target environments - Azure Pipelines | Microsoft Learn )
Use the following details, while creating an environment.
-
Name:
-
Resource: None
Go to ‘Approvals and Checks’, and create an ‘Approvals’ check. Add people who may have to approve before deploying code into the resources.
Make a note of environment name.
-
Navigate to the Azure Pipelines and create a new pipeline and select a location for the pipeline.
-
Select the code location as ‘Azure DevOps’ and select the repository ‘Automation-Catalog-For-PowerPlatform’
-
Configure the YAML pipeline by selecting an existing YAML file ‘AutomationCatalogForPowerPlatform-DeployResources.yml’ and click ‘Review Pipeline’
-
Save the pipeline.
-
Open the pipeline in Azure DevOps
-
Click on variables and add the following variables.
-
Add the values for all the variables. Service Connection and environment names are the same used while creating them in the previous steps.
| Variable Name | Can be referenced from |
|---|---|
| poolName | Name of the pool that should be used to run the pipeline (Open you Azure DevOps. Go to Project settings-> Agent Pool to get this information) |
| serviceConnection | Refer in the same document - (Create a service connection in Azure DevOps) |
| Environment | Refer in the same document - (Create an environment in Azure DevOps) |
| ClientId | Refer in the same document - (Create an app registration) |
| TenantId | Refer in the same document - (Create an app registration) |
| SubscriptionId | Refer in the same document - (Create an enterprise subscription) |
| appService | Give your own name |
| appServicePlan | Give your own name |
| applicationInsights | Give your own name |
| storageAccount | Give your own name (*Storage account name must be between 3 and 24 characters in length and use numbers and lower-case letters only.) |
| ResourceGroupName | Give your own name |
| location | Give location of your preference where the resource group and resources should be present (eg: westus2) |
| catalogEnvUrl | URL of the environment associated with the catalog |
| catalogPublisherId | ID of the catalog publisher created |
| teamsAppId | Keep this empty. This variable should be set later. |
| feedbackFormUrl | URL to your feedback form |
| faqUrl | URL where FAQs are going to be present |
| adminEnvironment | Default Environment ID |
| AppInsightsConnectionString | Keep this empty. This variable should be set later. |
The service connection creates the resource group and resources when the pipeline is ran using bicep templates.
Give the following roles to the service connection at subscription level.
Assign Azure roles using the Azure portal - Azure RBAC | Microsoft Learn
Go to your subscription, click on the ‘Access Control (IAM)’ and assign the following roles
-
‘Corp Tenant DevOps Role’ //MS specific
-
‘Contributor’
-
‘Role Based Access Control’ (Revoke this access after deploying resources)
-
Run the pipeline which got created in the above step.
-
Make sure to tick the checkbox to Deploy resources.
-
Permit use of service connection when prompted.
-
Permit the environment to access/run the pipeline.
When the pipeline ran successfully, assign the following role.
Go to the storage account that got created in the resource group, click on the ‘Access Control (IAM)’.
Assign the following role ‘Storage Blob Table Contributor’ to the ‘appService’ that has been created in the resource group in the Azure subscription.
Configuring GitHub
Create a resource group in the azure portal. Make note of the name and the location selected. (Create a resource group)
Create a user assigned managed identity in azure portal. Choose an existing resource group or create new one if needed. (Create a user-assigned managed identity | Microsoft Learn )
-
To authenticate successfully to github, create federated credentials in the identity. Open the user assigned managed identity and open federated credentials.
-
Fill in the following details
| Federated Credential Scenario | Configure a GitHub issued token to impersonate this application and deploy to Azure |
| Issuer | [Refer in the same document - (Create an app registration)](https://token.actions.githubusercontent.com) |
| Organization | (Refer the organization name from github) |
| Repository | (Refer the repository name from github) |
| Entity | Branch |
| Branch | main |
Give a name to the credential and save it.
-
Navigate to the Github actions tab.
-
Workflows are already created from the yml present in .github/workflows/build-and-deploy-code.yml and .github/workflows/deploy-resources.yml
-
Open the settings tab in Github.
-
Click on secrets and variables and add the following variables and secrets.
-
Add the values for all the variables. Service Connection and environment names are the same used while creating them in the previous steps.
| Secret Name | Can be referenced from |
|---|---|
| AZURE_CLIENT_ID | Refer in the same document - (Create an app registration) |
| AZURE_TENANT_ID | Refer in the same document - (Create an app registration) |
| AZURE_SUBSCRIPTION_ID | Refer in the same document - (Create an enterprise subscription) |
| AZURE_FIC_CLIENT_ID | Refer in the same document - (Create a user assigned managed identity) |
| Variable Name | Can be referenced from |
|---|---|
| APPSERVICE | Give your own name |
| APPSERVICEPLAN | Give your own name |
| APPLICATIONINSIGHTS | Give your own name |
| STORAGEACCOUNT | Give your own name (*Storage account name must be between 3 and 24 characters in length and use numbers and lower-case letters only.) |
| RESOURCEGROUPNAME | Resource group created in earlier |
| LOCATION | Give location of your preference where the resource group and resources should be present (eg: westus2) |
| CATALOG_ENV_URL | URL of the environment associated with the catalog |
| CATALOG_PUBLISHER_ID | ID of the catalog publisher created |
| TEAMSAPPID | TEAMSAPPID_PH <This is a placeholder and should be used till a value is set.> |
| FEEDBACKFORMURL | FEEDBACKFORMURL_PH <This is a placeholder and should be used till a value is set.> URL to your feedback form |
| FAQURL | FAQURL_PH <This is a placeholder and should be used till a value is set.> URL where FAQs are going to be present |
| ADMINENVIRONMENT | Default Environment ID |
| APPINSIGHTSCONNECTIONSTRING | Keep this empty. This variable should be set later. |
The managed identity should be given permissions to create the resource group and resources when the pipeline is ran using bicep templates.
Give the following roles to the identity at subscription level.
Assign Azure roles using the Azure portal - Azure RBAC | Microsoft Learn
Go to your subscription, click on the ‘Access Control (IAM)’ and assign the following roles
-
‘Contributor’
-
‘Role Based Access Control’ (Revoke this access after deploying resources)
- Run the deploy-resources workflow which got created in the above step.
When the workflow ran successfully, assign the following role.
Add federated credentials to the app registration with the for the system-assigned managed identity of the app service.
Go to the storage account that got created in the resource group, click on the ‘Access Control (IAM)’.
Assign the role ‘Storage Blob Table Contributor’ to the App Service that has been created in the resource group in the Azure subscription.
-
Open the repository in Visual Studio Code and navigate to ‘AutomationHub.Client/manifest’ directory. This directory has a manifest.json file, color.png and outline.png
-
Open manifest.json and replace the following metadata in the manifest file
a. Look for <> in the json file. Replace it with name of the appService. Give the same name as given in step 5 - Update the pipeline variables
b. Look for <> in the json file. Replace it with Client ID. Give the same value as in step 2 - Create an app registration
- Save the json file and zip the manifest directory.
-
From the manifest, copy the “webApplicationInfo: resource“.
-
Open the app registration we created earlier, and click on Manage>Expose an API.
-
Add Application ID URI, and paste the value we copied from manifest file and save it.
-
In the "Expose an API" screen, add a scope
access\_as\_user, with consent set to Admin only. -
In the "Expose an API" screen, add client applications "1fec8e78-bce4-4aaf-ab1b-5451cc387264", "5e3ce6c0-2b1f-4285-8d4b-75ee78787346" with the above scope.
-
Go to "Manifest" and update
accessTokenAcceptedVersionkey to 2 -
Make sure admin consent has been granted for the following scopes to your app registration:
- Graph user.read
- Dynamics.CRM user_impersonation
Use the following instructions for sideloading the zip file
-
Open teams app and choose Apps in the left side pane.
-
Click on Manage your Apps and select Upload an app.
-
Upload the created zip file.
On the first load, if there are no items in the connected catalog, a spinner will show indefinitely.
Publish App on Teams Store - Teams | Microsoft Learn Use the instructions in the above link and publish the teams app. Please note that you may need to reach out to the admin team to understand any tenant-specific steps.
Open the application insights that got created. Open Configure->Properties and make note of the connection string present there.
- Open the pipeline in Azure DevOps
- Click on variables and update the value the following variable, after publishing the app to teams and re-run the pipeline.
| Variable Name | Can be referenced from |
|---|---|
| teamsAppId | Teams App ID from the publishing process |
| AppInsightsConnectionString | Application Insights Connection String noted from previous step |
- Open the repo in Github, navigate to the Settings page, and select "Actions" under "Secrets and Certificates".
- Update the following variables.
| Variable Name | Can be referenced from |
|---|---|
| TEAMSAPPID | Teams App ID from the publishing process |
| APPINSIGHTSCONNECTIONSTRING | Application Insights Connection String noted from previous step |
- While running the pipeline, if you see an error of the kind: MissingSubscriptionRegistration: The subscription is not registered to use namespace 'Microsoft.Web'. Follow the steps mentioned here: Resource provider registration errors - Azure Resource Manager | Microsoft Learn